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 Details

    • TYPE

      public static final com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<TubeBehaviour> TYPE
    • tubeBlockEntity

      protected final ITubeBlockEntity tubeBlockEntity
    • controller

      protected boolean controller
    • initializationTicks

      protected int initializationTicks
    • spline

      protected TubeSpline 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

      public Optional<TubeSpline> getSplineOptional()
      Get the TubeSpline for this pair of Tube BEs.
      Returns:
      Optional containing the Spline if it exists
    • getSpline

      public TubeSpline getSpline()
      Get the spline.
      Returns:
      The Spline, if it exists and this is the controller, or null otherwise
      See Also:
    • getOtherEndPos

      public net.minecraft.core.BlockPos getOtherEndPos()
    • connect

      public void connect(TubeSpline spline)
    • disconnect

      public void disconnect()
    • disconnect

      public void disconnect(BiConsumer<TubeBehaviour,BigItemStack> leftoverItemsConsumer)
      Remove the Tube connecting the two end Blocks.
      Parameters:
      leftoverItemsConsumer - What to do with the Items left over. This accepts the controller TubeBehaviour, which you should use if you need to access the Spline.
      See Also:
    • dropItemsAlongSpline

      public void dropItemsAlongSpline(BigItemStack stack)
    • sendDestroyTubeParticles

      public void sendDestroyTubeParticles()
    • playSound

      public void playSound(boolean destroy)
    • reconnect

      public boolean reconnect(net.minecraft.world.entity.player.Player player, boolean tryOtherIfNotController)
    • reconnectClient

      public void reconnectClient(TubeSpline oldSpline, net.minecraft.world.item.ItemStack stack)
    • getRequiredStack

      public BigItemStack getRequiredStack()
    • get

      public static Optional<TubeBehaviour> get(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    • tick

      public void tick()
      Overrides:
      tick in class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
    • destroy

      public void destroy()
      Overrides:
      destroy in class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
    • read

      public void read(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
      Overrides:
      read in class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
    • write

      public void write(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
      Overrides:
      write in class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
    • getType

      public com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<TubeBehaviour> getType()
      Specified by:
      getType in class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour