Class PistonMovingBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.piston.PistonMovingBlockEntity
- All Implemented Interfaces:
ICapabilityProvider
,ICapabilityProviderImpl<BlockEntity>
,IForgeBlockEntity
-
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.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
-
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 interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB
-
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_335610_) float
getXOff
(float p_60381_) float
getYOff
(float p_60386_) float
getZOff
(float p_60389_) boolean
boolean
private boolean
protected void
loadAdditional
(CompoundTag p_333735_, HolderLookup.Provider p_332716_) 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_331280_) 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, getPosFromTag, getType, getUpdatePacket, hasLevel, isRemoved, loadCustomOnly, loadStatic, loadWithComponents, onChunkUnloaded, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setRemoved, triggerEvent
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, 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
-