diff --git a/src/main/java/com/simibubi/create/compat/computercraft/ComputerControllable.java b/src/main/java/com/simibubi/create/compat/computercraft/ComputerControllable.java index 0a91e7d4c..70dfb38f8 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/ComputerControllable.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/ComputerControllable.java @@ -14,24 +14,24 @@ public interface ComputerControllable { IPeripheral createPeripheral(); - void setPeripheralHandler(LazyOptional peripheralHandler); + void setPeripheral(LazyOptional peripheral); - LazyOptional getPeripheralHandler(); + LazyOptional getPeripheral(); default LazyOptional getPeripheralCapability(@NotNull Capability cap) { if (cap == PERIPHERAL_CAPABILITY) { - if (getPeripheralHandler() == null || !getPeripheralHandler().isPresent()) - setPeripheralHandler(LazyOptional.of(this::createPeripheral)); + if (getPeripheral() == null || !getPeripheral().isPresent()) + setPeripheral(LazyOptional.of(this::createPeripheral)); - return getPeripheralHandler().cast(); + return getPeripheral().cast(); } return LazyOptional.empty(); } default void removePeripheral() { - if (getPeripheralHandler() != null) - getPeripheralHandler().invalidate(); + if (getPeripheral() != null) + getPeripheral().invalidate(); } } diff --git a/src/main/java/com/simibubi/create/compat/computercraft/DisplayLinkPeripheral.java b/src/main/java/com/simibubi/create/compat/computercraft/DisplayLinkPeripheral.java index 5fb96553e..097b5d2f9 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/DisplayLinkPeripheral.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/DisplayLinkPeripheral.java @@ -124,12 +124,12 @@ public class DisplayLinkPeripheral implements IPeripheral { @NotNull @Override public String getType() { - return "cdl"; + return "Create_DisplayLink"; } @Override public boolean equals(@Nullable IPeripheral other) { - return false; + return this == other; } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/display/DisplayLinkTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/display/DisplayLinkTileEntity.java index bb7d36449..19310b53b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/display/DisplayLinkTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/display/DisplayLinkTileEntity.java @@ -42,7 +42,7 @@ public class DisplayLinkTileEntity extends SmartTileEntity implements ComputerCo public int refreshTicks; - private LazyOptional peripheralHandler; + private LazyOptional peripheral; public DisplayLinkTileEntity(BlockEntityType type, BlockPos pos, BlockState state) { super(type, pos, state); @@ -203,13 +203,13 @@ public class DisplayLinkTileEntity extends SmartTileEntity implements ComputerCo } @Override - public void setPeripheralHandler(LazyOptional peripheralHandler) { - this.peripheralHandler = peripheralHandler; + public void setPeripheral(LazyOptional peripheral) { + this.peripheral = peripheral; } @Override - public LazyOptional getPeripheralHandler() { - return this.peripheralHandler; + public LazyOptional getPeripheral() { + return this.peripheral; } public void target(BlockPos targetPosition) {