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
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.DataComponentInput
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_) getUpdateTag
(HolderLookup.Provider p_324521_) float
getXOff
(float p_60381_) float
getYOff
(float p_60386_) float
getZOff
(float p_60389_) boolean
boolean
private boolean
protected void
loadAdditional
(CompoundTag p_155930_, HolderLookup.Provider p_324214_) 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_, HolderLookup.Provider p_323923_) 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, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, hasLevel, isRemoved, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setRemoved, triggerEvent
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, 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, getExistingData, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
-
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_) -
loadAdditional
- Overrides:
loadAdditional
in classBlockEntity
-
saveAdditional
- Overrides:
saveAdditional
in classBlockEntity
-
getCollisionShape
-
getLastTicked
public long getLastTicked() -
setLevel
- Overrides:
setLevel
in classBlockEntity
-