java.lang.Object
org.cyclops.integrateddynamics.capability.cable.CableDefault
All Implemented Interfaces:
ICable
Direct Known Subclasses:
CableTile

public abstract class CableDefault extends Object implements ICable
Default implementation of ICable.
  • Constructor Details

    • CableDefault

      public CableDefault()
  • Method Details

    • isForceDisconnectable

      protected abstract boolean isForceDisconnectable()
    • getForceDisconnected

      protected abstract org.cyclops.cyclopscore.datastructure.EnumFacingMap<Boolean> getForceDisconnected()
    • getConnected

      protected abstract org.cyclops.cyclopscore.datastructure.EnumFacingMap<Boolean> getConnected()
    • setChanged

      protected abstract void setChanged()
    • sendUpdate

      protected abstract void sendUpdate()
    • getLevel

      protected abstract net.minecraft.world.level.Level getLevel()
    • getPos

      protected abstract net.minecraft.core.BlockPos getPos()
    • isForceDisconnected

      protected boolean isForceDisconnected(net.minecraft.core.Direction side)
    • canConnect

      public boolean canConnect(ICable connector, net.minecraft.core.Direction side)
      Description copied from interface: ICable
      Check if this part should connect with the given cable for the given side. This method MUST NOT call the ICable.canConnect(ICable, Direction) method of the connector, this is checked externally, otherwise infinite loops will occur.
      Specified by:
      canConnect in interface ICable
      Parameters:
      connector - The connecting block.
      side - The side of the connecting block.
      Returns:
      If it should connect.
    • updateConnections

      public void updateConnections(boolean setChanged)
      Description copied from interface: ICable
      Update the cable connections.
      Specified by:
      updateConnections in interface ICable
      Parameters:
      setChanged - If the block entity should be marked as changed.
    • isConnected

      public boolean isConnected(net.minecraft.core.Direction side)
      Description copied from interface: ICable
      Check if this cable is connected to a side. This method should not check any neighbours, it should internally store the connection.
      Specified by:
      isConnected in interface ICable
      Parameters:
      side - The side to check a connection for.
      Returns:
      If this block is connected with that side.
    • disconnect

      public void disconnect(net.minecraft.core.Direction side)
      Description copied from interface: ICable
      Disconnect the cable connection for a side.
      Specified by:
      disconnect in interface ICable
      Parameters:
      side - The side to block the connection for.
    • reconnect

      public void reconnect(net.minecraft.core.Direction side)
      Description copied from interface: ICable
      Reconnect the cable connection for a side. Will only do something if the cable was previously disconnected.
      Specified by:
      reconnect in interface ICable
      Parameters:
      side - The side to remake the connection for.
    • getItemStack

      public net.minecraft.world.item.ItemStack getItemStack()
      Specified by:
      getItemStack in interface ICable
      Returns:
      The item stack that is dropped when breaking this cable, when using a wrench for example.