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.BlockStatePairKeyNested 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 VoxelShapeprotected static final VoxelShapestatic final BooleanPropertyprivate final booleanWhether this is a sticky pistonprotected static final VoxelShapestatic final floatprotected static final VoxelShapestatic final intstatic final intstatic final intprotected static final VoxelShapeprotected static final VoxelShapeFields inherited from class net.minecraft.world.level.block.DirectionalBlock
FACINGFields 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_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckIfExtend(Level pLevel, BlockPos pPos, BlockState pState) com.mojang.serialization.MapCodec<PistonBaseBlock> codec()protected voidprivate booleangetNeighborSignal(SignalGetter pSignalGetter, BlockPos pPos, Direction pDirection) protected VoxelShapegetShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) getStateForPlacement(BlockPlaceContext pContext) protected booleanisPathfindable(BlockState pState, PathComputationType pPathComputationType) static booleanisPushable(BlockState pState, Level pLevel, BlockPos pPos, Direction pMovementDirection, boolean pAllowDestroy, Direction pPistonFacing) Checks if the piston can push the given BlockState.protected BlockStatemirror(BlockState pState, Mirror pMirror) Returns the blockstate with the given mirror of the passed blockstate.private booleanmoveBlocks(Level pLevel, BlockPos pPos, Direction pFacing, boolean pExtending) protected voidneighborChanged(BlockState pState, Level pLevel, BlockPos pPos, Block pBlock, BlockPos pFromPos, boolean pIsMoving) protected voidonPlace(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pIsMoving) protected BlockStaterotate(BlockState pState, Rotation pRot) Returns the blockstate with the given rotation from the passed blockstate.rotate(BlockState state, LevelAccessor world, BlockPos pos, Rotation direction) voidsetPlacedBy(Level pLevel, BlockPos pPos, BlockState pState, LivingEntity pPlacer, ItemStack pStack) Called by BlockItem after this block has been placed.protected booleantriggerEvent(BlockState pState, Level pLevel, BlockPos pPos, int pId, int pParam) Called on server whenLevel.blockEvent(net.minecraft.core.BlockPos, net.minecraft.world.level.block.Block, int, int)is called.protected booleanuseShapeForLightOcclusion(BlockState pState) 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, withPropertiesOfMethods 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, useWithoutItemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods 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:
codecin classDirectionalBlock
-
getShape
protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) - Overrides:
getShapein classBlockBehaviour
-
setPlacedBy
public void setPlacedBy(Level pLevel, BlockPos pPos, BlockState pState, LivingEntity pPlacer, ItemStack pStack) Called by BlockItem after this block has been placed.- Overrides:
setPlacedByin classBlock
-
neighborChanged
protected void neighborChanged(BlockState pState, Level pLevel, BlockPos pPos, Block pBlock, BlockPos pFromPos, boolean pIsMoving) - Overrides:
neighborChangedin classBlockBehaviour
-
onPlace
protected void onPlace(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pIsMoving) - Overrides:
onPlacein classBlockBehaviour
-
getStateForPlacement
- Overrides:
getStateForPlacementin 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:
triggerEventin classBlockBehaviour
-
isPushable
public static boolean isPushable(BlockState pState, Level pLevel, BlockPos pPos, Direction pMovementDirection, boolean pAllowDestroy, Direction pPistonFacing) 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:
rotatein classBlockBehaviour
-
rotate
-
mirror
Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
mirrorin classBlockBehaviour
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinitionin classBlock
-
useShapeForLightOcclusion
- Overrides:
useShapeForLightOcclusionin classBlockBehaviour
-
isPathfindable
- Overrides:
isPathfindablein classBlockBehaviour
-