Class PistonBlockEntity

java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.PistonBlockEntity

public class PistonBlockEntity extends BlockEntity
A piston block entity represents the block being pushed by a piston.
Mappings:
Namespace Name
named net/minecraft/block/entity/PistonBlockEntity
intermediary net/minecraft/class_2669
official dsy
  • Field Details Link icon

    • field_31382 Link icon

      private static final int field_31382
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_31382 Lnet/minecraft/block/entity/PistonBlockEntity;field_31382:I
      intermediary field_31382 Lnet/minecraft/class_2669;field_31382:I
      official b Ldsy;b:I
    • field_31383 Link icon

      private static final double field_31383
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_31383 Lnet/minecraft/block/entity/PistonBlockEntity;field_31383:D
      intermediary field_31383 Lnet/minecraft/class_2669;field_31383:D
      official c Ldsy;c:D
    • field_31381 Link icon

      public static final double field_31381
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_31381 Lnet/minecraft/block/entity/PistonBlockEntity;field_31381:D
      intermediary field_31381 Lnet/minecraft/class_2669;field_31381:D
      official a Ldsy;a:D
    • entityMovementDirection Link icon

      private static final ThreadLocal<Direction> entityMovementDirection
      Mappings:
      Namespace Name Mixin selector
      named entityMovementDirection Lnet/minecraft/block/entity/PistonBlockEntity;entityMovementDirection:Ljava/lang/ThreadLocal;
      intermediary field_12205 Lnet/minecraft/class_2669;field_12205:Ljava/lang/ThreadLocal;
      official h Ldsy;h:Ljava/lang/ThreadLocal;
    • pushedBlock Link icon

      private BlockState pushedBlock
      Mappings:
      Namespace Name Mixin selector
      named pushedBlock Lnet/minecraft/block/entity/PistonBlockEntity;pushedBlock:Lnet/minecraft/block/BlockState;
      intermediary field_12204 Lnet/minecraft/class_2669;field_12204:Lnet/minecraft/class_2680;
      official d Ldsy;d:Ldtc;
    • facing Link icon

      private Direction facing
      Mappings:
      Namespace Name Mixin selector
      named facing Lnet/minecraft/block/entity/PistonBlockEntity;facing:Lnet/minecraft/util/math/Direction;
      intermediary field_12201 Lnet/minecraft/class_2669;field_12201:Lnet/minecraft/class_2350;
      official e Ldsy;e:Lji;
    • extending Link icon

      private boolean extending
      Mappings:
      Namespace Name Mixin selector
      named extending Lnet/minecraft/block/entity/PistonBlockEntity;extending:Z
      intermediary field_12203 Lnet/minecraft/class_2669;field_12203:Z
      official f Ldsy;f:Z
    • source Link icon

      private boolean source
      Mappings:
      Namespace Name Mixin selector
      named source Lnet/minecraft/block/entity/PistonBlockEntity;source:Z
      intermediary field_12202 Lnet/minecraft/class_2669;field_12202:Z
      official g Ldsy;g:Z
    • progress Link icon

      private float progress
      Mappings:
      Namespace Name Mixin selector
      named progress Lnet/minecraft/block/entity/PistonBlockEntity;progress:F
      intermediary field_12207 Lnet/minecraft/class_2669;field_12207:F
      official i Ldsy;i:F
    • lastProgress Link icon

      private float lastProgress
      Mappings:
      Namespace Name Mixin selector
      named lastProgress Lnet/minecraft/block/entity/PistonBlockEntity;lastProgress:F
      intermediary field_12206 Lnet/minecraft/class_2669;field_12206:F
      official j Ldsy;j:F
    • savedWorldTime Link icon

      private long savedWorldTime
      Mappings:
      Namespace Name Mixin selector
      named savedWorldTime Lnet/minecraft/block/entity/PistonBlockEntity;savedWorldTime:J
      intermediary field_12208 Lnet/minecraft/class_2669;field_12208:J
      official k Ldsy;k:J
    • field_26705 Link icon

      private int field_26705
      Mappings:
      Namespace Name Mixin selector
      named field_26705 Lnet/minecraft/block/entity/PistonBlockEntity;field_26705:I
      intermediary field_26705 Lnet/minecraft/class_2669;field_26705:I
      official l Ldsy;l:I
  • Constructor Details Link icon

    • PistonBlockEntity Link icon

      public PistonBlockEntity(BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/block/entity/PistonBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
      intermediary <init> Lnet/minecraft/class_2669;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      official <init> Ldsy;<init>(Ljd;Ldtc;)V
    • PistonBlockEntity Link icon

      public PistonBlockEntity(BlockPos pos, BlockState state, BlockState pushedBlock, Direction facing, boolean extending, boolean source)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/block/entity/PistonBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;ZZ)V
      intermediary <init> Lnet/minecraft/class_2669;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;ZZ)V
      official <init> Ldsy;<init>(Ljd;Ldtc;Ldtc;Lji;ZZ)V
  • Method Details Link icon

    • toInitialChunkDataNbt Link icon

      public NbtCompound toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registryLookup)
      Returns the serialized state of this block entity that is observable by clients.

      This is sent alongside the initial chunk data, as well as when the block entity implements BlockEntity.toUpdatePacket() and decides to use the default BlockEntityUpdateS2CPacket.

      "Observable state" is a state that clients can observe without specific interaction. For example, CampfireBlockEntity's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.

      To send all NBT data of this block entity saved to disk, return BlockEntity.createNbt(net.minecraft.registry.RegistryWrapper.WrapperLookup).

      Overrides:
      toInitialChunkDataNbt in class BlockEntity
      Returns:
      the serialized state of this block entity that is observable by clients
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named toInitialChunkDataNbt Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;
      intermediary method_16887 Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;
      official a Ldqh;a(Ljo$a;)Lub;
    • isExtending Link icon

      public boolean isExtending()
      Mappings:
      Namespace Name Mixin selector
      named isExtending Lnet/minecraft/block/entity/PistonBlockEntity;isExtending()Z
      intermediary method_11501 Lnet/minecraft/class_2669;method_11501()Z
      official b Ldsy;b()Z
    • getFacing Link icon

      public Direction getFacing()
      Mappings:
      Namespace Name Mixin selector
      named getFacing Lnet/minecraft/block/entity/PistonBlockEntity;getFacing()Lnet/minecraft/util/math/Direction;
      intermediary method_11498 Lnet/minecraft/class_2669;method_11498()Lnet/minecraft/class_2350;
      official c Ldsy;c()Lji;
    • isSource Link icon

      public boolean isSource()
      Mappings:
      Namespace Name Mixin selector
      named isSource Lnet/minecraft/block/entity/PistonBlockEntity;isSource()Z
      intermediary method_11515 Lnet/minecraft/class_2669;method_11515()Z
      official d Ldsy;d()Z
    • getProgress Link icon

      public float getProgress(float tickDelta)
      Mappings:
      Namespace Name Mixin selector
      named getProgress Lnet/minecraft/block/entity/PistonBlockEntity;getProgress(F)F
      intermediary method_11499 Lnet/minecraft/class_2669;method_11499(F)F
      official a Ldsy;a(F)F
    • getRenderOffsetX Link icon

      public float getRenderOffsetX(float tickDelta)
      Mappings:
      Namespace Name Mixin selector
      named getRenderOffsetX Lnet/minecraft/block/entity/PistonBlockEntity;getRenderOffsetX(F)F
      intermediary method_11494 Lnet/minecraft/class_2669;method_11494(F)F
      official b Ldsy;b(F)F
    • getRenderOffsetY Link icon

      public float getRenderOffsetY(float tickDelta)
      Mappings:
      Namespace Name Mixin selector
      named getRenderOffsetY Lnet/minecraft/block/entity/PistonBlockEntity;getRenderOffsetY(F)F
      intermediary method_11511 Lnet/minecraft/class_2669;method_11511(F)F
      official c Ldsy;c(F)F
    • getRenderOffsetZ Link icon

      public float getRenderOffsetZ(float tickDelta)
      Mappings:
      Namespace Name Mixin selector
      named getRenderOffsetZ Lnet/minecraft/block/entity/PistonBlockEntity;getRenderOffsetZ(F)F
      intermediary method_11507 Lnet/minecraft/class_2669;method_11507(F)F
      official d Ldsy;d(F)F
    • getAmountExtended Link icon

      private float getAmountExtended(float progress)
      Mappings:
      Namespace Name Mixin selector
      named getAmountExtended Lnet/minecraft/block/entity/PistonBlockEntity;getAmountExtended(F)F
      intermediary method_11504 Lnet/minecraft/class_2669;method_11504(F)F
      official e Ldsy;e(F)F
    • getHeadBlockState Link icon

      private BlockState getHeadBlockState()
      Mappings:
      Namespace Name Mixin selector
      named getHeadBlockState Lnet/minecraft/block/entity/PistonBlockEntity;getHeadBlockState()Lnet/minecraft/block/BlockState;
      intermediary method_11496 Lnet/minecraft/class_2669;method_11496()Lnet/minecraft/class_2680;
      official u Ldsy;u()Ldtc;
    • pushEntities Link icon

      private static void pushEntities(World world, BlockPos pos, float float2, PistonBlockEntity blockEntity)
      Mappings:
      Namespace Name Mixin selector
      named pushEntities Lnet/minecraft/block/entity/PistonBlockEntity;pushEntities(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;FLnet/minecraft/block/entity/PistonBlockEntity;)V
      intermediary method_11503 Lnet/minecraft/class_2669;method_11503(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;FLnet/minecraft/class_2669;)V
      official a Ldsy;a(Ldcw;Ljd;FLdsy;)V
    • moveEntity Link icon

      private static void moveEntity(Direction direction, Entity entity, double distance, Direction movementDirection)
      Mappings:
      Namespace Name Mixin selector
      named moveEntity Lnet/minecraft/block/entity/PistonBlockEntity;moveEntity(Lnet/minecraft/util/math/Direction;Lnet/minecraft/entity/Entity;DLnet/minecraft/util/math/Direction;)V
      intermediary method_23672 Lnet/minecraft/class_2669;method_23672(Lnet/minecraft/class_2350;Lnet/minecraft/class_1297;DLnet/minecraft/class_2350;)V
      official a Ldsy;a(Lji;Lbsr;DLji;)V
    • moveEntitiesInHoneyBlock Link icon

      private static void moveEntitiesInHoneyBlock(World world, BlockPos pos, float float2, PistonBlockEntity blockEntity)
      Mappings:
      Namespace Name Mixin selector
      named moveEntitiesInHoneyBlock Lnet/minecraft/block/entity/PistonBlockEntity;moveEntitiesInHoneyBlock(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;FLnet/minecraft/block/entity/PistonBlockEntity;)V
      intermediary method_23674 Lnet/minecraft/class_2669;method_23674(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;FLnet/minecraft/class_2669;)V
      official b Ldsy;b(Ldcw;Ljd;FLdsy;)V
    • canMoveEntity Link icon

      private static boolean canMoveEntity(Box box, Entity entity, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      named canMoveEntity Lnet/minecraft/block/entity/PistonBlockEntity;canMoveEntity(Lnet/minecraft/util/math/Box;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/BlockPos;)Z
      intermediary method_23671 Lnet/minecraft/class_2669;method_23671(Lnet/minecraft/class_238;Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;)Z
      official a Ldsy;a(Lewx;Lbsr;Ljd;)Z
    • isPushingHoneyBlock Link icon

      private boolean isPushingHoneyBlock()
      Mappings:
      Namespace Name Mixin selector
      named isPushingHoneyBlock Lnet/minecraft/block/entity/PistonBlockEntity;isPushingHoneyBlock()Z
      intermediary method_23364 Lnet/minecraft/class_2669;method_23364()Z
      official v Ldsy;v()Z
    • getMovementDirection Link icon

      public Direction getMovementDirection()
      Mappings:
      Namespace Name Mixin selector
      named getMovementDirection Lnet/minecraft/block/entity/PistonBlockEntity;getMovementDirection()Lnet/minecraft/util/math/Direction;
      intermediary method_11506 Lnet/minecraft/class_2669;method_11506()Lnet/minecraft/class_2350;
      official f Ldsy;f()Lji;
    • getIntersectionSize Link icon

      private static double getIntersectionSize(Box box, Direction direction, Box box2)
      Mappings:
      Namespace Name Mixin selector
      named getIntersectionSize Lnet/minecraft/block/entity/PistonBlockEntity;getIntersectionSize(Lnet/minecraft/util/math/Box;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/Box;)D
      intermediary method_11497 Lnet/minecraft/class_2669;method_11497(Lnet/minecraft/class_238;Lnet/minecraft/class_2350;Lnet/minecraft/class_238;)D
      official a Ldsy;a(Lewx;Lji;Lewx;)D
    • offsetHeadBox Link icon

      private static Box offsetHeadBox(BlockPos pos, Box box, PistonBlockEntity blockEntity)
      Mappings:
      Namespace Name Mixin selector
      named offsetHeadBox Lnet/minecraft/block/entity/PistonBlockEntity;offsetHeadBox(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Box;Lnet/minecraft/block/entity/PistonBlockEntity;)Lnet/minecraft/util/math/Box;
      intermediary method_11500 Lnet/minecraft/class_2669;method_11500(Lnet/minecraft/class_2338;Lnet/minecraft/class_238;Lnet/minecraft/class_2669;)Lnet/minecraft/class_238;
      official a Ldsy;a(Ljd;Lewx;Ldsy;)Lewx;
    • push Link icon

      private static void push(BlockPos pos, Entity entity, Direction direction, double amount)
      Mappings:
      Namespace Name Mixin selector
      named push Lnet/minecraft/block/entity/PistonBlockEntity;push(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Direction;D)V
      intermediary method_11514 Lnet/minecraft/class_2669;method_11514(Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;Lnet/minecraft/class_2350;D)V
      official a Ldsy;a(Ljd;Lbsr;Lji;D)V
    • getPushedBlock Link icon

      public BlockState getPushedBlock()
      Mappings:
      Namespace Name Mixin selector
      named getPushedBlock Lnet/minecraft/block/entity/PistonBlockEntity;getPushedBlock()Lnet/minecraft/block/BlockState;
      intermediary method_11495 Lnet/minecraft/class_2669;method_11495()Lnet/minecraft/class_2680;
      official j Ldsy;j()Ldtc;
    • finish Link icon

      public void finish()
      Mappings:
      Namespace Name Mixin selector
      named finish Lnet/minecraft/block/entity/PistonBlockEntity;finish()V
      intermediary method_11513 Lnet/minecraft/class_2669;method_11513()V
      official k Ldsy;k()V
    • tick Link icon

      public static void tick(World world, BlockPos pos, BlockState state, PistonBlockEntity blockEntity)
      Mappings:
      Namespace Name Mixin selector
      named tick Lnet/minecraft/block/entity/PistonBlockEntity;tick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/PistonBlockEntity;)V
      intermediary method_31707 Lnet/minecraft/class_2669;method_31707(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2669;)V
      official a Ldsy;a(Ldcw;Ljd;Ldtc;Ldsy;)V
    • readNbt Link icon

      protected void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup)
      Reads data from nbt. Subclasses should override this if they store a persistent data.

      NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.

      nbt might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.

      Overrides:
      readNbt in class BlockEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named readNbt Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
      intermediary method_11014 Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
      official a Ldqh;a(Lub;Ljo$a;)V
    • writeNbt Link icon

      protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup)
      Writes data to nbt. Subclasses should override this if they store a persistent data.

      NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.

      Overrides:
      writeNbt in class BlockEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named writeNbt Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
      intermediary method_11007 Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
      official b Ldqh;b(Lub;Ljo$a;)V
    • getCollisionShape Link icon

      public VoxelShape getCollisionShape(BlockView world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      named getCollisionShape Lnet/minecraft/block/entity/PistonBlockEntity;getCollisionShape(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/shape/VoxelShape;
      intermediary method_11512 Lnet/minecraft/class_2669;method_11512(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_265;
      official a Ldsy;a(Ldcc;Ljd;)Lexv;
    • getSavedWorldTime Link icon

      public long getSavedWorldTime()
      Mappings:
      Namespace Name Mixin selector
      named getSavedWorldTime Lnet/minecraft/block/entity/PistonBlockEntity;getSavedWorldTime()J
      intermediary method_11508 Lnet/minecraft/class_2669;method_11508()J
      official l Ldsy;l()J
    • setWorld Link icon

      public void setWorld(World world)
      Sets the world the block entity belongs to.

      This should not be called manually; however, this can be overridden to initialize fields dependent on the world.

      Overrides:
      setWorld in class BlockEntity
      Mappings:
      Namespace Name Mixin selector
      named setWorld Lnet/minecraft/block/entity/BlockEntity;setWorld(Lnet/minecraft/world/World;)V
      intermediary method_31662 Lnet/minecraft/class_2586;method_31662(Lnet/minecraft/class_1937;)V
      official a Ldqh;a(Ldcw;)V