Class ChestBlock
- All Implemented Interfaces:
FeatureElement, BucketPickup, EntityBlock, LiquidBlockContainer, SimpleWaterloggedBlock, ItemLike, IBlockExtension, IBucketPickupExtension
- Direct Known Subclasses:
CopperChestBlock, TrappedChestBlock
public class ChestBlock
extends AbstractChestBlock<ChestBlockEntity>
implements 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.StatePredicate -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DoubleBlockCombiner.Combiner<ChestBlockEntity, Optional<Container>> private final SoundEventstatic final com.mojang.serialization.MapCodec<ChestBlock> static final intstatic final EnumProperty<Direction> private static final Map<Direction, VoxelShape> private static final DoubleBlockCombiner.Combiner<ChestBlockEntity, Optional<MenuProvider>> private final SoundEventprivate static final VoxelShapestatic final EnumProperty<ChestType> static final BooleanPropertyFields inherited from class AbstractChestBlock
blockEntityTypeFields 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
ConstructorsConstructorDescriptionChestBlock(Supplier<BlockEntityType<? extends ChestBlockEntity>> blockEntityType, SoundEvent openSound, SoundEvent closeSound, BlockBehaviour.Properties properties) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaffectNeighborsAfterRemoval(BlockState state, ServerLevel level, BlockPos pos, boolean movedByPiston) BlockEntityType<? extends ChestBlockEntity> private @Nullable DirectioncandidatePartnerFacing(Level level, BlockPos pos, Direction neighbourDirection) booleanchestCanConnectTo(BlockState blockState) com.mojang.serialization.MapCodec<? extends ChestBlock> codec()combine(BlockState state, Level level, BlockPos pos, boolean ignoreBeingBlocked) protected voidprotected intgetAnalogOutputSignal(BlockState state, Level level, BlockPos pos, Direction direction) getBlockType(BlockState state) protected ChestTypegetChestType(Level level, BlockPos pos, Direction facingDirection) static BlockPosgetConnectedBlockPos(BlockPos pos, BlockState state) static DirectiongetConnectedDirection(BlockState state) static @Nullable ContainergetContainer(ChestBlock block, BlockState state, Level level, BlockPos pos, boolean ignoreBeingBlocked) protected FluidStategetFluidState(BlockState state) protected @Nullable MenuProvidergetMenuProvider(BlockState state, Level level, BlockPos pos) protected Stat<Identifier> protected VoxelShapegetShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) getStateForPlacement(BlockPlaceContext context) <T extends BlockEntity>
@Nullable BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> type) protected booleanhasAnalogOutputSignal(BlockState state) private static booleanisBlockedChestByBlock(BlockGetter level, BlockPos pos) private static booleanisCatSittingOnChest(LevelAccessor level, BlockPos pos) static booleanisChestBlockedAt(LevelAccessor level, BlockPos pos) protected booleanisPathfindable(BlockState state, PathComputationType type) protected BlockStatemirror(BlockState state, Mirror mirror) newBlockEntity(BlockPos worldPosition, BlockState blockState) static DoubleBlockCombiner.Combiner<ChestBlockEntity, it.unimi.dsi.fastutil.floats.Float2FloatFunction> opennessCombiner(LidBlockEntity entity) protected BlockStaterotate(BlockState state, Rotation rotation) protected voidtick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) protected BlockStateupdateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) protected InteractionResultuseWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) Methods inherited from class BaseEntityBlock
createTickerHelper, 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, neighborChanged, onExplosionHit, onPlace, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, shouldChangedStateKeepBlockEntity, simpleCodec, skipRendering, spawnAfterBreak, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface EntityBlock
getListenerMethods 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 SimpleWaterloggedBlock
canPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
-
Field Details
-
CODEC
-
FACING
-
TYPE
-
WATERLOGGED
-
EVENT_SET_OPEN_COUNT
public static final int EVENT_SET_OPEN_COUNT- See Also:
-
SHAPE
-
HALF_SHAPES
-
openSound
-
closeSound
-
CHEST_COMBINER
private static final DoubleBlockCombiner.Combiner<ChestBlockEntity, Optional<Container>> CHEST_COMBINER -
MENU_PROVIDER_COMBINER
private static final DoubleBlockCombiner.Combiner<ChestBlockEntity, Optional<MenuProvider>> MENU_PROVIDER_COMBINER
-
-
Constructor Details
-
ChestBlock
public ChestBlock(Supplier<BlockEntityType<? extends ChestBlockEntity>> blockEntityType, SoundEvent openSound, SoundEvent closeSound, BlockBehaviour.Properties properties)
-
-
Method Details
-
codec
- Specified by:
codecin classAbstractChestBlock<ChestBlockEntity>
-
getBlockType
-
updateShape
protected BlockState updateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) - Overrides:
updateShapein classBlockBehaviour
-
chestCanConnectTo
-
getShape
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) - Overrides:
getShapein classBlockBehaviour
-
getConnectedDirection
-
getConnectedBlockPos
-
getStateForPlacement
- Overrides:
getStateForPlacementin classBlock
-
getChestType
-
getFluidState
- Overrides:
getFluidStatein classBlockBehaviour
-
candidatePartnerFacing
-
affectNeighborsAfterRemoval
protected void affectNeighborsAfterRemoval(BlockState state, ServerLevel level, BlockPos pos, boolean movedByPiston) - Overrides:
affectNeighborsAfterRemovalin classBlockBehaviour
-
useWithoutItem
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) - Overrides:
useWithoutItemin classBlockBehaviour
-
getOpenChestStat
-
blockEntityType
-
getContainer
public static @Nullable Container getContainer(ChestBlock block, BlockState state, Level level, BlockPos pos, boolean ignoreBeingBlocked) -
combine
public DoubleBlockCombiner.NeighborCombineResult<? extends ChestBlockEntity> combine(BlockState state, Level level, BlockPos pos, boolean ignoreBeingBlocked) - Specified by:
combinein classAbstractChestBlock<ChestBlockEntity>
-
getMenuProvider
- Overrides:
getMenuProviderin classBaseEntityBlock
-
opennessCombiner
public static DoubleBlockCombiner.Combiner<ChestBlockEntity, it.unimi.dsi.fastutil.floats.Float2FloatFunction> opennessCombiner(LidBlockEntity entity) -
newBlockEntity
- Specified by:
newBlockEntityin interfaceEntityBlock
-
getTicker
public <T extends BlockEntity> @Nullable BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> type) - Specified by:
getTickerin interfaceEntityBlock
-
isChestBlockedAt
-
isBlockedChestByBlock
-
isCatSittingOnChest
-
hasAnalogOutputSignal
- Overrides:
hasAnalogOutputSignalin classBlockBehaviour
-
getAnalogOutputSignal
protected int getAnalogOutputSignal(BlockState state, Level level, BlockPos pos, Direction direction) - Overrides:
getAnalogOutputSignalin classBlockBehaviour
-
rotate
- Overrides:
rotatein classBlockBehaviour
-
mirror
- Overrides:
mirrorin classBlockBehaviour
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinitionin classBlock
-
isPathfindable
- Overrides:
isPathfindablein classBlockBehaviour
-
tick
- Overrides:
tickin classBlockBehaviour
-
getOpenChestSound
-
getCloseChestSound
-