Class ShelfBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.BaseEntityBlock
net.minecraft.world.level.block.ShelfBlock
- All Implemented Interfaces:
FeatureElement, BucketPickup, EntityBlock, LiquidBlockContainer, SelectableSlotContainer, SideChainPartBlock, SimpleWaterloggedBlock, ItemLike, IBlockExtension, IBucketPickupExtension
public class ShelfBlock
extends BaseEntityBlock
implements SelectableSlotContainer, SideChainPartBlock, SimpleWaterloggedBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class Block
Block.UpdateFlagsNested classes/interfaces inherited from class BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicateNested classes/interfaces inherited from interface SideChainPartBlock
SideChainPartBlock.EmptyNeighbor, SideChainPartBlock.Neighbor, SideChainPartBlock.Neighbors, SideChainPartBlock.SideChainNeighbor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ShelfBlock> static final EnumProperty<Direction> static final BooleanPropertyprivate static final Map<Direction, VoxelShape> static final EnumProperty<SideChainPart> static final BooleanPropertyFields inherited from class 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_SKIP_ALL_SIDEEFFECTS, UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS, UPDATE_SKIP_ON_PLACE, UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE, UPDATE_SUPPRESS_DROPSFields inherited from class BlockBehaviour
descriptionId, drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaffectNeighborsAfterRemoval(BlockState state, ServerLevel level, BlockPos pos, boolean movedByPiston) com.mojang.serialization.MapCodec<ShelfBlock> codec()protected voidprotected intgetAnalogOutputSignal(BlockState state, Level level, BlockPos pos, Direction direction) intgetFacing(BlockState state) protected FluidStategetFluidState(BlockState state) intintgetRows()protected VoxelShapegetShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) getSideChainPart(BlockState state) getStateForPlacement(BlockPlaceContext context) protected booleanhasAnalogOutputSignal(BlockState state) booleanisConnectable(BlockState state) protected booleanisPathfindable(BlockState state, PathComputationType type) mirror(BlockState state, Mirror mirror) Returns the blockstate with the given mirror of the passed blockstate.protected voidneighborChanged(BlockState state, Level level, BlockPos pos, Block block, @Nullable Orientation orientation, boolean movedByPiston) @Nullable BlockEntitynewBlockEntity(BlockPos worldPosition, BlockState blockState) protected voidonPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) private voidplaySound(LevelAccessor level, BlockPos pos, SoundEvent sound) rotate(BlockState state, Rotation rotation) Returns the blockstate with the given rotation from the passed blockstate.setSideChainPart(BlockState state, SideChainPart newPart) private booleanswapHotbar(Level level, BlockPos pos, Inventory inventory) private static booleanswapSingleItem(ItemStack itemStack, Player player, ShelfBlockEntity shelfBlockEntity, int hitSlot, Inventory inventory) protected BlockStateupdateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) protected InteractionResultuseItemOn(ItemStack itemStack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) protected booleanMethods inherited from class BaseEntityBlock
createTickerHelper, getMenuProvider, triggerEventMethods inherited from class Block
animateTick, asBlock, asItem, box, boxes, boxZ, boxZ, boxZ, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, column, column, cube, cube, defaultBlockState, destroy, dropFromBlockInteractLootTable, dropFromExplosion, dropFromLootTable, dropResources, dropResources, dropResources, fallOn, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityMovementAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class BlockBehaviour
attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getBlockSupportShape, getCloneItemStack, getCollisionShape, getDescriptionId, getDestroyProgress, getDirectSignal, getDrops, getEntityInsideCollisionShape, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSignal, getSoundType, getVisualShape, isAir, isCollisionShapeFullBlock, isRandomlyTicking, isSignalSource, onExplosionHit, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, shouldChangedStateKeepBlockEntity, simpleCodec, skipRendering, spawnAfterBreak, tick, updateIndirectNeighbourShapes, useWithoutItemMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface EntityBlock
getListener, getTickerMethods inherited from interface FeatureElement
isEnabledMethods inherited from interface 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, ignitedByLava, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, playFallSound, playStepSound, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHidingMethods inherited from interface IBucketPickupExtension
getPickupSoundMethods inherited from interface SelectableSlotContainer
getHitSlotMethods inherited from interface SideChainPartBlock
getAllBlocksConnectedTo, updateNeighborsAfterPoweringDown, updateSelfAndNeighborsOnPoweringUpMethods inherited from interface SimpleWaterloggedBlock
canPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
-
Field Details
-
CODEC
-
POWERED
-
FACING
-
SIDE_CHAIN_PART
-
WATERLOGGED
-
SHAPES
-
-
Constructor Details
-
ShelfBlock
-
-
Method Details
-
codec
- Specified by:
codecin classBaseEntityBlock
-
getShape
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) - Overrides:
getShapein classBlockBehaviour
-
useShapeForLightOcclusion
- Overrides:
useShapeForLightOcclusionin classBlockBehaviour
-
isPathfindable
- Overrides:
isPathfindablein classBlockBehaviour
-
newBlockEntity
- Specified by:
newBlockEntityin interfaceEntityBlock
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinitionin classBlock
-
affectNeighborsAfterRemoval
protected void affectNeighborsAfterRemoval(BlockState state, ServerLevel level, BlockPos pos, boolean movedByPiston) - Overrides:
affectNeighborsAfterRemovalin classBlockBehaviour
-
neighborChanged
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, @Nullable Orientation orientation, boolean movedByPiston) - Overrides:
neighborChangedin classBlockBehaviour
-
getStateForPlacement
- Overrides:
getStateForPlacementin classBlock
-
rotate
Description copied from class:BlockBehaviourReturns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
rotatein classBlockBehaviour
-
mirror
Description copied from class:BlockBehaviourReturns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
mirrorin classBlockBehaviour
-
getRows
public int getRows()- Specified by:
getRowsin interfaceSelectableSlotContainer
-
getColumns
public int getColumns()- Specified by:
getColumnsin interfaceSelectableSlotContainer
-
useItemOn
protected InteractionResult useItemOn(ItemStack itemStack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) - Overrides:
useItemOnin classBlockBehaviour
-
swapSingleItem
private static boolean swapSingleItem(ItemStack itemStack, Player player, ShelfBlockEntity shelfBlockEntity, int hitSlot, Inventory inventory) -
swapHotbar
-
getSideChainPart
- Specified by:
getSideChainPartin interfaceSideChainPartBlock
-
setSideChainPart
- Specified by:
setSideChainPartin interfaceSideChainPartBlock
-
getFacing
- Specified by:
getFacingin interfaceSideChainPartBlock
-
isConnectable
- Specified by:
isConnectablein interfaceSideChainPartBlock
-
getMaxChainLength
public int getMaxChainLength()- Specified by:
getMaxChainLengthin interfaceSideChainPartBlock
-
onPlace
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) - Overrides:
onPlacein classBlockBehaviour
-
playSound
-
getFluidState
- Overrides:
getFluidStatein classBlockBehaviour
-
updateShape
protected BlockState updateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) - Overrides:
updateShapein classBlockBehaviour
-
hasAnalogOutputSignal
- Overrides:
hasAnalogOutputSignalin classBlockBehaviour
-
getAnalogOutputSignal
protected int getAnalogOutputSignal(BlockState state, Level level, BlockPos pos, Direction direction) - Overrides:
getAnalogOutputSignalin classBlockBehaviour
-