Class PistonBlockEntity
- All Implemented Interfaces:
DebugTrackable
- Mappings:
Namespace Name named net/minecraft/block/entity/PistonBlockEntityintermediary net/minecraft/class_2669official ejh
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.debug.DebugTrackable
DebugTrackable.DebugDataSupplier<T>, DebugTrackable.Tracker -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final booleanprivate static final floatprivate static final BlockStateprivate static final booleanprivate static final ThreadLocal<Direction> private booleanprivate Directionprivate intstatic final doubleprivate static final intprivate static final doubleprivate floatprivate floatprivate BlockStateprivate longprivate booleanFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
ConstructorsConstructorDescriptionPistonBlockEntity(BlockPos pos, BlockState state) PistonBlockEntity(BlockPos pos, BlockState state, BlockState pushedBlock, Direction facing, boolean extending, boolean source) -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleancanMoveEntity(Box box, Entity entity, BlockPos pos) voidfinish()private floatgetAmountExtended(float progress) getCollisionShape(BlockView world, BlockPos pos) private BlockStateprivate static doublegetIntersectionSize(Box box, Direction direction, Box box2) floatgetProgress(float tickProgress) floatgetRenderOffsetX(float tickProgress) floatgetRenderOffsetY(float tickProgress) floatgetRenderOffsetZ(float tickProgress) longbooleanprivate booleanbooleanisSource()private static voidmoveEntitiesInHoneyBlock(World world, BlockPos pos, float float2, PistonBlockEntity blockEntity) private static voidmoveEntity(Direction direction, Entity entity, double distance, Direction movementDirection) private static BoxoffsetHeadBox(BlockPos pos, Box box, PistonBlockEntity blockEntity) voidonBlockReplaced(BlockPos pos, BlockState oldState) private static voidprivate static voidpushEntities(World world, BlockPos pos, float float2, PistonBlockEntity blockEntity) protected voidReads data fromnbt.voidSets the world the block entity belongs to.static voidtick(World world, BlockPos pos, BlockState state, PistonBlockEntity blockEntity) toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registries) Returns the serialized state of this block entity that is observable by clients.protected voidWrites data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
addComponents, cancelRemoval, createComponentlessNbt, createComponentMap, createFromNbt, createNbt, createNbtWithIdentifyingData, getCachedState, getComponents, getNameForReport, getPos, getReporterContext, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessData, readComponents, readComponents, readComponents, registerTracking, removeFromCopiedStackData, setCachedState, setComponents, supports, toUpdatePacket, tryParseCustomName, writeComponentlessData, writeDataWithId, writeDataWithoutId, writeFullData, writeId
-
Field Details
-
field_31382
private static final int field_31382- See Also:
- Mappings:
Namespace Name Mixin selector named field_31382Lnet/minecraft/block/entity/PistonBlockEntity;field_31382:Iintermediary field_31382Lnet/minecraft/class_2669;field_31382:Iofficial bLejh;b:I
-
field_31383
private static final double field_31383- See Also:
- Mappings:
Namespace Name Mixin selector named field_31383Lnet/minecraft/block/entity/PistonBlockEntity;field_31383:Dintermediary field_31383Lnet/minecraft/class_2669;field_31383:Dofficial cLejh;c:D
-
field_31381
public static final double field_31381- See Also:
- Mappings:
Namespace Name Mixin selector named field_31381Lnet/minecraft/block/entity/PistonBlockEntity;field_31381:Dintermediary field_31381Lnet/minecraft/class_2669;field_31381:Dofficial aLejh;a:D
-
DEFAULT_PUSHED_BLOCK_STATE
- Mappings:
Namespace Name Mixin selector named DEFAULT_PUSHED_BLOCK_STATELnet/minecraft/block/entity/PistonBlockEntity;DEFAULT_PUSHED_BLOCK_STATE:Lnet/minecraft/block/BlockState;intermediary field_57804Lnet/minecraft/class_2669;field_57804:Lnet/minecraft/class_2680;official dLejh;d:Lejn;
-
DEFAULT_PROGRESS
private static final float DEFAULT_PROGRESS- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_PROGRESSLnet/minecraft/block/entity/PistonBlockEntity;DEFAULT_PROGRESS:Fintermediary field_57805Lnet/minecraft/class_2669;field_57805:Fofficial eLejh;e:F
-
DEFAULT_EXTENDING
private static final boolean DEFAULT_EXTENDING- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_EXTENDINGLnet/minecraft/block/entity/PistonBlockEntity;DEFAULT_EXTENDING:Zintermediary field_57806Lnet/minecraft/class_2669;field_57806:Zofficial fLejh;f:Z
-
DEFAULT_SOURCE
private static final boolean DEFAULT_SOURCE- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_SOURCELnet/minecraft/block/entity/PistonBlockEntity;DEFAULT_SOURCE:Zintermediary field_57807Lnet/minecraft/class_2669;field_57807:Zofficial gLejh;g:Z
-
ENTITY_MOVEMENT_DIRECTION
- Mappings:
Namespace Name Mixin selector named ENTITY_MOVEMENT_DIRECTIONLnet/minecraft/block/entity/PistonBlockEntity;ENTITY_MOVEMENT_DIRECTION:Ljava/lang/ThreadLocal;intermediary field_12205Lnet/minecraft/class_2669;field_12205:Ljava/lang/ThreadLocal;official lLejh;l:Ljava/lang/ThreadLocal;
-
pushedBlockState
- Mappings:
Namespace Name Mixin selector named pushedBlockStateLnet/minecraft/block/entity/PistonBlockEntity;pushedBlockState:Lnet/minecraft/block/BlockState;intermediary field_12204Lnet/minecraft/class_2669;field_12204:Lnet/minecraft/class_2680;official hLejh;h:Lejn;
-
facing
- Mappings:
Namespace Name Mixin selector named facingLnet/minecraft/block/entity/PistonBlockEntity;facing:Lnet/minecraft/util/math/Direction;intermediary field_12201Lnet/minecraft/class_2669;field_12201:Lnet/minecraft/class_2350;official iLejh;i:Ljg;
-
extending
private boolean extending- Mappings:
Namespace Name Mixin selector named extendingLnet/minecraft/block/entity/PistonBlockEntity;extending:Zintermediary field_12203Lnet/minecraft/class_2669;field_12203:Zofficial jLejh;j:Z
-
source
private boolean source- Mappings:
Namespace Name Mixin selector named sourceLnet/minecraft/block/entity/PistonBlockEntity;source:Zintermediary field_12202Lnet/minecraft/class_2669;field_12202:Zofficial kLejh;k:Z
-
progress
private float progress- Mappings:
Namespace Name Mixin selector named progressLnet/minecraft/block/entity/PistonBlockEntity;progress:Fintermediary field_12207Lnet/minecraft/class_2669;field_12207:Fofficial mLejh;m:F
-
lastProgress
private float lastProgress- Mappings:
Namespace Name Mixin selector named lastProgressLnet/minecraft/block/entity/PistonBlockEntity;lastProgress:Fintermediary field_12206Lnet/minecraft/class_2669;field_12206:Fofficial qLejh;q:F
-
savedWorldTime
private long savedWorldTime- Mappings:
Namespace Name Mixin selector named savedWorldTimeLnet/minecraft/block/entity/PistonBlockEntity;savedWorldTime:Jintermediary field_12208Lnet/minecraft/class_2669;field_12208:Jofficial rLejh;r:J
-
field_26705
private int field_26705- Mappings:
Namespace Name Mixin selector named field_26705Lnet/minecraft/block/entity/PistonBlockEntity;field_26705:Iintermediary field_26705Lnet/minecraft/class_2669;field_26705:Iofficial sLejh;s:I
-
-
Constructor Details
-
PistonBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/entity/PistonBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary <init>Lnet/minecraft/class_2669;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Lejh;<init>(Lja;Lejn;)V
-
PistonBlockEntity
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)Vintermediary <init>Lnet/minecraft/class_2669;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;ZZ)Vofficial <init>Lejh;<init>(Lja;Lejn;Lejn;Ljg;ZZ)V
-
-
Method Details
-
toInitialChunkDataNbt
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 defaultBlockEntityUpdateS2CPacket."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:
toInitialChunkDataNbtin classBlockEntity- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector named toInitialChunkDataNbtLnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;intermediary method_16887Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;official aLegh;a(Ljm$a;)Lup;
-
isExtending
public boolean isExtending()- Mappings:
Namespace Name Mixin selector named isExtendingLnet/minecraft/block/entity/PistonBlockEntity;isExtending()Zintermediary method_11501Lnet/minecraft/class_2669;method_11501()Zofficial aLejh;a()Z
-
getFacing
- Mappings:
Namespace Name Mixin selector named getFacingLnet/minecraft/block/entity/PistonBlockEntity;getFacing()Lnet/minecraft/util/math/Direction;intermediary method_11498Lnet/minecraft/class_2669;method_11498()Lnet/minecraft/class_2350;official cLejh;c()Ljg;
-
isSource
public boolean isSource()- Mappings:
Namespace Name Mixin selector named isSourceLnet/minecraft/block/entity/PistonBlockEntity;isSource()Zintermediary method_11515Lnet/minecraft/class_2669;method_11515()Zofficial dLejh;d()Z
-
getProgress
public float getProgress(float tickProgress) - Mappings:
Namespace Name Mixin selector named getProgressLnet/minecraft/block/entity/PistonBlockEntity;getProgress(F)Fintermediary method_11499Lnet/minecraft/class_2669;method_11499(F)Fofficial aLejh;a(F)F
-
getRenderOffsetX
public float getRenderOffsetX(float tickProgress) - Mappings:
Namespace Name Mixin selector named getRenderOffsetXLnet/minecraft/block/entity/PistonBlockEntity;getRenderOffsetX(F)Fintermediary method_11494Lnet/minecraft/class_2669;method_11494(F)Fofficial bLejh;b(F)F
-
getRenderOffsetY
public float getRenderOffsetY(float tickProgress) - Mappings:
Namespace Name Mixin selector named getRenderOffsetYLnet/minecraft/block/entity/PistonBlockEntity;getRenderOffsetY(F)Fintermediary method_11511Lnet/minecraft/class_2669;method_11511(F)Fofficial cLejh;c(F)F
-
getRenderOffsetZ
public float getRenderOffsetZ(float tickProgress) - Mappings:
Namespace Name Mixin selector named getRenderOffsetZLnet/minecraft/block/entity/PistonBlockEntity;getRenderOffsetZ(F)Fintermediary method_11507Lnet/minecraft/class_2669;method_11507(F)Fofficial dLejh;d(F)F
-
getAmountExtended
private float getAmountExtended(float progress) - Mappings:
Namespace Name Mixin selector named getAmountExtendedLnet/minecraft/block/entity/PistonBlockEntity;getAmountExtended(F)Fintermediary method_11504Lnet/minecraft/class_2669;method_11504(F)Fofficial eLejh;e(F)F
-
getHeadBlockState
- Mappings:
Namespace Name Mixin selector named getHeadBlockStateLnet/minecraft/block/entity/PistonBlockEntity;getHeadBlockState()Lnet/minecraft/block/BlockState;intermediary method_11496Lnet/minecraft/class_2669;method_11496()Lnet/minecraft/class_2680;official wLejh;w()Lejn;
-
pushEntities
private static void pushEntities(World world, BlockPos pos, float float2, PistonBlockEntity blockEntity) - Mappings:
Namespace Name Mixin selector named pushEntitiesLnet/minecraft/block/entity/PistonBlockEntity;pushEntities(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;FLnet/minecraft/block/entity/PistonBlockEntity;)Vintermediary method_11503Lnet/minecraft/class_2669;method_11503(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;FLnet/minecraft/class_2669;)Vofficial aLejh;a(Ldrr;Lja;FLejh;)V
-
moveEntity
private static void moveEntity(Direction direction, Entity entity, double distance, Direction movementDirection) - Mappings:
Namespace Name Mixin selector named moveEntityLnet/minecraft/block/entity/PistonBlockEntity;moveEntity(Lnet/minecraft/util/math/Direction;Lnet/minecraft/entity/Entity;DLnet/minecraft/util/math/Direction;)Vintermediary method_23672Lnet/minecraft/class_2669;method_23672(Lnet/minecraft/class_2350;Lnet/minecraft/class_1297;DLnet/minecraft/class_2350;)Vofficial aLejh;a(Ljg;Lcdw;DLjg;)V
-
moveEntitiesInHoneyBlock
private static void moveEntitiesInHoneyBlock(World world, BlockPos pos, float float2, PistonBlockEntity blockEntity) - Mappings:
Namespace Name Mixin selector named moveEntitiesInHoneyBlockLnet/minecraft/block/entity/PistonBlockEntity;moveEntitiesInHoneyBlock(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;FLnet/minecraft/block/entity/PistonBlockEntity;)Vintermediary method_23674Lnet/minecraft/class_2669;method_23674(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;FLnet/minecraft/class_2669;)Vofficial bLejh;b(Ldrr;Lja;FLejh;)V
-
canMoveEntity
- Mappings:
Namespace Name Mixin selector named canMoveEntityLnet/minecraft/block/entity/PistonBlockEntity;canMoveEntity(Lnet/minecraft/util/math/Box;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/BlockPos;)Zintermediary method_23671Lnet/minecraft/class_2669;method_23671(Lnet/minecraft/class_238;Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;)Zofficial aLejh;a(Lfod;Lcdw;Lja;)Z
-
isPushingHoneyBlock
private boolean isPushingHoneyBlock()- Mappings:
Namespace Name Mixin selector named isPushingHoneyBlockLnet/minecraft/block/entity/PistonBlockEntity;isPushingHoneyBlock()Zintermediary method_23364Lnet/minecraft/class_2669;method_23364()Zofficial xLejh;x()Z
-
getMovementDirection
- Mappings:
Namespace Name Mixin selector named getMovementDirectionLnet/minecraft/block/entity/PistonBlockEntity;getMovementDirection()Lnet/minecraft/util/math/Direction;intermediary method_11506Lnet/minecraft/class_2669;method_11506()Lnet/minecraft/class_2350;official fLejh;f()Ljg;
-
getIntersectionSize
- Mappings:
Namespace Name Mixin selector named getIntersectionSizeLnet/minecraft/block/entity/PistonBlockEntity;getIntersectionSize(Lnet/minecraft/util/math/Box;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/Box;)Dintermediary method_11497Lnet/minecraft/class_2669;method_11497(Lnet/minecraft/class_238;Lnet/minecraft/class_2350;Lnet/minecraft/class_238;)Dofficial aLejh;a(Lfod;Ljg;Lfod;)D
-
offsetHeadBox
- Mappings:
Namespace Name Mixin selector named offsetHeadBoxLnet/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_11500Lnet/minecraft/class_2669;method_11500(Lnet/minecraft/class_2338;Lnet/minecraft/class_238;Lnet/minecraft/class_2669;)Lnet/minecraft/class_238;official aLejh;a(Lja;Lfod;Lejh;)Lfod;
-
push
- Mappings:
Namespace Name Mixin selector named pushLnet/minecraft/block/entity/PistonBlockEntity;push(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Direction;D)Vintermediary method_11514Lnet/minecraft/class_2669;method_11514(Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;Lnet/minecraft/class_2350;D)Vofficial aLejh;a(Lja;Lcdw;Ljg;D)V
-
getPushedBlock
- Mappings:
Namespace Name Mixin selector named getPushedBlockLnet/minecraft/block/entity/PistonBlockEntity;getPushedBlock()Lnet/minecraft/block/BlockState;intermediary method_11495Lnet/minecraft/class_2669;method_11495()Lnet/minecraft/class_2680;official hLejh;h()Lejn;
-
finish
public void finish()- Mappings:
Namespace Name Mixin selector named finishLnet/minecraft/block/entity/PistonBlockEntity;finish()Vintermediary method_11513Lnet/minecraft/class_2669;method_11513()Vofficial kLejh;k()V
-
onBlockReplaced
- Overrides:
onBlockReplacedin classBlockEntity- Mappings:
Namespace Name Mixin selector named onBlockReplacedLnet/minecraft/block/entity/BlockEntity;onBlockReplaced(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_66473Lnet/minecraft/class_2586;method_66473(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial aLegh;a(Lja;Lejn;)V
-
getDirection
- Mappings:
Namespace Name Mixin selector named getDirectionLnet/minecraft/block/entity/PistonBlockEntity;getDirection()Lnet/minecraft/util/math/Direction;intermediary method_61764Lnet/minecraft/class_2669;method_61764()Lnet/minecraft/class_2350;official lLejh;l()Ljg;
-
tick
- Mappings:
Namespace Name Mixin selector named tickLnet/minecraft/block/entity/PistonBlockEntity;tick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/PistonBlockEntity;)Vintermediary method_31707Lnet/minecraft/class_2669;method_31707(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2669;)Vofficial aLejh;a(Ldrr;Lja;Lejn;Lejh;)V
-
readData
Reads data fromnbt. 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.
nbtmight 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:
readDatain classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readDataLnet/minecraft/block/entity/BlockEntity;readData(Lnet/minecraft/storage/ReadView;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_11368;)Vofficial aLegh;a(Lfiq;)V
-
writeData
Writes data tonbt. 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:
writeDatain classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeDataLnet/minecraft/block/entity/BlockEntity;writeData(Lnet/minecraft/storage/WriteView;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_11372;)Vofficial aLegh;a(Lfis;)V
-
getCollisionShape
- Mappings:
Namespace Name Mixin selector named getCollisionShapeLnet/minecraft/block/entity/PistonBlockEntity;getCollisionShape(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/shape/VoxelShape;intermediary method_11512Lnet/minecraft/class_2669;method_11512(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_265;official aLejh;a(Ldqv;Lja;)Lfpd;
-
getSavedWorldTime
public long getSavedWorldTime()- Mappings:
Namespace Name Mixin selector named getSavedWorldTimeLnet/minecraft/block/entity/PistonBlockEntity;getSavedWorldTime()Jintermediary method_11508Lnet/minecraft/class_2669;method_11508()Jofficial mLejh;m()J
-
setWorld
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:
setWorldin classBlockEntity- Mappings:
Namespace Name Mixin selector named setWorldLnet/minecraft/block/entity/BlockEntity;setWorld(Lnet/minecraft/world/World;)Vintermediary method_31662Lnet/minecraft/class_2586;method_31662(Lnet/minecraft/class_1937;)Vofficial aLegh;a(Ldrr;)V
-