public class PistonContraption extends TranslatingContraption
  • Field Details

    • extensionLength

      protected int extensionLength
    • initialExtensionProgress

      protected int initialExtensionProgress
    • orientation

      protected net.minecraft.core.Direction orientation
  • Constructor Details

    • PistonContraption

      public PistonContraption()
    • PistonContraption

      public PistonContraption(net.minecraft.core.Direction direction, boolean retract)
  • Method Details

    • getType

      protected ContraptionType getType()
      Specified by:
      getType in class Contraption
    • assemble

      public boolean assemble(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) throws AssemblyException
      Specified by:
      assemble in class Contraption
      Throws:
      AssemblyException
    • isAnchoringBlockAt

      protected boolean isAnchoringBlockAt(net.minecraft.core.BlockPos pos)
      Overrides:
      isAnchoringBlockAt in class Contraption
    • addToInitialFrontier

      protected boolean addToInitialFrontier(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction, Queue<net.minecraft.core.BlockPos> frontier) throws AssemblyException
      Overrides:
      addToInitialFrontier in class Contraption
      Throws:
      AssemblyException
    • addBlock

      public void addBlock(net.minecraft.core.BlockPos pos, org.apache.commons.lang3.tuple.Pair<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo,net.minecraft.world.level.block.entity.BlockEntity> capture)
      Overrides:
      addBlock in class Contraption
    • toLocalPos

      public net.minecraft.core.BlockPos toLocalPos(net.minecraft.core.BlockPos globalPos)
      Overrides:
      toLocalPos in class Contraption
    • customBlockPlacement

      protected boolean customBlockPlacement(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Overrides:
      customBlockPlacement in class Contraption
    • customBlockRemoval

      protected boolean customBlockRemoval(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Overrides:
      customBlockRemoval in class Contraption
    • readNBT

      public void readNBT(net.minecraft.world.level.Level world, net.minecraft.nbt.CompoundTag nbt, boolean spawnData)
      Overrides:
      readNBT in class Contraption
    • writeNBT

      public net.minecraft.nbt.CompoundTag writeNBT(boolean spawnPacket)
      Overrides:
      writeNBT in class Contraption
    • makeLighter

      public ContraptionLighter<?> makeLighter()
      Overrides:
      makeLighter in class Contraption