Package net.minecraft.world.level.block
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 net.minecraft.world.level.block.Block
Block.ShapePairKeyNested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicateNested classes/interfaces inherited from interface net.minecraft.world.level.block.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 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_SKIP_ALL_SIDEEFFECTS, UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS, UPDATE_SKIP_ON_PLACE, UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE, UPDATE_SUPPRESS_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
descriptionId, drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaffectNeighborsAfterRemoval(BlockState p_432992_, ServerLevel p_433135_, BlockPos p_434392_, boolean p_434559_) com.mojang.serialization.MapCodec<ShelfBlock> codec()protected voidprotected intgetAnalogOutputSignal(BlockState p_435034_, Level p_433944_, BlockPos p_433350_, Direction p_433486_) intgetFacing(BlockState p_433922_) protected FluidStategetFluidState(BlockState p_436034_) intintgetRows()protected VoxelShapegetShape(BlockState p_433292_, BlockGetter p_433892_, BlockPos p_435749_, CollisionContext p_435101_) getSideChainPart(BlockState p_432814_) getStateForPlacement(BlockPlaceContext p_434959_) protected booleanhasAnalogOutputSignal(BlockState p_435926_) booleanisConnectable(BlockState p_434576_) protected booleanisPathfindable(BlockState p_433007_, PathComputationType p_433825_) mirror(BlockState p_433683_, Mirror p_433525_) Returns the blockstate with the given mirror of the passed blockstate.protected voidneighborChanged(BlockState p_433593_, Level p_433212_, BlockPos p_433073_, Block p_433504_, Orientation p_433036_, boolean p_435480_) newBlockEntity(BlockPos p_433693_, BlockState p_434499_) protected voidonPlace(BlockState p_434112_, Level p_435852_, BlockPos p_434206_, BlockState p_434335_, boolean p_434829_) private voidplaySound(LevelAccessor pLevel, BlockPos pPos, SoundEvent pSound) rotate(BlockState p_433098_, Rotation p_435249_) Returns the blockstate with the given rotation from the passed blockstate.setSideChainPart(BlockState p_433421_, SideChainPart p_433762_) private booleanswapHotbar(Level pLevel, BlockPos pPos, Inventory pInventory) private static booleanswapSingleItem(ItemStack pStack, Player pPlayer, ShelfBlockEntity pShelf, int pIndex, Inventory pInventory) protected BlockStateupdateShape(BlockState p_432911_, LevelReader p_436058_, ScheduledTickAccess p_433087_, BlockPos p_436032_, Direction p_433273_, BlockPos p_435870_, BlockState p_435564_, RandomSource p_435142_) protected InteractionResultuseItemOn(ItemStack p_433583_, BlockState p_433454_, Level p_435671_, BlockPos p_433939_, Player p_433327_, InteractionHand p_432907_, BlockHitResult p_433590_) protected booleanuseShapeForLightOcclusion(BlockState p_434279_) Methods inherited from class net.minecraft.world.level.block.BaseEntityBlock
createTickerHelper, getMenuProvider, triggerEventMethods inherited from class net.minecraft.world.level.block.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 net.minecraft.world.level.block.state.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.block.EntityBlock
getListener, getTickerMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.neoforged.neoforge.common.extensions.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 net.neoforged.neoforge.common.extensions.IBucketPickupExtension
getPickupSoundMethods inherited from interface net.minecraft.world.level.block.SelectableSlotContainer
getHitSlotMethods inherited from interface net.minecraft.world.level.block.SideChainPartBlock
getAllBlocksConnectedTo, setPart, updateNeighborsAfterPoweringDown, updateSelfAndNeighborsOnPoweringUpMethods inherited from interface net.minecraft.world.level.block.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 p_433292_, BlockGetter p_433892_, BlockPos p_435749_, CollisionContext p_435101_) - 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 p_432992_, ServerLevel p_433135_, BlockPos p_434392_, boolean p_434559_) - Overrides:
affectNeighborsAfterRemovalin classBlockBehaviour
-
neighborChanged
protected void neighborChanged(BlockState p_433593_, Level p_433212_, BlockPos p_433073_, Block p_433504_, @Nullable Orientation p_433036_, boolean p_435480_) - 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 p_433583_, BlockState p_433454_, Level p_435671_, BlockPos p_433939_, Player p_433327_, InteractionHand p_432907_, BlockHitResult p_433590_) - Overrides:
useItemOnin classBlockBehaviour
-
swapSingleItem
private static boolean swapSingleItem(ItemStack pStack, Player pPlayer, ShelfBlockEntity pShelf, int pIndex, Inventory pInventory) -
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 p_434112_, Level p_435852_, BlockPos p_434206_, BlockState p_434335_, boolean p_434829_) - Overrides:
onPlacein classBlockBehaviour
-
playSound
-
getFluidState
- Overrides:
getFluidStatein classBlockBehaviour
-
updateShape
protected BlockState updateShape(BlockState p_432911_, LevelReader p_436058_, ScheduledTickAccess p_433087_, BlockPos p_436032_, Direction p_433273_, BlockPos p_435870_, BlockState p_435564_, RandomSource p_435142_) - Overrides:
updateShapein classBlockBehaviour
-
hasAnalogOutputSignal
- Overrides:
hasAnalogOutputSignalin classBlockBehaviour
-
getAnalogOutputSignal
protected int getAnalogOutputSignal(BlockState p_435034_, Level p_433944_, BlockPos p_433350_, Direction p_433486_) - Overrides:
getAnalogOutputSignalin classBlockBehaviour
-