Fixed method name.
This commit is contained in:
@@ -22,7 +22,7 @@ public class EnergyStorageDeviceProvider extends AbstractCapabilityAnyTileEntity
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
protected LazyOptional<Device> getDeviceInterface(final BlockDeviceQuery query, final IEnergyStorage value) {
|
||||
protected LazyOptional<Device> getDevice(final BlockDeviceQuery query, final IEnergyStorage value) {
|
||||
return LazyOptional.of(() -> new ObjectDevice(new EnergyStorageDevice(value), ENERGY_STORAGE_TYPE_NAME));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class FluidHandlerDeviceProvider extends AbstractCapabilityAnyTileEntityD
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
protected LazyOptional<Device> getDeviceInterface(final BlockDeviceQuery query, final IFluidHandler value) {
|
||||
protected LazyOptional<Device> getDevice(final BlockDeviceQuery query, final IFluidHandler value) {
|
||||
return LazyOptional.of(() -> new ObjectDevice(new FluidHandlerDevice(value), FLUID_HANDLER_TYPE_NAME));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ItemHandlerDeviceProvider extends AbstractCapabilityAnyTileEntityDe
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
protected LazyOptional<Device> getDeviceInterface(final BlockDeviceQuery query, final IItemHandler value) {
|
||||
protected LazyOptional<Device> getDevice(final BlockDeviceQuery query, final IItemHandler value) {
|
||||
return LazyOptional.of(() -> new ObjectDevice(new ItemHandlerDevice(value), ITEM_HANDLER_TYPE_NAME));
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public abstract class AbstractCapabilityTileEntityDeviceProvider<TCapability, TT
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final LazyOptional<Device> getDeviceInterface(final BlockDeviceQuery blockQuery, final TileEntity tileEntity) {
|
||||
protected final LazyOptional<Device> getDevice(final BlockDeviceQuery blockQuery, final TileEntity tileEntity) {
|
||||
final Capability<TCapability> capability = capabilitySupplier.get();
|
||||
if (capability == null) throw new IllegalStateException();
|
||||
final LazyOptional<TCapability> optional = tileEntity.getCapability(capability, blockQuery.getQuerySide());
|
||||
@@ -28,10 +28,10 @@ public abstract class AbstractCapabilityTileEntityDeviceProvider<TCapability, TT
|
||||
}
|
||||
|
||||
final TCapability value = optional.orElseThrow(AssertionError::new);
|
||||
final LazyOptional<Device> device = getDeviceInterface(blockQuery, value);
|
||||
final LazyOptional<Device> device = getDevice(blockQuery, value);
|
||||
optional.addListener(ignored -> device.invalidate());
|
||||
return device;
|
||||
}
|
||||
|
||||
protected abstract LazyOptional<Device> getDeviceInterface(final BlockDeviceQuery query, final TCapability value);
|
||||
protected abstract LazyOptional<Device> getDevice(final BlockDeviceQuery query, final TCapability value);
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ public abstract class AbstractTileEntityDeviceProvider<T extends TileEntity> imp
|
||||
return LazyOptional.empty();
|
||||
}
|
||||
|
||||
return getDeviceInterface(blockQuery, (T) tileEntity);
|
||||
return getDevice(blockQuery, (T) tileEntity);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
protected abstract LazyOptional<Device> getDeviceInterface(final BlockDeviceQuery query, final T tileEntity);
|
||||
protected abstract LazyOptional<Device> getDevice(final BlockDeviceQuery query, final T tileEntity);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public final class TileEntityDeviceProvider extends AbstractTileEntityDeviceProv
|
||||
}
|
||||
|
||||
@Override
|
||||
public LazyOptional<Device> getDeviceInterface(final BlockDeviceQuery query, final TileEntity tileEntity) {
|
||||
public LazyOptional<Device> getDevice(final BlockDeviceQuery query, final TileEntity tileEntity) {
|
||||
if (Callbacks.hasMethods(tileEntity)) {
|
||||
return LazyOptional.of(() -> {
|
||||
final String typeName = WorldUtils.getBlockName(query.getWorld(), query.getQueryPosition());
|
||||
|
||||
Reference in New Issue
Block a user