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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canConnect(ICable connector, net.minecraft.core.Direction side)
    Check if this part should connect with the given cable for the given side.
    void
    disconnect(net.minecraft.core.Direction side)
    Disconnect the cable connection for a side.
    protected abstract org.cyclops.cyclopscore.datastructure.EnumFacingMap<Boolean>
     
    protected abstract org.cyclops.cyclopscore.datastructure.EnumFacingMap<Boolean>
     
    net.minecraft.world.item.ItemStack
     
    protected abstract net.minecraft.world.level.Level
     
    protected abstract net.minecraft.core.BlockPos
     
    boolean
    isConnected(net.minecraft.core.Direction side)
    Check if this cable is connected to a side.
    protected abstract boolean
     
    protected boolean
    isForceDisconnected(net.minecraft.core.Direction side)
     
    void
    reconnect(net.minecraft.core.Direction side)
    Reconnect the cable connection for a side.
    protected abstract void
     
    protected abstract void
     
    void
    Update the cable connections.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.cyclops.integrateddynamics.api.block.cable.ICable

    destroy
  • 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()
      Description copied from interface: ICable
      Update the cable connections.
      Specified by:
      updateConnections in interface ICable
    • 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.