Package net.minecraft.world.level.block
Class BasePressurePlateBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.BasePressurePlateBlock
- All Implemented Interfaces:
FeatureElement
,ItemLike
,IBlockExtension
- Direct Known Subclasses:
PressurePlateBlock
,WeightedPressurePlateBlock
-
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 TypeFieldDescriptionprotected static final VoxelShape
protected static final VoxelShape
protected static final AABB
protected final BlockSetType
Fields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, CODEC, 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
ConstructorsModifierConstructorDescriptionprotected
BasePressurePlateBlock
(BlockBehaviour.Properties pProperties, BlockSetType pType) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canSurvive
(BlockState pState, LevelReader pLevel, BlockPos pPos) private void
checkPressed
(Entity pEntity, Level pLevel, BlockPos pPos, BlockState pState, int pCurrentSignal) protected abstract com.mojang.serialization.MapCodec
<? extends BasePressurePlateBlock> codec()
protected void
entityInside
(BlockState pState, Level pLevel, BlockPos pPos, Entity pEntity) protected int
getDirectSignal
(BlockState pBlockState, BlockGetter pBlockAccess, BlockPos pPos, Direction pSide) Returns the direct signal this block emits in the given direction.protected static int
getEntityCount
(Level pLevel, AABB pBox, Class<? extends Entity> pEntityClass) protected int
protected VoxelShape
getShape
(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) protected int
getSignal
(BlockState pBlockState, BlockGetter pBlockAccess, BlockPos pPos, Direction pSide) Returns the signal this block emits in the given direction.protected abstract int
getSignalForState
(BlockState pState) Returns the signal encoded in the given block state.protected abstract int
getSignalStrength
(Level pLevel, BlockPos pPos) Calculates what the signal strength of a pressure plate at the given location should be.boolean
isPossibleToRespawnInThis
(BlockState pState) protected boolean
isSignalSource
(BlockState pState) Returns whether this block is capable of emitting redstone signals.protected void
onRemove
(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) protected abstract BlockState
setSignalForState
(BlockState pState, int pSignal) Returns the block state that encodes the given signal.protected void
tick
(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) protected void
updateNeighbours
(Level pLevel, BlockPos pPos) Notify block and block below of changesprotected BlockState
updateShape
(BlockState pState, Direction pFacing, BlockState pFacingState, LevelAccessor pLevel, BlockPos pCurrentPos, BlockPos pFacingPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state.Methods inherited from class net.minecraft.world.level.block.Block
animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, createBlockStateDefinition, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getSpeedFactor, getStateDefinition, getStateForPlacement, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, 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, defaultDestroyTime, defaultMapColor, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, isRandomlyTicking, mirror, neighborChanged, onExplosionHit, onPlace, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, rotate, simpleCodec, skipRendering, spawnAfterBreak, triggerEvent, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusion, 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, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
-
Field Details
-
PRESSED_AABB
-
AABB
-
TOUCH_AABB
-
type
-
-
Constructor Details
-
BasePressurePlateBlock
-
-
Method Details
-
codec
-
getShape
protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) - Overrides:
getShape
in classBlockBehaviour
-
getPressedTime
protected int getPressedTime() -
isPossibleToRespawnInThis
- Overrides:
isPossibleToRespawnInThis
in classBlock
-
updateShape
protected BlockState updateShape(BlockState pState, Direction pFacing, BlockState pFacingState, LevelAccessor pLevel, BlockPos pCurrentPos, BlockPos pFacingPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state. For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately returns its solidified counterpart. Note that this method should ideally consider only the specific direction passed in.- Overrides:
updateShape
in classBlockBehaviour
-
canSurvive
- Overrides:
canSurvive
in classBlockBehaviour
-
tick
- Overrides:
tick
in classBlockBehaviour
-
entityInside
- Overrides:
entityInside
in classBlockBehaviour
-
checkPressed
private void checkPressed(@Nullable Entity pEntity, Level pLevel, BlockPos pPos, BlockState pState, int pCurrentSignal) -
onRemove
protected void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) - Overrides:
onRemove
in classBlockBehaviour
-
updateNeighbours
Notify block and block below of changes -
getSignal
protected int getSignal(BlockState pBlockState, BlockGetter pBlockAccess, BlockPos pPos, Direction pSide) Returns the signal this block emits in the given direction.NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.
- Overrides:
getSignal
in classBlockBehaviour
-
getDirectSignal
protected int getDirectSignal(BlockState pBlockState, BlockGetter pBlockAccess, BlockPos pPos, Direction pSide) Returns the direct signal this block emits in the given direction.NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.
- Overrides:
getDirectSignal
in classBlockBehaviour
-
isSignalSource
Returns whether this block is capable of emitting redstone signals.- Overrides:
isSignalSource
in classBlockBehaviour
-
getEntityCount
-
getSignalStrength
Calculates what the signal strength of a pressure plate at the given location should be. -
getSignalForState
Returns the signal encoded in the given block state. -
setSignalForState
Returns the block state that encodes the given signal.
-