public abstract class AbstractPlantStemBlock extends AbstractPlantPartBlock implements Fertilizable
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and Description |
---|---|
static IntProperty |
AGE |
private double |
growthChance |
growthDirection, outlineShape, tickWater
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Modifier | Constructor and Description |
---|---|
protected |
AbstractPlantStemBlock(AbstractBlock.Settings settings,
Direction growthDirection,
VoxelShape outlineShape,
boolean tickWater,
double growthChance) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendProperties(StateManager.Builder<Block,BlockState> builder) |
boolean |
canGrow(World world,
Random random,
BlockPos pos,
BlockState state) |
protected abstract boolean |
chooseStemState(BlockState state) |
BlockState |
getRandomGrowthState(WorldAccess worldAccess) |
BlockState |
getStateForNeighborUpdate(BlockState state,
Direction direction,
BlockState newState,
WorldAccess world,
BlockPos pos,
BlockPos posFrom) |
protected AbstractPlantStemBlock |
getStem() |
void |
grow(ServerWorld world,
Random random,
BlockPos pos,
BlockState state) |
boolean |
hasRandomTicks(BlockState state) |
boolean |
isFertilizable(BlockView world,
BlockPos pos,
BlockState state,
boolean isClient) |
protected abstract int |
method_26376(Random random) |
void |
randomTick(BlockState state,
ServerWorld world,
BlockPos pos,
Random random) |
canAttachTo, canPlaceAt, getOutlineShape, getPlacementState, getPlant, scheduledTick
addStacksForDisplay, 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, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, 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, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, onUse, prepare, rotate
public static final IntProperty AGE
private final double growthChance
protected AbstractPlantStemBlock(AbstractBlock.Settings settings, Direction growthDirection, VoxelShape outlineShape, boolean tickWater, double growthChance)
public BlockState getRandomGrowthState(WorldAccess worldAccess)
getRandomGrowthState
in class AbstractPlantPartBlock
public boolean hasRandomTicks(BlockState state)
hasRandomTicks
in class Block
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
randomTick
in class AbstractBlock
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
getStateForNeighborUpdate
in class AbstractBlock
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient)
isFertilizable
in interface Fertilizable
public boolean canGrow(World world, Random random, BlockPos pos, BlockState state)
canGrow
in interface Fertilizable
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state)
grow
in interface Fertilizable
protected abstract int method_26376(Random random)
protected abstract boolean chooseStemState(BlockState state)
protected AbstractPlantStemBlock getStem()
getStem
in class AbstractPlantPartBlock