Package net.minecraft.world.level.block
Class CropBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.BushBlock
net.minecraft.world.level.block.CropBlock
- All Implemented Interfaces:
FeatureElement
,BonemealableBlock
,ItemLike
,IBlockExtension
,IPlantable
- Direct Known Subclasses:
BeetrootBlock
,CarrotBlock
,PotatoBlock
,TorchflowerCropBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.BlockStatePairKey
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
Nested classes/interfaces inherited from interface net.minecraft.world.level.block.BonemealableBlock
BonemealableBlock.Type
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IntegerProperty
static final com.mojang.serialization.MapCodec
<CropBlock> static final int
private static final VoxelShape[]
Fields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SUPPRESS_DROPS
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDER
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canSurvive
(BlockState p_52282_, LevelReader p_52283_, BlockPos p_52284_) com.mojang.serialization.MapCodec
<? extends CropBlock> codec()
protected void
protected void
entityInside
(BlockState p_52277_, Level p_52278_, BlockPos p_52279_, Entity p_52280_) int
getAge
(BlockState p_52306_) protected IntegerProperty
protected ItemLike
protected int
getBonemealAgeIncrease
(Level p_52262_) getCloneItemStack
(LevelReader p_304482_, BlockPos p_52255_, BlockState p_52256_) protected static float
getGrowthSpeed
(Block p_52273_, BlockGetter p_52274_, BlockPos p_52275_) int
protected VoxelShape
getShape
(BlockState p_52297_, BlockGetter p_52298_, BlockPos p_52299_, CollisionContext p_52300_) getStateForAge
(int p_52290_) void
growCrops
(Level p_52264_, BlockPos p_52265_, BlockState p_52266_) protected static boolean
hasSufficientLight
(LevelReader p_294828_, BlockPos p_295989_) boolean
isBonemealSuccess
(Level p_221045_, RandomSource p_221046_, BlockPos p_221047_, BlockState p_221048_) final boolean
isMaxAge
(BlockState p_52308_) protected boolean
isRandomlyTicking
(BlockState p_52288_) boolean
isValidBonemealTarget
(LevelReader p_255715_, BlockPos p_52259_, BlockState p_52260_) protected boolean
mayPlaceOn
(BlockState p_52302_, BlockGetter p_52303_, BlockPos p_52304_) void
performBonemeal
(ServerLevel p_221040_, RandomSource p_221041_, BlockPos p_221042_, BlockState p_221043_) protected void
randomTick
(BlockState p_221050_, ServerLevel p_221051_, BlockPos p_221052_, RandomSource p_221053_) Methods inherited from class net.minecraft.world.level.block.BushBlock
getPlant, isPathfindable, propagatesSkylightDown, updateShape
Methods inherited from class net.minecraft.world.level.block.Block
animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSpeedFactor, getStateDefinition, getStateForPlacement, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, defaultDestroyTime, defaultMapColor, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isSignalSource, mirror, neighborChanged, onExplosionHit, onPlace, onProjectileHit, onRemove, properties, propertiesCodec, requiredFeatures, rotate, simpleCodec, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusion, useWithoutItem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.block.BonemealableBlock
getParticlePos, getType
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHiding
Methods inherited from interface net.neoforged.neoforge.common.IPlantable
getPlantType
-
Field Details
-
CODEC
-
MAX_AGE
public static final int MAX_AGE- See Also:
-
AGE
-
SHAPE_BY_AGE
-
-
Constructor Details
-
CropBlock
-
-
Method Details
-
codec
-
getShape
protected VoxelShape getShape(BlockState p_52297_, BlockGetter p_52298_, BlockPos p_52299_, CollisionContext p_52300_) - Overrides:
getShape
in classBlockBehaviour
-
mayPlaceOn
- Overrides:
mayPlaceOn
in classBushBlock
-
getAgeProperty
-
getMaxAge
public int getMaxAge() -
getAge
-
getStateForAge
-
isMaxAge
-
isRandomlyTicking
- Overrides:
isRandomlyTicking
in classBlockBehaviour
-
randomTick
protected void randomTick(BlockState p_221050_, ServerLevel p_221051_, BlockPos p_221052_, RandomSource p_221053_) - Overrides:
randomTick
in classBlockBehaviour
-
growCrops
-
getBonemealAgeIncrease
-
getGrowthSpeed
-
canSurvive
- Overrides:
canSurvive
in classBushBlock
-
hasSufficientLight
-
entityInside
protected void entityInside(BlockState p_52277_, Level p_52278_, BlockPos p_52279_, Entity p_52280_) - Overrides:
entityInside
in classBlockBehaviour
-
getBaseSeedId
-
getCloneItemStack
- Overrides:
getCloneItemStack
in classBlock
-
isValidBonemealTarget
- Specified by:
isValidBonemealTarget
in interfaceBonemealableBlock
-
isBonemealSuccess
public boolean isBonemealSuccess(Level p_221045_, RandomSource p_221046_, BlockPos p_221047_, BlockState p_221048_) - Specified by:
isBonemealSuccess
in interfaceBonemealableBlock
-
performBonemeal
public void performBonemeal(ServerLevel p_221040_, RandomSource p_221041_, BlockPos p_221042_, BlockState p_221043_) - Specified by:
performBonemeal
in interfaceBonemealableBlock
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-