Class TubeBehaviour
java.lang.Object
com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
com.petrolpark.compat.create.core.tube.TubeBehaviour
public class TubeBehaviour
extends com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected intprotected net.minecraft.core.BlockPosprotected TubeSplineprotected final ITubeBlockEntitystatic final com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<TubeBehaviour>Fields inherited from class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
blockEntity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect(TubeSpline spline) voiddestroy()voidvoiddisconnect(BiConsumer<TubeBehaviour, BigItemStack> leftoverItemsConsumer) Remove the Tube connecting the two end Blocks.voiddropItemsAlongSpline(BigItemStack stack) static Optional<TubeBehaviour>get(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) net.minecraft.core.BlockPosGet thespline.Get theTubeSplinefor this pair of Tube BEs.com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<TubeBehaviour>getType()booleanvoidplaySound(boolean destroy) voidread(net.minecraft.nbt.CompoundTag nbt, boolean clientPacket) booleanreconnect(net.minecraft.world.entity.player.Player player, boolean tryOtherIfNotController) voidreconnectClient(TubeSpline oldSpline, net.minecraft.world.item.ItemStack stack) voidvoidtick()voidwrite(net.minecraft.nbt.CompoundTag nbt, boolean clientPacket) Methods inherited from class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
get, get, getPos, getRequiredItems, getWorld, initialize, isSafeNBT, lazyTick, onBlockChanged, onNeighborChanged, setLazyTickRate, unload, writeSafe
-
Field Details
-
TYPE
public static final com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<TubeBehaviour> TYPE -
tubeBlockEntity
-
controller
protected boolean controller -
initializationTicks
protected int initializationTicks -
spline
-
otherEndPos
protected net.minecraft.core.BlockPos otherEndPos -
disconnecting
protected boolean disconnecting
-
-
Constructor Details
-
TubeBehaviour
public TubeBehaviour(BE be)
-
-
Method Details
-
isController
public boolean isController() -
getSplineOptional
Get theTubeSplinefor this pair of Tube BEs.- Returns:
- Optional containing the Spline if it exists
-
getSpline
Get thespline.- Returns:
- The Spline, if it exists and this is the
controller, ornullotherwise - See Also:
-
getOtherEndPos
public net.minecraft.core.BlockPos getOtherEndPos() -
connect
-
disconnect
public void disconnect() -
disconnect
Remove the Tube connecting the two end Blocks.- Parameters:
leftoverItemsConsumer- What to do with the Items left over. This accepts thecontrollerTubeBehaviour, which you should use if you need to access theSpline.- See Also:
-
dropItemsAlongSpline
-
sendDestroyTubeParticles
public void sendDestroyTubeParticles() -
playSound
public void playSound(boolean destroy) -
reconnect
public boolean reconnect(net.minecraft.world.entity.player.Player player, boolean tryOtherIfNotController) -
reconnectClient
-
getRequiredStack
-
get
public static Optional<TubeBehaviour> get(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) -
tick
public void tick()- Overrides:
tickin classcom.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-
destroy
public void destroy()- Overrides:
destroyin classcom.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-
read
public void read(net.minecraft.nbt.CompoundTag nbt, boolean clientPacket) - Overrides:
readin classcom.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-
write
public void write(net.minecraft.nbt.CompoundTag nbt, boolean clientPacket) - Overrides:
writein classcom.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-
getType
- Specified by:
getTypein classcom.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-