Package net.minecraft.block
Class StairsBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.StairsBlock
- All Implemented Interfaces:
FluidDrainable,FluidFillable,Waterloggable,ItemConvertible
public class StairsBlock extends Block implements Waterloggable
-
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 private BlockbaseBlockprivate BlockStatebaseBlockStateprotected static VoxelShapeBOTTOM_NORTH_EAST_CORNER_SHAPEprotected static VoxelShapeBOTTOM_NORTH_WEST_CORNER_SHAPEprotected static VoxelShapeBOTTOM_SHAPEprotected static VoxelShape[]BOTTOM_SHAPESprotected static VoxelShapeBOTTOM_SOUTH_EAST_CORNER_SHAPEprotected static VoxelShapeBOTTOM_SOUTH_WEST_CORNER_SHAPEstatic DirectionPropertyFACINGstatic EnumProperty<BlockHalf>HALFstatic EnumProperty<StairShape>SHAPEprivate static int[]SHAPE_INDICESprotected static VoxelShapeTOP_NORTH_EAST_CORNER_SHAPEprotected static VoxelShapeTOP_NORTH_WEST_CORNER_SHAPEprotected static VoxelShapeTOP_SHAPEprotected static VoxelShape[]TOP_SHAPESprotected static VoxelShapeTOP_SOUTH_EAST_CORNER_SHAPEprotected static VoxelShapeTOP_SOUTH_WEST_CORNER_SHAPEstatic BooleanPropertyWATERLOGGEDFields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier -
Constructor Summary
Constructors Modifier Constructor Description protectedStairsBlock(BlockState baseBlockState, AbstractBlock.Settings settings) -
Method Summary
Modifier and Type Method Description protected voidappendProperties(StateManager.Builder<Block,BlockState> builder)booleancanPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)private static VoxelShapecomposeShape(int i, VoxelShape base, VoxelShape northWest, VoxelShape northEast, VoxelShape southWest, VoxelShape southEast)private static VoxelShape[]composeShapes(VoxelShape base, VoxelShape northWest, VoxelShape northEast, VoxelShape southWest, VoxelShape southEast)floatgetBlastResistance()FluidStategetFluidState(BlockState state)VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)BlockStategetPlacementState(ItemPlacementContext ctx)private intgetShapeIndexIndex(BlockState state)private static StairShapegetStairShape(BlockState state, BlockView world, BlockPos pos)BlockStategetStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos)Gets the possibly updated block state of this block when a neighboring block is updated.booleanhasRandomTicks(BlockState state)booleanhasSidedTransparency(BlockState state)private static booleanisDifferentOrientation(BlockState state, BlockView world, BlockPos pos, Direction dir)static booleanisStairs(BlockState state)BlockStatemirror(BlockState state, BlockMirror mirror)voidonBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)voidonBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player)voidonBroken(WorldAccess world, BlockPos pos, BlockState state)voidonDestroyedByExplosion(World world, BlockPos pos, Explosion explosion)Called when this block is destroyed by an explosion.voidonStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)ifnewStateis different fromstate.voidonSteppedOn(World world, BlockPos pos, Entity entity)Called when an entity steps on this block.ActionResultonUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player.voidrandomDisplayTick(BlockState state, World world, BlockPos pos, Random random)voidrandomTick(BlockState state, ServerWorld world, BlockPos pos, Random random)BlockStaterotate(BlockState state, BlockRotation rotation)Applies a block rotation to a block state.voidscheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random)Methods inherited from class net.minecraft.block.Block
addStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBreak, onEntityLand, onLandedUpon, onPlaced, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStrongRedstonePower, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, isSideInvisible, neighborUpdate, onEntityCollision, onProjectileHit, onStacksDropped, onSyncedBlockEvent, prepareMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.block.Waterloggable
canFillWithFluid, tryDrainFluid, tryFillWithFluid
-
Field Details
-
FACING
-
HALF
-
SHAPE
-
WATERLOGGED
-
TOP_SHAPE
-
BOTTOM_SHAPE
-
BOTTOM_NORTH_WEST_CORNER_SHAPE
-
BOTTOM_SOUTH_WEST_CORNER_SHAPE
-
TOP_NORTH_WEST_CORNER_SHAPE
-
TOP_SOUTH_WEST_CORNER_SHAPE
-
BOTTOM_NORTH_EAST_CORNER_SHAPE
-
BOTTOM_SOUTH_EAST_CORNER_SHAPE
-
TOP_NORTH_EAST_CORNER_SHAPE
-
TOP_SOUTH_EAST_CORNER_SHAPE
-
TOP_SHAPES
-
BOTTOM_SHAPES
-
SHAPE_INDICES
private static final int[] SHAPE_INDICES -
baseBlock
-
baseBlockState
-
-
Constructor Details
-
StairsBlock
-
-
Method Details
-
composeShapes
private static VoxelShape[] composeShapes(VoxelShape base, VoxelShape northWest, VoxelShape northEast, VoxelShape southWest, VoxelShape southEast) -
composeShape
private static VoxelShape composeShape(int i, VoxelShape base, VoxelShape northWest, VoxelShape northEast, VoxelShape southWest, VoxelShape southEast) -
hasSidedTransparency
- Overrides:
hasSidedTransparencyin classAbstractBlock
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShapein classAbstractBlock
-
getShapeIndexIndex
-
randomDisplayTick
@Environment(CLIENT) public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)- Overrides:
randomDisplayTickin classBlock
-
onBlockBreakStart
- Overrides:
onBlockBreakStartin classAbstractBlock
-
onBroken
-
getBlastResistance
public float getBlastResistance()- Overrides:
getBlastResistancein classBlock
-
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)- Overrides:
onBlockAddedin classAbstractBlock
-
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
-
onSteppedOn
Called when an entity steps on this block.- Overrides:
onSteppedOnin classBlock
-
hasRandomTicks
- Overrides:
hasRandomTicksin classBlock
-
randomTick
- Overrides:
randomTickin classAbstractBlock
-
scheduledTick
- Overrides:
scheduledTickin 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.
-
onDestroyedByExplosion
Called when this block is destroyed by an explosion.- Overrides:
onDestroyedByExplosionin classBlock
-
getPlacementState
- Overrides:
getPlacementStatein classBlock
-
getStateForNeighborUpdate
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos)Gets the possibly updated block state of this block when a neighboring block is updated.- Overrides:
getStateForNeighborUpdatein classAbstractBlock- Parameters:
state- the state of this blockdirection- the direction from this block to the neighborneighborState- the state of the updated neighbor blockworld- the worldpos- the position of this blockneighborPos- the position of the neighbor block- Returns:
- the new state of this block
-
getStairShape
-
isDifferentOrientation
private static boolean isDifferentOrientation(BlockState state, BlockView world, BlockPos pos, Direction dir) -
isStairs
-
rotate
Applies a block rotation to a block state.By default, this returns the provided block state.
- Overrides:
rotatein classAbstractBlock- Returns:
- the rotated block state
-
mirror
- Overrides:
mirrorin classAbstractBlock
-
appendProperties
- Overrides:
appendPropertiesin classBlock
-
getFluidState
- Overrides:
getFluidStatein classAbstractBlock
-