Package net.minecraft.world.level.block
Class ButtonBlock
- All Implemented Interfaces:
FeatureElement
,ItemLike
,IForgeBlock
-
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
Modifier and TypeFieldDescriptionprotected static final VoxelShape
protected static final VoxelShape
static final com.mojang.serialization.MapCodec
<ButtonBlock> protected static final VoxelShape
protected static final VoxelShape
protected static final VoxelShape
protected static final int
protected static final int
protected static final VoxelShape
static final BooleanProperty
protected static final VoxelShape
protected static final VoxelShape
private static final int
protected static final VoxelShape
protected static final VoxelShape
protected static final VoxelShape
protected static final VoxelShape
protected static final VoxelShape
protected static final VoxelShape
protected static final VoxelShape
private final int
private final BlockSetType
private static final int
protected static final VoxelShape
Fields inherited from class net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock
FACE
Fields inherited from class net.minecraft.world.level.block.HorizontalDirectionalBlock
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
ConstructorDescriptionButtonBlock
(BlockSetType p_273462_, int p_273212_, BlockBehaviour.Properties p_273290_) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkPressed
(BlockState p_51121_, Level p_51122_, BlockPos p_51123_) com.mojang.serialization.MapCodec
<ButtonBlock> codec()
protected void
protected void
entityInside
(BlockState p_51083_, Level p_51084_, BlockPos p_51085_, Entity p_51086_) protected int
getDirectSignal
(BlockState p_51109_, BlockGetter p_51110_, BlockPos p_51111_, Direction p_51112_) protected VoxelShape
getShape
(BlockState p_51104_, BlockGetter p_51105_, BlockPos p_51106_, CollisionContext p_51107_) protected int
getSignal
(BlockState p_51078_, BlockGetter p_51079_, BlockPos p_51080_, Direction p_51081_) protected SoundEvent
getSound
(boolean p_51102_) protected boolean
isSignalSource
(BlockState p_51114_) protected void
onExplosionHit
(BlockState p_310762_, Level p_312485_, BlockPos p_312982_, Explosion p_311820_, BiConsumer<ItemStack, BlockPos> p_312672_) protected void
onRemove
(BlockState p_51095_, Level p_51096_, BlockPos p_51097_, BlockState p_51098_, boolean p_51099_) protected void
playSound
(Player p_51068_, LevelAccessor p_51069_, BlockPos p_51070_, boolean p_51071_) void
press
(BlockState p_51117_, Level p_51118_, BlockPos p_51119_, Player p_343045_) protected void
tick
(BlockState p_220903_, ServerLevel p_220904_, BlockPos p_220905_, RandomSource p_220906_) private void
updateNeighbours
(BlockState p_51125_, Level p_51126_, BlockPos p_51127_) protected InteractionResult
useWithoutItem
(BlockState p_329418_, Level p_334611_, BlockPos p_332004_, Player p_330636_, BlockHitResult p_327724_) Methods inherited from class net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock
canAttach, canSurvive, getConnectedDirection, getStateForPlacement, updateShape
Methods inherited from class net.minecraft.world.level.block.HorizontalDirectionalBlock
mirror, rotate
Methods inherited from class net.minecraft.world.level.block.Block
animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, 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, neighborChanged, onPlace, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, simpleCodec, skipRendering, spawnAfterBreak, triggerEvent, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusion
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.minecraftforge.common.extensions.IForgeBlock
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hidesNeighborFace, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isValidSpawn, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHiding
-
Field Details
-
CODEC
-
POWERED
-
PRESSED_DEPTH
private static final int PRESSED_DEPTH- See Also:
-
UNPRESSED_DEPTH
private static final int UNPRESSED_DEPTH- See Also:
-
HALF_AABB_HEIGHT
protected static final int HALF_AABB_HEIGHT- See Also:
-
HALF_AABB_WIDTH
protected static final int HALF_AABB_WIDTH- See Also:
-
CEILING_AABB_X
-
CEILING_AABB_Z
-
FLOOR_AABB_X
-
FLOOR_AABB_Z
-
NORTH_AABB
-
SOUTH_AABB
-
WEST_AABB
-
EAST_AABB
-
PRESSED_CEILING_AABB_X
-
PRESSED_CEILING_AABB_Z
-
PRESSED_FLOOR_AABB_X
-
PRESSED_FLOOR_AABB_Z
-
PRESSED_NORTH_AABB
-
PRESSED_SOUTH_AABB
-
PRESSED_WEST_AABB
-
PRESSED_EAST_AABB
-
type
-
ticksToStayPressed
private final int ticksToStayPressed
-
-
Constructor Details
-
ButtonBlock
-
-
Method Details
-
codec
- Specified by:
codec
in classFaceAttachedHorizontalDirectionalBlock
-
getShape
protected VoxelShape getShape(BlockState p_51104_, BlockGetter p_51105_, BlockPos p_51106_, CollisionContext p_51107_) - Overrides:
getShape
in classBlockBehaviour
-
useWithoutItem
protected InteractionResult useWithoutItem(BlockState p_329418_, Level p_334611_, BlockPos p_332004_, Player p_330636_, BlockHitResult p_327724_) - Overrides:
useWithoutItem
in classBlockBehaviour
-
onExplosionHit
protected void onExplosionHit(BlockState p_310762_, Level p_312485_, BlockPos p_312982_, Explosion p_311820_, BiConsumer<ItemStack, BlockPos> p_312672_) - Overrides:
onExplosionHit
in classBlockBehaviour
-
press
public void press(BlockState p_51117_, Level p_51118_, BlockPos p_51119_, @Nullable Player p_343045_) -
playSound
protected void playSound(@Nullable Player p_51068_, LevelAccessor p_51069_, BlockPos p_51070_, boolean p_51071_) -
getSound
-
onRemove
protected void onRemove(BlockState p_51095_, Level p_51096_, BlockPos p_51097_, BlockState p_51098_, boolean p_51099_) - Overrides:
onRemove
in classBlockBehaviour
-
getSignal
protected int getSignal(BlockState p_51078_, BlockGetter p_51079_, BlockPos p_51080_, Direction p_51081_) - Overrides:
getSignal
in classBlockBehaviour
-
getDirectSignal
protected int getDirectSignal(BlockState p_51109_, BlockGetter p_51110_, BlockPos p_51111_, Direction p_51112_) - Overrides:
getDirectSignal
in classBlockBehaviour
-
isSignalSource
- Overrides:
isSignalSource
in classBlockBehaviour
-
tick
protected void tick(BlockState p_220903_, ServerLevel p_220904_, BlockPos p_220905_, RandomSource p_220906_) - Overrides:
tick
in classBlockBehaviour
-
entityInside
protected void entityInside(BlockState p_51083_, Level p_51084_, BlockPos p_51085_, Entity p_51086_) - Overrides:
entityInside
in classBlockBehaviour
-
checkPressed
-
updateNeighbours
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-