public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements Waterloggable
Block.NeighborGroupAbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>| Modifier and Type | Field and Description |
|---|---|
static EnumProperty<ChestType> |
CHEST_TYPE |
protected static VoxelShape |
DOUBLE_EAST_SHAPE |
protected static VoxelShape |
DOUBLE_NORTH_SHAPE |
protected static VoxelShape |
DOUBLE_SOUTH_SHAPE |
protected static VoxelShape |
DOUBLE_WEST_SHAPE |
static DirectionProperty |
FACING |
private static DoubleBlockProperties.PropertyRetriever<ChestBlockEntity,Optional<Inventory>> |
INVENTORY_RETRIEVER |
private static DoubleBlockProperties.PropertyRetriever<ChestBlockEntity,Optional<NamedScreenHandlerFactory>> |
NAME_RETRIEVER |
protected static VoxelShape |
SINGLE_SHAPE |
static BooleanProperty |
WATERLOGGED |
entityTypeRetrieverLOGGER, STATE_IDS, stateManagercollidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier| Modifier | Constructor and Description |
|---|---|
protected |
ChestBlock(AbstractBlock.Settings settings,
Supplier<BlockEntityType<? extends ChestBlockEntity>> entityTypeSupplier) |
onSyncedBlockEventaddStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringcalcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasSidedTransparency, isSideInvisible, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, prepare, randomTick, scheduledTickclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanFillWithFluid, tryDrainFluid, tryFillWithFluidpublic static final DirectionProperty FACING
public static final EnumProperty<ChestType> CHEST_TYPE
public static final BooleanProperty WATERLOGGED
protected static final VoxelShape DOUBLE_NORTH_SHAPE
protected static final VoxelShape DOUBLE_SOUTH_SHAPE
protected static final VoxelShape DOUBLE_WEST_SHAPE
protected static final VoxelShape DOUBLE_EAST_SHAPE
protected static final VoxelShape SINGLE_SHAPE
private static final DoubleBlockProperties.PropertyRetriever<ChestBlockEntity,Optional<Inventory>> INVENTORY_RETRIEVER
private static final DoubleBlockProperties.PropertyRetriever<ChestBlockEntity,Optional<NamedScreenHandlerFactory>> NAME_RETRIEVER
protected ChestBlock(AbstractBlock.Settings settings, Supplier<BlockEntityType<? extends ChestBlockEntity>> entityTypeSupplier)
public static DoubleBlockProperties.Type getDoubleBlockType(BlockState state)
public BlockRenderType getRenderType(BlockState state)
getRenderType in class BlockWithEntitypublic BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
getStateForNeighborUpdate in class AbstractBlockpublic VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape in class AbstractBlockpublic static Direction getFacing(BlockState state)
public BlockState getPlacementState(ItemPlacementContext ctx)
getPlacementState in class Blockpublic FluidState getFluidState(BlockState state)
getFluidState in class AbstractBlock@Nullable private Direction getNeighborChestDirection(ItemPlacementContext ctx, Direction dir)
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack)
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)
WorldChunk.setBlockState(BlockPos, BlockState, boolean) if newState is different from state. Vanilla blocks perform removal cleanups here.onStateReplaced in class AbstractBlockpublic ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)
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.
onUse in class AbstractBlockprotected Stat<Identifier> getOpenStat()
@Nullable public static Inventory getInventory(ChestBlock block, BlockState state, World world, BlockPos pos, boolean ignoreBlocked)
public DoubleBlockProperties.PropertySource<? extends ChestBlockEntity> getBlockEntitySource(BlockState state, World world, BlockPos pos, boolean ignoreBlocked)
getBlockEntitySource in class AbstractChestBlock<ChestBlockEntity>@Nullable public NamedScreenHandlerFactory createScreenHandlerFactory(BlockState state, World world, BlockPos pos)
createScreenHandlerFactory in class BlockWithEntity@Environment(value=CLIENT) public static DoubleBlockProperties.PropertyRetriever<ChestBlockEntity,it.unimi.dsi.fastutil.floats.Float2FloatFunction> getAnimationProgressRetriever(ChestAnimationProgress chestAnimationProgress)
public BlockEntity createBlockEntity(BlockView world)
createBlockEntity in interface BlockEntityProviderpublic static boolean isChestBlocked(WorldAccess world, BlockPos pos)
private static boolean hasOcelotOnTop(WorldAccess world, BlockPos pos)
public boolean hasComparatorOutput(BlockState state)
hasComparatorOutput in class AbstractBlockpublic int getComparatorOutput(BlockState state, World world, BlockPos pos)
getComparatorOutput in class AbstractBlockpublic BlockState rotate(BlockState state, BlockRotation rotation)
By default, this returns the provided block state.
rotate in class AbstractBlockpublic BlockState mirror(BlockState state, BlockMirror mirror)
mirror in class AbstractBlockprotected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties in class Blockpublic boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
canPathfindThrough in class AbstractBlock