Package net.minecraft.world.level.block
Class ButtonBlock
- All Implemented Interfaces:
ItemLike
,IForgeBlock
,IForgeRegistryEntry<Block>
- Direct Known Subclasses:
StoneButtonBlock
,WoodButtonBlock
-
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.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static VoxelShape
protected static VoxelShape
protected static VoxelShape
protected static VoxelShape
protected static VoxelShape
protected static int
protected static int
protected static VoxelShape
static BooleanProperty
protected static VoxelShape
protected static VoxelShape
private static int
protected static VoxelShape
protected static VoxelShape
protected static VoxelShape
protected static VoxelShape
protected static VoxelShape
protected static VoxelShape
private boolean
protected static VoxelShape
private static int
protected static 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, LOGGER, RANDOM, 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, UPDATE_SUPPRESS_LIGHT
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, material, properties, soundType, speedFactor, UPDATE_SHAPE_ORDER
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
Constructor Summary
ModifierConstructorDescriptionprotected
ButtonBlock(boolean p_51065_, BlockBehaviour.Properties p_51066_)
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkPressed(BlockState p_51121_, Level p_51122_, BlockPos p_51123_)
protected void
createBlockStateDefinition(StateDefinition.Builder<Block,BlockState> p_51101_)
void
entityInside(BlockState p_51083_, Level p_51084_, BlockPos p_51085_, Entity p_51086_)
int
getDirectSignal(BlockState p_51109_, BlockGetter p_51110_, BlockPos p_51111_, Direction p_51112_)
private int
getShape(BlockState p_51104_, BlockGetter p_51105_, BlockPos p_51106_, CollisionContext p_51107_)
int
getSignal(BlockState p_51078_, BlockGetter p_51079_, BlockPos p_51080_, Direction p_51081_)
protected abstract SoundEvent
getSound(boolean p_51102_)
boolean
isSignalSource(BlockState p_51114_)
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_)
void
tick(BlockState p_51073_, ServerLevel p_51074_, BlockPos p_51075_, Random p_51076_)
private void
updateNeighbours(BlockState p_51125_, Level p_51126_, BlockPos p_51127_)
use(BlockState p_51088_, Level p_51089_, BlockPos p_51090_, Player p_51091_, InteractionHand p_51092_, BlockHitResult p_51093_)
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, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, fillItemCategory, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, getTags, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, defaultDestroyTime, defaultMaterialColor, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getOffsetType, getPistonPushReaction, getRenderShape, getSeed, getShadeBrightness, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isPathfindable, neighborChanged, onPlace, onProjectileHit, randomTick, skipRendering, spawnAfterBreak, triggerEvent, updateIndirectNeighbourShapes, useShapeForLightOcclusion
Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlock
addLandingEffects, addRunningEffects, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getPickBlock, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onNeighborChange, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay
-
Field Details
-
POWERED
-
PRESSED_DEPTH
private static final int PRESSED_DEPTH- See Also:
- Constant Field Values
-
UNPRESSED_DEPTH
private static final int UNPRESSED_DEPTH- See Also:
- Constant Field Values
-
HALF_AABB_HEIGHT
protected static final int HALF_AABB_HEIGHT- See Also:
- Constant Field Values
-
HALF_AABB_WIDTH
protected static final int HALF_AABB_WIDTH- See Also:
- Constant Field Values
-
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
-
sensitive
private final boolean sensitive
-
-
Constructor Details
-
ButtonBlock
-
-
Method Details
-
getPressDuration
private int getPressDuration() -
getShape
public VoxelShape getShape(BlockState p_51104_, BlockGetter p_51105_, BlockPos p_51106_, CollisionContext p_51107_)- Overrides:
getShape
in classBlockBehaviour
-
use
public InteractionResult use(BlockState p_51088_, Level p_51089_, BlockPos p_51090_, Player p_51091_, InteractionHand p_51092_, BlockHitResult p_51093_)- Overrides:
use
in classBlockBehaviour
-
press
-
playSound
protected void playSound(@Nullable Player p_51068_, LevelAccessor p_51069_, BlockPos p_51070_, boolean p_51071_) -
getSound
-
onRemove
public void onRemove(BlockState p_51095_, Level p_51096_, BlockPos p_51097_, BlockState p_51098_, boolean p_51099_)- Overrides:
onRemove
in classBlockBehaviour
-
getSignal
public int getSignal(BlockState p_51078_, BlockGetter p_51079_, BlockPos p_51080_, Direction p_51081_)- Overrides:
getSignal
in classBlockBehaviour
-
getDirectSignal
public int getDirectSignal(BlockState p_51109_, BlockGetter p_51110_, BlockPos p_51111_, Direction p_51112_)- Overrides:
getDirectSignal
in classBlockBehaviour
-
isSignalSource
- Overrides:
isSignalSource
in classBlockBehaviour
-
tick
- Overrides:
tick
in classBlockBehaviour
-
entityInside
- Overrides:
entityInside
in classBlockBehaviour
-
checkPressed
-
updateNeighbours
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-