Package net.minecraft.block.entity
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.
-
Field Summary
Fields Modifier and Type Field Description private boolean
extending
private Direction
facing
private static ThreadLocal<Direction>
field_12205
private int
field_26705
private float
lastProgress
private float
progress
private BlockState
pushedBlock
private long
savedWorldTime
private boolean
source
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
-
Constructor Summary
Constructors Constructor Description PistonBlockEntity(BlockPos pos, BlockState state)
PistonBlockEntity(BlockPos pos, BlockState state, BlockState pushedBlock, Direction facing, boolean extending, boolean source)
-
Method Summary
Modifier and Type Method Description void
finish()
void
fromTag(CompoundTag tag)
private float
getAmountExtended(float progress)
VoxelShape
getCollisionShape(BlockView world, BlockPos pos)
Direction
getFacing()
private BlockState
getHeadBlockState()
private static double
getIntersectionSize(Box box, Direction direction, Box box2)
Direction
getMovementDirection()
float
getProgress(float tickDelta)
BlockState
getPushedBlock()
float
getRenderOffsetX(float tickDelta)
float
getRenderOffsetY(float tickDelta)
float
getRenderOffsetZ(float tickDelta)
long
getSavedWorldTime()
double
getSquaredRenderDistance()
boolean
isExtending()
private boolean
isPushingHoneyBlock()
boolean
isSource()
private static boolean
method_23671(Box box, Entity entity)
private static void
method_23672(Direction direction, Entity entity, double double2, Direction direction2)
private static void
method_23674(World world, BlockPos blockPos, float float2, PistonBlockEntity pistonBlockEntity)
private static Box
offsetHeadBox(BlockPos pos, Box box, PistonBlockEntity blockEntity)
private static void
push(BlockPos pos, Entity entity, Direction direction, double amount)
private static void
pushEntities(World world, BlockPos pos, float float2, PistonBlockEntity blockEntity)
static void
tick(World world, BlockPos pos, BlockState state, PistonBlockEntity blockEntity)
CompoundTag
toInitialChunkDataTag()
CompoundTag
toTag(CompoundTag tag)
Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, setCachedState, setWorld, 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
-
PistonBlockEntity
public PistonBlockEntity(BlockPos pos, BlockState state, BlockState pushedBlock, Direction facing, boolean extending, boolean source)
-
-
Method Details
-
toInitialChunkDataTag
- Overrides:
toInitialChunkDataTag
in 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 static void pushEntities(World world, BlockPos pos, float float2, PistonBlockEntity blockEntity) -
method_23672
-
method_23674
private static void method_23674(World world, BlockPos blockPos, float float2, PistonBlockEntity pistonBlockEntity) -
method_23671
-
isPushingHoneyBlock
private boolean isPushingHoneyBlock() -
getMovementDirection
-
getIntersectionSize
-
offsetHeadBox
-
push
-
getPushedBlock
-
finish
public void finish() -
tick
public static void tick(World world, BlockPos pos, BlockState state, PistonBlockEntity blockEntity) -
fromTag
- Overrides:
fromTag
in classBlockEntity
-
toTag
- Overrides:
toTag
in classBlockEntity
-
getCollisionShape
-
getSavedWorldTime
public long getSavedWorldTime() -
getSquaredRenderDistance
@Environment(CLIENT) public double getSquaredRenderDistance()- Overrides:
getSquaredRenderDistance
in classBlockEntity
-