Class CableDefault
java.lang.Object
org.cyclops.integrateddynamics.capability.cable.CableDefault
- All Implemented Interfaces:
ICable
- Direct Known Subclasses:
CableTile
Default implementation of
ICable.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConnect(ICable connector, net.minecraft.core.Direction side) Check if this part should connect with the given cable for the given side.voiddisconnect(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.ItemStackprotected abstract net.minecraft.world.level.LevelgetLevel()protected abstract net.minecraft.core.BlockPosgetPos()booleanisConnected(net.minecraft.core.Direction side) Check if this cable is connected to a side.protected abstract booleanprotected booleanisForceDisconnected(net.minecraft.core.Direction side) voidreconnect(net.minecraft.core.Direction side) Reconnect the cable connection for a side.protected abstract voidprotected abstract voidvoidupdateConnections(boolean setChanged) Update the cable connections.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.block.cable.ICable
destroy, updateConnections
-
Constructor Details
-
CableDefault
public CableDefault()
-
-
Method Details
-
isForceDisconnectable
protected abstract boolean isForceDisconnectable() -
getForceDisconnected
protected abstract org.cyclops.cyclopscore.datastructure.EnumFacingMap<Boolean> getForceDisconnected() -
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
Description copied from interface:ICableCheck if this part should connect with the given cable for the given side. This method MUST NOT call theICable.canConnect(ICable, Direction)method of the connector, this is checked externally, otherwise infinite loops will occur.- Specified by:
canConnectin interfaceICable- 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:ICableUpdate the cable connections.- Specified by:
updateConnectionsin interfaceICable- Parameters:
setChanged- If the block entity should be marked as changed.
-
isConnected
public boolean isConnected(net.minecraft.core.Direction side) Description copied from interface:ICableCheck if this cable is connected to a side. This method should not check any neighbours, it should internally store the connection.- Specified by:
isConnectedin interfaceICable- 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:ICableDisconnect the cable connection for a side.- Specified by:
disconnectin interfaceICable- Parameters:
side- The side to block the connection for.
-
reconnect
public void reconnect(net.minecraft.core.Direction side) Description copied from interface:ICableReconnect the cable connection for a side. Will only do something if the cable was previously disconnected. -
getItemStack
public net.minecraft.world.item.ItemStack getItemStack()- Specified by:
getItemStackin interfaceICable- Returns:
- The item stack that is dropped when breaking this cable, when using a wrench for example.
-