Package net.minecraft.block
Class AbstractButtonBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.HorizontalFacingBlock
net.minecraft.block.WallMountedBlock
net.minecraft.block.AbstractButtonBlock
- All Implemented Interfaces:
ItemConvertible
- Direct Known Subclasses:
StoneButtonBlock,WoodenButtonBlock
public abstract class AbstractButtonBlock extends WallMountedBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroupNested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A> -
Field Summary
Fields Modifier and Type Field Description protected static VoxelShapeCEILING_X_PRESSED_SHAPEprotected static VoxelShapeCEILING_X_SHAPEprotected static VoxelShapeCEILING_Z_PRESSED_SHAPEprotected static VoxelShapeCEILING_Z_SHAPEprotected static VoxelShapeEAST_PRESSED_SHAPEprotected static VoxelShapeEAST_SHAPEprotected static VoxelShapeFLOOR_X_PRESSED_SHAPEprotected static VoxelShapeFLOOR_X_SHAPEprotected static VoxelShapeFLOOR_Z_PRESSED_SHAPEprotected static VoxelShapeFLOOR_Z_SHAPEprotected static VoxelShapeNORTH_PRESSED_SHAPEprotected static VoxelShapeNORTH_SHAPEstatic BooleanPropertyPOWEREDprotected static VoxelShapeSOUTH_PRESSED_SHAPEprotected static VoxelShapeSOUTH_SHAPEprotected static VoxelShapeWEST_PRESSED_SHAPEprotected static VoxelShapeWEST_SHAPEprivate booleanwoodenFields inherited from class net.minecraft.block.WallMountedBlock
FACEFields inherited from class net.minecraft.block.HorizontalFacingBlock
FACINGFields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractButtonBlock(boolean wooden, AbstractBlock.Settings settings) -
Method Summary
Methods inherited from class net.minecraft.block.WallMountedBlock
canPlaceAt, canPlaceAt, getDirection, getPlacementState, getStateForNeighborUpdateMethods inherited from class net.minecraft.block.HorizontalFacingBlock
mirror, rotateMethods inherited from class net.minecraft.block.Block
addStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, isFaceFullSquare, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canReplace, createScreenHandlerFactory, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getLootTableId, getMaxModelOffset, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getVisualShape, hasComparatorOutput, hasSidedTransparency, isSideInvisible, neighborUpdate, onBlockAdded, onBlockBreakStart, onProjectileHit, onStacksDropped, onSyncedBlockEvent, prepare, randomTick
-
Field Details
-
POWERED
-
CEILING_X_SHAPE
-
CEILING_Z_SHAPE
-
FLOOR_X_SHAPE
-
FLOOR_Z_SHAPE
-
NORTH_SHAPE
-
SOUTH_SHAPE
-
WEST_SHAPE
-
EAST_SHAPE
-
CEILING_X_PRESSED_SHAPE
-
CEILING_Z_PRESSED_SHAPE
-
FLOOR_X_PRESSED_SHAPE
-
FLOOR_Z_PRESSED_SHAPE
-
NORTH_PRESSED_SHAPE
-
SOUTH_PRESSED_SHAPE
-
WEST_PRESSED_SHAPE
-
EAST_PRESSED_SHAPE
-
wooden
private final boolean wooden
-
-
Constructor Details
-
AbstractButtonBlock
-
-
Method Details
-
getPressTicks
private int getPressTicks() -
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShapein classAbstractBlock
-
onUse
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player. This, by default, is bound to using the right mouse button.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
world.isClient().If the action result is successful on a logical client, then the action will be sent to the logical server for processing.
- Overrides:
onUsein classAbstractBlock- Returns:
- an action result that specifies if using the block was successful.
-
powerOn
-
playClickSound
protected void playClickSound(@Nullable PlayerEntity player, WorldAccess world, BlockPos pos, boolean powered) -
getClickSound
-
onStateReplaced
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)ifnewStateis different fromstate. Vanilla blocks perform removal cleanups here.- Overrides:
onStateReplacedin classAbstractBlock
-
getWeakRedstonePower
public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)- Overrides:
getWeakRedstonePowerin classAbstractBlock
-
getStrongRedstonePower
public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)- Overrides:
getStrongRedstonePowerin classAbstractBlock
-
emitsRedstonePower
- Overrides:
emitsRedstonePowerin classAbstractBlock
-
scheduledTick
- Overrides:
scheduledTickin classAbstractBlock
-
onEntityCollision
- Overrides:
onEntityCollisionin classAbstractBlock
-
tryPowerWithProjectiles
-
updateNeighbors
-
appendProperties
- Overrides:
appendPropertiesin classBlock
-