Package net.minecraft.world.level.block
Class ChestBlock
- All Implemented Interfaces:
BucketPickup
,EntityBlock
,LiquidBlockContainer
,SimpleWaterloggedBlock
,ItemLike
,IForgeBlock
,IForgeRegistryEntry<Block>
- Direct Known Subclasses:
TrappedChestBlock
public class ChestBlock
extends AbstractChestBlock<ChestBlockEntity>
implements SimpleWaterloggedBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.BlockStatePairKey
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static VoxelShape
protected static int
protected static int
private static DoubleBlockCombiner.Combiner<ChestBlockEntity,Optional<Container>>
protected static VoxelShape
static int
static DirectionProperty
private static DoubleBlockCombiner.Combiner<ChestBlockEntity,Optional<MenuProvider>>
protected static VoxelShape
protected static VoxelShape
static EnumProperty<ChestType>
static BooleanProperty
protected static VoxelShape
Fields inherited from class net.minecraft.world.level.block.AbstractChestBlock
blockEntityType
Fields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, INDESTRUCTIBLE, INSTANT, LOGGER, RANDOM, 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_SUPPRESS_DROPS, UPDATE_SUPPRESS_LIGHT
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, material, properties, soundType, speedFactor, UPDATE_SHAPE_ORDER
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
Constructor Summary
ConstructorDescriptionChestBlock(BlockBehaviour.Properties p_51490_, Supplier<BlockEntityType<? extends ChestBlockEntity>> p_51491_)
-
Method Summary
Modifier and TypeMethodDescriptionBlockEntityType<? extends ChestBlockEntity>
private Direction
candidatePartnerFacing(BlockPlaceContext p_51495_, Direction p_51496_)
combine(BlockState p_51544_, Level p_51545_, BlockPos p_51546_, boolean p_51547_)
protected void
createBlockStateDefinition(StateDefinition.Builder<Block,BlockState> p_51562_)
int
getAnalogOutputSignal(BlockState p_51527_, Level p_51528_, BlockPos p_51529_)
getBlockType(BlockState p_51583_)
static Direction
getConnectedDirection(BlockState p_51585_)
static Container
getContainer(ChestBlock p_51512_, BlockState p_51513_, Level p_51514_, BlockPos p_51515_, boolean p_51516_)
getFluidState(BlockState p_51581_)
getMenuProvider(BlockState p_51574_, Level p_51575_, BlockPos p_51576_)
protected Stat<ResourceLocation>
getRenderShape(BlockState p_51567_)
getShape(BlockState p_51569_, BlockGetter p_51570_, BlockPos p_51571_, CollisionContext p_51572_)
getStateForPlacement(BlockPlaceContext p_51493_)
<T extends BlockEntity>
BlockEntityTicker<T>getTicker(Level p_153055_, BlockState p_153056_, BlockEntityType<T> p_153057_)
boolean
hasAnalogOutputSignal(BlockState p_51520_)
private static boolean
isBlockedChestByBlock(BlockGetter p_51500_, BlockPos p_51501_)
private static boolean
isCatSittingOnChest(LevelAccessor p_51564_, BlockPos p_51565_)
static boolean
isChestBlockedAt(LevelAccessor p_51509_, BlockPos p_51510_)
boolean
isPathfindable(BlockState p_51522_, BlockGetter p_51523_, BlockPos p_51524_, PathComputationType p_51525_)
mirror(BlockState p_51549_, Mirror p_51550_)
newBlockEntity(BlockPos p_153064_, BlockState p_153065_)
void
onRemove(BlockState p_51538_, Level p_51539_, BlockPos p_51540_, BlockState p_51541_, boolean p_51542_)
static DoubleBlockCombiner.Combiner<ChestBlockEntity,it.unimi.dsi.fastutil.floats.Float2FloatFunction>
opennessCombiner(LidBlockEntity p_51518_)
rotate(BlockState p_51552_, Rotation p_51553_)
void
setPlacedBy(Level p_51503_, BlockPos p_51504_, BlockState p_51505_, LivingEntity p_51506_, ItemStack p_51507_)
void
tick(BlockState p_153059_, ServerLevel p_153060_, BlockPos p_153061_, Random p_153062_)
updateShape(BlockState p_51555_, Direction p_51556_, BlockState p_51557_, LevelAccessor p_51558_, BlockPos p_51559_, BlockPos p_51560_)
use(BlockState p_51531_, Level p_51532_, BlockPos p_51533_, Player p_51534_, InteractionHand p_51535_, BlockHitResult p_51536_)
Methods inherited from class net.minecraft.world.level.block.BaseEntityBlock
createTickerHelper, triggerEvent
Methods inherited from class net.minecraft.world.level.block.Block
animateTick, appendHoverText, asBlock, asItem, box, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, fillItemCategory, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, getTags, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMaterialColor, entityInside, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getOcclusionShape, getOffsetType, getPistonPushReaction, getSeed, getShadeBrightness, getSignal, getVisualShape, isAir, isCollisionShapeFullBlock, isSignalSource, neighborChanged, onPlace, onProjectileHit, randomTick, skipRendering, spawnAfterBreak, updateIndirectNeighbourShapes, useShapeForLightOcclusion
Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.block.EntityBlock
getListener
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlock
addLandingEffects, addRunningEffects, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getPickBlock, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onNeighborChange, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay
Methods inherited from interface net.minecraft.world.level.block.SimpleWaterloggedBlock
canPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
-
Field Details
-
FACING
-
TYPE
-
WATERLOGGED
-
EVENT_SET_OPEN_COUNT
public static final int EVENT_SET_OPEN_COUNT- See Also:
- Constant Field Values
-
AABB_OFFSET
protected static final int AABB_OFFSET- See Also:
- Constant Field Values
-
AABB_HEIGHT
protected static final int AABB_HEIGHT- See Also:
- Constant Field Values
-
NORTH_AABB
-
SOUTH_AABB
-
WEST_AABB
-
EAST_AABB
-
AABB
-
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(BlockBehaviour.Properties p_51490_, Supplier<BlockEntityType<? extends ChestBlockEntity>> p_51491_)
-
-
Method Details
-
getBlockType
-
getRenderShape
- Overrides:
getRenderShape
in classBaseEntityBlock
-
updateShape
public BlockState updateShape(BlockState p_51555_, Direction p_51556_, BlockState p_51557_, LevelAccessor p_51558_, BlockPos p_51559_, BlockPos p_51560_)- Overrides:
updateShape
in classBlockBehaviour
-
getShape
public VoxelShape getShape(BlockState p_51569_, BlockGetter p_51570_, BlockPos p_51571_, CollisionContext p_51572_)- Overrides:
getShape
in classBlockBehaviour
-
getConnectedDirection
-
getStateForPlacement
- Overrides:
getStateForPlacement
in classBlock
-
getFluidState
- Overrides:
getFluidState
in classBlockBehaviour
-
candidatePartnerFacing
-
setPlacedBy
public void setPlacedBy(Level p_51503_, BlockPos p_51504_, BlockState p_51505_, LivingEntity p_51506_, ItemStack p_51507_)- Overrides:
setPlacedBy
in classBlock
-
onRemove
public void onRemove(BlockState p_51538_, Level p_51539_, BlockPos p_51540_, BlockState p_51541_, boolean p_51542_)- Overrides:
onRemove
in classBlockBehaviour
-
use
public InteractionResult use(BlockState p_51531_, Level p_51532_, BlockPos p_51533_, Player p_51534_, InteractionHand p_51535_, BlockHitResult p_51536_)- Overrides:
use
in classBlockBehaviour
-
getOpenChestStat
-
blockEntityType
-
getContainer
@Nullable public static Container getContainer(ChestBlock p_51512_, BlockState p_51513_, Level p_51514_, BlockPos p_51515_, boolean p_51516_) -
combine
public DoubleBlockCombiner.NeighborCombineResult<? extends ChestBlockEntity> combine(BlockState p_51544_, Level p_51545_, BlockPos p_51546_, boolean p_51547_)- Specified by:
combine
in classAbstractChestBlock<ChestBlockEntity>
-
getMenuProvider
@Nullable public MenuProvider getMenuProvider(BlockState p_51574_, Level p_51575_, BlockPos p_51576_)- Overrides:
getMenuProvider
in classBaseEntityBlock
-
opennessCombiner
public static DoubleBlockCombiner.Combiner<ChestBlockEntity,it.unimi.dsi.fastutil.floats.Float2FloatFunction> opennessCombiner(LidBlockEntity p_51518_) -
newBlockEntity
- Specified by:
newBlockEntity
in interfaceEntityBlock
-
getTicker
@Nullable public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level p_153055_, BlockState p_153056_, BlockEntityType<T> p_153057_)- Specified by:
getTicker
in interfaceEntityBlock
-
isChestBlockedAt
-
isBlockedChestByBlock
-
isCatSittingOnChest
-
hasAnalogOutputSignal
- Overrides:
hasAnalogOutputSignal
in classBlockBehaviour
-
getAnalogOutputSignal
- Overrides:
getAnalogOutputSignal
in classBlockBehaviour
-
rotate
- Overrides:
rotate
in classBlockBehaviour
-
mirror
- Overrides:
mirror
in classBlockBehaviour
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-
isPathfindable
public boolean isPathfindable(BlockState p_51522_, BlockGetter p_51523_, BlockPos p_51524_, PathComputationType p_51525_)- Overrides:
isPathfindable
in classBlockBehaviour
-
tick
public void tick(BlockState p_153059_, ServerLevel p_153060_, BlockPos p_153061_, Random p_153062_)- Overrides:
tick
in classBlockBehaviour
-