Class PistonBaseBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.DirectionalBlock
net.minecraft.world.level.block.piston.PistonBaseBlock
- All Implemented Interfaces:
FeatureElement
,ItemLike
,IBlockExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.BlockStatePairKey
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<PistonBaseBlock> protected static final VoxelShape
protected static final VoxelShape
static final BooleanProperty
private final boolean
Whether this is a sticky pistonprotected static final VoxelShape
static final float
protected static final VoxelShape
static final int
static final int
static final int
protected static final VoxelShape
protected static final VoxelShape
Fields inherited from class net.minecraft.world.level.block.DirectionalBlock
FACING
Fields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SUPPRESS_DROPS
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDER
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkIfExtend
(Level level, BlockPos pos, BlockState state) com.mojang.serialization.MapCodec
<PistonBaseBlock> codec()
protected void
private boolean
getNeighborSignal
(SignalGetter signalGetter, BlockPos pos, Direction p_direction) protected VoxelShape
getShape
(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) getStateForPlacement
(BlockPlaceContext context) protected boolean
isPathfindable
(BlockState state, PathComputationType pathComputationType) static boolean
isPushable
(BlockState state, Level level, BlockPos pos, Direction movementDirection, boolean allowDestroy, Direction pistonFacing) Checks if the piston can push the given BlockState.protected BlockState
mirror
(BlockState state, Mirror mirror) Returns the blockstate with the given mirror of the passed blockstate.private boolean
moveBlocks
(Level level, BlockPos pos, Direction facing, boolean extending) protected void
neighborChanged
(BlockState state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) protected void
onPlace
(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) protected BlockState
rotate
(BlockState state, Rotation rot) Returns the blockstate with the given rotation from the passed blockstate.rotate
(BlockState state, LevelAccessor world, BlockPos pos, Rotation direction) void
setPlacedBy
(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) Called by BlockItem after this block has been placed.protected boolean
triggerEvent
(BlockState state, Level level, BlockPos pos, int id, int param) Called on server whenLevel.blockEvent(net.minecraft.core.BlockPos, net.minecraft.world.level.block.Block, int, int)
is called.protected boolean
Methods inherited from class net.minecraft.world.level.block.Block
animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isRandomlyTicking, isSignalSource, onExplosionHit, onProjectileHit, onRemove, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, simpleCodec, skipRendering, spawnAfterBreak, tick, updateIndirectNeighbourShapes, updateShape, useItemOn, useWithoutItem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
-
Field Details
-
CODEC
-
EXTENDED
-
TRIGGER_EXTEND
public static final int TRIGGER_EXTEND- See Also:
-
TRIGGER_CONTRACT
public static final int TRIGGER_CONTRACT- See Also:
-
TRIGGER_DROP
public static final int TRIGGER_DROP- See Also:
-
PLATFORM_THICKNESS
public static final float PLATFORM_THICKNESS- See Also:
-
EAST_AABB
-
WEST_AABB
-
SOUTH_AABB
-
NORTH_AABB
-
UP_AABB
-
DOWN_AABB
-
isSticky
private final boolean isStickyWhether this is a sticky piston
-
-
Constructor Details
-
PistonBaseBlock
-
-
Method Details
-
codec
- Specified by:
codec
in classDirectionalBlock
-
getShape
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) - Overrides:
getShape
in classBlockBehaviour
-
setPlacedBy
public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) Called by BlockItem after this block has been placed.- Overrides:
setPlacedBy
in classBlock
-
neighborChanged
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) - Overrides:
neighborChanged
in classBlockBehaviour
-
onPlace
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) - Overrides:
onPlace
in classBlockBehaviour
-
getStateForPlacement
- Overrides:
getStateForPlacement
in classBlock
-
checkIfExtend
-
getNeighborSignal
-
triggerEvent
Called on server whenLevel.blockEvent(net.minecraft.core.BlockPos, net.minecraft.world.level.block.Block, int, int)
is called. If server returns true, then also called on the client. On the Server, this may perform additional changes to the world, like pistons replacing the block with an extended base. On the client, the update may involve replacing block entities or effects such as sounds or particles- Overrides:
triggerEvent
in classBlockBehaviour
-
isPushable
public static boolean isPushable(BlockState state, Level level, BlockPos pos, Direction movementDirection, boolean allowDestroy, Direction pistonFacing) Checks if the piston can push the given BlockState. -
moveBlocks
-
rotate
Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
rotate
in classBlockBehaviour
-
rotate
-
mirror
Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
mirror
in classBlockBehaviour
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-
useShapeForLightOcclusion
- Overrides:
useShapeForLightOcclusion
in classBlockBehaviour
-
isPathfindable
- Overrides:
isPathfindable
in classBlockBehaviour
-