public class CropBlock extends PlantBlock implements Fertilizable
Block.NeighborGroupAbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>| Modifier and Type | Field and Description |
|---|---|
static IntProperty |
AGE |
private static VoxelShape[] |
AGE_TO_SHAPE |
LOGGER, STATE_IDS, stateManagercollidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier| Modifier | Constructor and Description |
|---|---|
protected |
CropBlock(AbstractBlock.Settings settings) |
canPathfindThrough, getStateForNeighborUpdate, isTranslucentaddStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPlacementState, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringcalcBlockBreakingDelta, canBucketPlace, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, onUse, prepare, rotate, scheduledTickpublic static final IntProperty AGE
private static final VoxelShape[] AGE_TO_SHAPE
protected CropBlock(AbstractBlock.Settings settings)
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape in class AbstractBlockprotected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos)
canPlantOnTop in class PlantBlockpublic IntProperty getAgeProperty()
public int getMaxAge()
protected int getAge(BlockState state)
public BlockState withAge(int age)
public boolean isMature(BlockState state)
public boolean hasRandomTicks(BlockState state)
hasRandomTicks in class Blockpublic void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
randomTick in class AbstractBlockpublic void applyGrowth(World world, BlockPos pos, BlockState state)
protected int getGrowthAmount(World world)
protected static float getAvailableMoisture(Block block, BlockView world, BlockPos pos)
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos)
canPlaceAt in class PlantBlockpublic void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity)
onEntityCollision in class AbstractBlock@Environment(value=CLIENT) protected ItemConvertible getSeedsItem()
@Environment(value=CLIENT) public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state)
getPickStack in class Blockpublic boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient)
isFertilizable in interface Fertilizablepublic boolean canGrow(World world, Random random, BlockPos pos, BlockState state)
canGrow in interface Fertilizablepublic void grow(ServerWorld world, Random random, BlockPos pos, BlockState state)
grow in interface Fertilizableprotected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties in class Block