public class ComposterBlock extends Block implements InventoryProvider
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
ComposterBlock.ComposterInventory |
(package private) static class |
ComposterBlock.DummyInventory |
(package private) static class |
ComposterBlock.FullComposterInventory |
Block.NeighborGroupAbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>| Modifier and Type | Field and Description |
|---|---|
static it.unimi.dsi.fastutil.objects.Object2FloatMap<ItemConvertible> |
ITEM_TO_LEVEL_INCREASE_CHANCE |
static IntProperty |
LEVEL |
private static VoxelShape[] |
LEVEL_TO_COLLISION_SHAPE |
private static VoxelShape |
RAY_TRACE_SHAPE |
LOGGER, STATE_IDS, stateManagercollidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier| Constructor and Description |
|---|
ComposterBlock(AbstractBlock.Settings settings) |
addStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getPlacementState, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringcalcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, rotatepublic static final IntProperty LEVEL
public static final it.unimi.dsi.fastutil.objects.Object2FloatMap<ItemConvertible> ITEM_TO_LEVEL_INCREASE_CHANCE
private static final VoxelShape RAY_TRACE_SHAPE
private static final VoxelShape[] LEVEL_TO_COLLISION_SHAPE
public ComposterBlock(AbstractBlock.Settings settings)
public static void registerDefaultCompostableItems()
private static void registerCompostableItem(float levelIncreaseChance,
ItemConvertible item)
@Environment(value=CLIENT) public static void playEffects(World world, BlockPos pos, boolean fill)
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape in class AbstractBlockpublic VoxelShape getRaycastShape(BlockState state, BlockView world, BlockPos pos)
getRaycastShape in class AbstractBlockpublic VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getCollisionShape in class AbstractBlockpublic void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)
onBlockAdded 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 AbstractBlockpublic static BlockState compost(BlockState state, ServerWorld world, ItemStack stack, BlockPos pos)
public static BlockState emptyFullComposter(BlockState state, World world, BlockPos pos)
private static BlockState emptyComposter(BlockState state, WorldAccess world, BlockPos pos)
private static BlockState addToComposter(BlockState state, WorldAccess world, BlockPos pos, ItemStack item)
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
scheduledTick in class AbstractBlockpublic boolean hasComparatorOutput(BlockState state)
hasComparatorOutput in class AbstractBlockpublic int getComparatorOutput(BlockState state, World world, BlockPos pos)
getComparatorOutput 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 AbstractBlockpublic SidedInventory getInventory(BlockState state, WorldAccess world, BlockPos pos)
getInventory in interface InventoryProvider