Class PistonMovingBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.piston.PistonMovingBlockEntity
- All Implemented Interfaces:
IAttachmentHolder
,IBlockEntityExtension
,INBTSerializable<CompoundTag>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
private Direction
private boolean
private boolean
private long
private BlockState
private static final ThreadLocal<Direction>
private float
private float
private static final double
static final double
private static final int
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
-
Constructor Summary
ConstructorDescriptionPistonMovingBlockEntity
(BlockPos p_155901_, BlockState p_155902_) PistonMovingBlockEntity
(BlockPos p_155904_, BlockState p_155905_, BlockState p_155906_, Direction p_155907_, boolean p_155908_, boolean p_155909_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
private static void
fixEntityWithinPistonBase
(BlockPos p_155921_, Entity p_155922_, Direction p_155923_, double p_155924_) private BlockState
getCollisionShape
(BlockGetter p_60357_, BlockPos p_60358_) private float
getExtendedProgress
(float p_60391_) long
private static double
getMovement
(AABB p_60368_, Direction p_60369_, AABB p_60370_) float
getProgress
(float p_60351_) float
getXOff
(float p_60381_) float
getYOff
(float p_60386_) float
getZOff
(float p_60389_) boolean
boolean
private boolean
void
load
(CompoundTag p_155930_) private static boolean
matchesStickyCritera
(AABB p_287782_, Entity p_287720_, BlockPos p_287775_) private static AABB
moveByPositionAndProgress
(BlockPos p_155926_, AABB p_155927_, PistonMovingBlockEntity p_155928_) private static void
moveCollidedEntities
(Level p_155911_, BlockPos p_155912_, float p_155913_, PistonMovingBlockEntity p_155914_) private static void
moveEntityByPiston
(Direction p_60372_, Entity p_60373_, double p_60374_, Direction p_60375_) private static void
moveStuckEntities
(Level p_155932_, BlockPos p_155933_, float p_155934_, PistonMovingBlockEntity p_155935_) protected void
saveAdditional
(CompoundTag p_187530_) void
static void
tick
(Level p_155916_, BlockPos p_155917_, BlockState p_155918_, PistonMovingBlockEntity p_155919_) Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, hasLevel, isRemoved, loadStatic, onlyOpCanSetNbt, removeData, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setData, setRemoved, triggerEvent
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
areAttachmentsCompatible, deserializeAttachments, getData, hasAttachments, hasData, serializeAttachments
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
deserializeNBT, getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
-
Field Details
-
TICKS_TO_EXTEND
private static final int TICKS_TO_EXTEND- See Also:
-
PUSH_OFFSET
private static final double PUSH_OFFSET- See Also:
-
TICK_MOVEMENT
public static final double TICK_MOVEMENT- See Also:
-
movedState
-
direction
-
extending
private boolean extending -
isSourcePiston
private boolean isSourcePiston -
NOCLIP
-
progress
private float progress -
progressO
private float progressO -
lastTicked
private long lastTicked -
deathTicks
private int deathTicks
-
-
Constructor Details
-
PistonMovingBlockEntity
-
PistonMovingBlockEntity
public PistonMovingBlockEntity(BlockPos p_155904_, BlockState p_155905_, BlockState p_155906_, Direction p_155907_, boolean p_155908_, boolean p_155909_)
-
-
Method Details
-
getUpdateTag
- Overrides:
getUpdateTag
in classBlockEntity
-
isExtending
public boolean isExtending() -
getDirection
-
isSourcePiston
public boolean isSourcePiston() -
getProgress
public float getProgress(float p_60351_) -
getXOff
public float getXOff(float p_60381_) -
getYOff
public float getYOff(float p_60386_) -
getZOff
public float getZOff(float p_60389_) -
getExtendedProgress
private float getExtendedProgress(float p_60391_) -
getCollisionRelatedBlockState
-
moveCollidedEntities
private static void moveCollidedEntities(Level p_155911_, BlockPos p_155912_, float p_155913_, PistonMovingBlockEntity p_155914_) -
moveEntityByPiston
-
moveStuckEntities
private static void moveStuckEntities(Level p_155932_, BlockPos p_155933_, float p_155934_, PistonMovingBlockEntity p_155935_) -
matchesStickyCritera
-
isStickyForEntities
private boolean isStickyForEntities() -
getMovementDirection
-
getMovement
-
moveByPositionAndProgress
private static AABB moveByPositionAndProgress(BlockPos p_155926_, AABB p_155927_, PistonMovingBlockEntity p_155928_) -
fixEntityWithinPistonBase
-
getMovedState
-
finalTick
public void finalTick() -
tick
public static void tick(Level p_155916_, BlockPos p_155917_, BlockState p_155918_, PistonMovingBlockEntity p_155919_) -
load
- Overrides:
load
in classBlockEntity
-
saveAdditional
- Overrides:
saveAdditional
in classBlockEntity
-
getCollisionShape
-
getLastTicked
public long getLastTicked() -
setLevel
- Overrides:
setLevel
in classBlockEntity
-