public class BlockCrops extends BlockBush implements IGrowable
Block.EnumOffsetType, Block.Properties, Block.RenderSideCacheKey
Modifier and Type | Field and Description |
---|---|
static IntegerProperty |
AGE |
BLOCK_STATE_IDS, blockHardness, blockMapColor, blockResistance, blocksMovement, capturedDrops, captureDrops, harvesters, lightValue, LOGGER, material, needsRandomTick, RANDOM, soundType, stateContainer
delegate
Modifier | Constructor and Description |
---|---|
protected |
BlockCrops(Block.Properties builder) |
Modifier and Type | Method and Description |
---|---|
boolean |
canGrow(IBlockReader worldIn,
BlockPos pos,
IBlockState state,
boolean isClient) |
boolean |
canUseBonemeal(World worldIn,
java.util.Random rand,
BlockPos pos,
IBlockState state) |
void |
dropBlockAsItemWithChance(IBlockState state,
World worldIn,
BlockPos pos,
float chancePerItem,
int fortune) |
protected void |
fillStateContainer(StateContainer.Builder<Block,IBlockState> builder) |
protected int |
getAge(IBlockState state) |
IntegerProperty |
getAgeProperty() |
protected int |
getBonemealAgeIncrease(World worldIn) |
protected IItemProvider |
getCropsItem() |
void |
getDrops(IBlockState state,
NonNullList<ItemStack> drops,
World world,
BlockPos pos,
int fortune)
This gets a complete list of items dropped from this block.
|
protected static float |
getGrowthChance(Block blockIn,
IBlockReader worldIn,
BlockPos pos) |
ItemStack |
getItem(IBlockReader worldIn,
BlockPos pos,
IBlockState state) |
IItemProvider |
getItemDropped(IBlockState state,
World worldIn,
BlockPos pos,
int fortune) |
int |
getMaxAge() |
protected IItemProvider |
getSeedsItem() |
VoxelShape |
getShape(IBlockState state,
IBlockReader worldIn,
BlockPos pos) |
void |
grow(World worldIn,
BlockPos pos,
IBlockState state) |
void |
grow(World worldIn,
java.util.Random rand,
BlockPos pos,
IBlockState state) |
boolean |
isMaxAge(IBlockState state) |
protected boolean |
isValidGround(IBlockState state,
IBlockReader worldIn,
BlockPos pos) |
boolean |
isValidPosition(IBlockState state,
IWorldReaderBase worldIn,
BlockPos pos) |
void |
tick(IBlockState state,
World worldIn,
BlockPos pos,
java.util.Random random) |
IBlockState |
withAge(int age) |
getBlockFaceShape, getOpacity, getPlant, getRenderLayer, isFullCube, updatePostPlacement
addInformation, allowsMovement, animateTick, asItem, canDropFromExplosion, canEntitySpawn, canProvidePower, canSilkHarvest, canSilkHarvest, canSpawnInBlock, canSustainPlant, captureDrops, causesSuffocation, collisionRayTrace, doesSideFillSquare, dropXpOnBlockBreak, eventReceived, fillItemGroup, fillWithRain, getAmbientOcclusionLightValue, getBlockFromItem, getBlockHardness, getCollisionShape, getComparatorInputOverride, getDefaultState, getExplosionResistance, getFluidState, getHarvestLevel, getHarvestTool, getItemsToDropCount, getLightValue, getMapColor, getMaterial, getNameTextComponent, getOffset, getOffsetType, getPackedLightmapCoords, getPlayerRelativeBlockHardness, getPositionRandom, getPushReaction, getRaytraceShape, getRenderShape, getRenderType, getSilkTouchDrop, getSlipperiness, getSlipperiness, getSoundType, getStateById, getStateContainer, getStateForPlacement, getStateId, getStrongPower, getTickRandomly, getTranslationKey, getValidBlockForPosition, getWeakPower, harvestBlock, hasComparatorInputOverride, hasCustomBreakingProgress, hasTileEntity, isAir, isBlockNormalCube, isCollidable, isCollidable, isDirt, isExceptBlockForAttachWithPiston, isExceptionBlockForAttaching, isIn, isNormalCube, isOpaque, isOpaqueCube, isReplaceable, isRock, isSideInvisible, isSolid, isTopSolid, isVariableOpacity, makeCuboidShape, mirror, needsPostProcessing, neighborChanged, nudgeEntitiesWithNewState, onBlockActivated, onBlockAdded, onBlockClicked, onBlockHarvested, onBlockPlacedBy, onEntityCollision, onEntityWalk, onExplosionDestroy, onFallenUpon, onLanded, onPlayerDestroy, onReplaced, propagatesSkylightDown, quantityDropped, randomTick, registerBlocks, replaceBlock, rotate, setDefaultState, shouldSideBeRendered, spawnAsEntity, tickRate, toString, updateDiagonalNeighbors, updateNeighbors, useNeighborBrightness
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPlantType
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, beginLeaveDecay, canBeConnectedTo, canBeReplacedByLeaves, canConnectRedstone, canCreatureSpawn, canEntityDestroy, canHarvestBlock, canPlaceTorchOnTop, canRenderInLayer, createTileEntity, doesSideBlockChestOpening, doesSideBlockRendering, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getBedSpawnPosition, getBlock, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getExtendedState, getFireSpreadSpeed, getFlammability, getFogColor, getLightValue, getPickBlock, getRayTraceResult, getSoundType, getStateAtViewpoint, getStateForPlacement, getValidRotations, getWeakChanges, hasTileEntity, isAir, isBeaconBase, isBed, isBedFoot, isBurning, isFertile, isFireSource, isFlammable, isFoliage, isLadder, isNormalCube, isReplaceableOreGen, isStickyBlock, isToolEffective, isTopSolid, observedNeighborChange, onBlockExploded, onNeighborChange, onPlantGrow, recolorBlock, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower
public static final IntegerProperty AGE
protected BlockCrops(Block.Properties builder)
public VoxelShape getShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
protected boolean isValidGround(IBlockState state, IBlockReader worldIn, BlockPos pos)
isValidGround
in class BlockBush
public IntegerProperty getAgeProperty()
public int getMaxAge()
protected int getAge(IBlockState state)
public IBlockState withAge(int age)
public boolean isMaxAge(IBlockState state)
public void tick(IBlockState state, World worldIn, BlockPos pos, java.util.Random random)
public void grow(World worldIn, BlockPos pos, IBlockState state)
protected int getBonemealAgeIncrease(World worldIn)
protected static float getGrowthChance(Block blockIn, IBlockReader worldIn, BlockPos pos)
public boolean isValidPosition(IBlockState state, IWorldReaderBase worldIn, BlockPos pos)
isValidPosition
in class BlockBush
protected IItemProvider getSeedsItem()
protected IItemProvider getCropsItem()
public void dropBlockAsItemWithChance(IBlockState state, World worldIn, BlockPos pos, float chancePerItem, int fortune)
dropBlockAsItemWithChance
in class Block
public void getDrops(IBlockState state, NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune)
IForgeBlock
getDrops
in interface IForgeBlock
state
- Current statedrops
- add all items this block drops to this drops listworld
- The current world, Currently hard 'World' and not 'IBlockReder' because vanilla needs it.pos
- Block position in worldfortune
- Breakers fortune levelpublic IItemProvider getItemDropped(IBlockState state, World worldIn, BlockPos pos, int fortune)
getItemDropped
in class Block
public ItemStack getItem(IBlockReader worldIn, BlockPos pos, IBlockState state)
public boolean canGrow(IBlockReader worldIn, BlockPos pos, IBlockState state, boolean isClient)
public boolean canUseBonemeal(World worldIn, java.util.Random rand, BlockPos pos, IBlockState state)
canUseBonemeal
in interface IGrowable
public void grow(World worldIn, java.util.Random rand, BlockPos pos, IBlockState state)
protected void fillStateContainer(StateContainer.Builder<Block,IBlockState> builder)
fillStateContainer
in class Block