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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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
getLevel()
protected abstract net.minecraft.core.BlockPos
getPos()
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.
-
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:ICable
Check 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:
canConnect
in interfaceICable
- 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 interfaceICable
-
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 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:ICable
Disconnect the cable connection for a side.- Specified by:
disconnect
in interfaceICable
- 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. -
getItemStack
public net.minecraft.world.item.ItemStack getItemStack()- Specified by:
getItemStack
in interfaceICable
- Returns:
- The item stack that is dropped when breaking this cable, when using a wrench for example.
-