Package net.minecraft.block.entity
Class PistonBlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.PistonBlockEntity
- All Implemented Interfaces:
Tickable
public class PistonBlockEntity extends BlockEntity implements Tickable
A piston block entity represents the block being pushed by a piston.
-
Field Summary
Fields Modifier and Type Field Description private booleanextendingprivate Directionfacingprivate static ThreadLocal<Direction>field_12205private intfield_26705private floatlastProgressprivate floatprogressprivate BlockStatepushedBlockprivate longsavedWorldTimeprivate booleansourceFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors Constructor Description PistonBlockEntity()PistonBlockEntity(BlockState pushedBlock, Direction facing, boolean extending, boolean source) -
Method Summary
Modifier and Type Method Description voidfinish()voidfromTag(BlockState state, CompoundTag tag)private floatgetAmountExtended(float progress)VoxelShapegetCollisionShape(BlockView world, BlockPos pos)DirectiongetFacing()private BlockStategetHeadBlockState()private static doublegetIntersectionSize(Box box, Direction direction, Box box2)DirectiongetMovementDirection()floatgetProgress(float tickDelta)BlockStategetPushedBlock()floatgetRenderOffsetX(float tickDelta)floatgetRenderOffsetY(float tickDelta)floatgetRenderOffsetZ(float tickDelta)longgetSavedWorldTime()doublegetSquaredRenderDistance()booleanisExtending()private booleanisPushingHoneyBlock()booleanisSource()private static booleanmethod_23671(Box box, Entity entity)private static voidmethod_23672(Direction direction, Entity entity, double double2, Direction direction2)private voidmethod_23674(float float2)private BoxoffsetHeadBox(Box box)private voidpush(Entity entity, Direction direction, double amount)private voidpushEntities(float nextProgress)voidtick()CompoundTagtoInitialChunkDataTag()CompoundTagtoTag(CompoundTag tag)Methods inherited from class net.minecraft.block.entity.BlockEntity
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toUpdatePacket
-
Field Details
-
field_12205
-
pushedBlock
-
facing
-
extending
private boolean extending -
source
private boolean source -
progress
private float progress -
lastProgress
private float lastProgress -
savedWorldTime
private long savedWorldTime -
field_26705
private int field_26705
-
-
Constructor Details
-
PistonBlockEntity
public PistonBlockEntity() -
PistonBlockEntity
public PistonBlockEntity(BlockState pushedBlock, Direction facing, boolean extending, boolean source)
-
-
Method Details
-
toInitialChunkDataTag
- Overrides:
toInitialChunkDataTagin classBlockEntity
-
isExtending
public boolean isExtending() -
getFacing
-
isSource
public boolean isSource() -
getProgress
public float getProgress(float tickDelta) -
getRenderOffsetX
@Environment(CLIENT) public float getRenderOffsetX(float tickDelta) -
getRenderOffsetY
@Environment(CLIENT) public float getRenderOffsetY(float tickDelta) -
getRenderOffsetZ
@Environment(CLIENT) public float getRenderOffsetZ(float tickDelta) -
getAmountExtended
private float getAmountExtended(float progress) -
getHeadBlockState
-
pushEntities
private void pushEntities(float nextProgress) -
method_23672
-
method_23674
private void method_23674(float float2) -
method_23671
-
isPushingHoneyBlock
private boolean isPushingHoneyBlock() -
getMovementDirection
-
getIntersectionSize
-
offsetHeadBox
-
push
-
getPushedBlock
-
finish
public void finish() -
tick
public void tick() -
fromTag
- Overrides:
fromTagin classBlockEntity
-
toTag
- Overrides:
toTagin classBlockEntity
-
getCollisionShape
-
getSavedWorldTime
public long getSavedWorldTime() -
getSquaredRenderDistance
@Environment(CLIENT) public double getSquaredRenderDistance()- Overrides:
getSquaredRenderDistancein classBlockEntity
-