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.VegetationBlock
net.minecraft.world.level.block.CropBlock
- All Implemented Interfaces:
FeatureElement,BonemealableBlock,ItemLike,IBlockExtension
- Direct Known Subclasses:
BeetrootBlock,CarrotBlock,PotatoBlock,TorchflowerCropBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.ShapePairKeyNested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicateNested classes/interfaces inherited from interface net.minecraft.world.level.block.BonemealableBlock
BonemealableBlock.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IntegerPropertystatic final com.mojang.serialization.MapCodec<CropBlock> static final intprivate 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_SKIP_ALL_SIDEEFFECTS, UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS, UPDATE_SKIP_ON_PLACE, UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE, UPDATE_SUPPRESS_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
descriptionId, drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanSurvive(BlockState pState, LevelReader pLevel, BlockPos pPos) com.mojang.serialization.MapCodec<? extends CropBlock> codec()protected voidprotected voidentityInside(BlockState p_52277_, Level p_52278_, BlockPos p_52279_, Entity p_52280_, InsideBlockEffectApplier p_405324_, boolean p_451780_) intgetAge(BlockState pState) protected IntegerPropertyprotected ItemLikeprotected intgetBonemealAgeIncrease(Level pLevel) protected ItemStackgetCloneItemStack(LevelReader p_304482_, BlockPos p_52255_, BlockState p_52256_, boolean p_387989_) protected static floatgetGrowthSpeed(BlockState blockState, BlockGetter p_52274_, BlockPos p_52275_) intprotected VoxelShapegetShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) getStateForAge(int pAge) voidgrowCrops(Level pLevel, BlockPos pPos, BlockState pState) static booleanhasSufficientLight(LevelReader pLevel, BlockPos pPos) booleanisBonemealSuccess(Level p_221045_, RandomSource p_221046_, BlockPos p_221047_, BlockState p_221048_) final booleanisMaxAge(BlockState pState) protected booleanisRandomlyTicking(BlockState pState) booleanisValidBonemealTarget(LevelReader p_255715_, BlockPos p_52259_, BlockState p_52260_) protected booleanmayPlaceOn(BlockState pState, BlockGetter pLevel, BlockPos pPos) voidperformBonemeal(ServerLevel p_221040_, RandomSource p_221041_, BlockPos p_221042_, BlockState p_221043_) protected voidrandomTick(BlockState p_221050_, ServerLevel p_221051_, BlockPos p_221052_, RandomSource p_221053_) Performs a random tick on a block.Methods inherited from class net.minecraft.world.level.block.VegetationBlock
isPathfindable, propagatesSkylightDown, updateShapeMethods inherited from class net.minecraft.world.level.block.Block
animateTick, asBlock, asItem, box, boxes, boxZ, boxZ, boxZ, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, column, column, cube, cube, defaultBlockState, destroy, dropFromBlockInteractLootTable, dropFromExplosion, dropFromLootTable, dropResources, dropResources, dropResources, fallOn, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getShapeForEachState, getSpeedFactor, getStateDefinition, getStateForPlacement, handlePrecipitation, hasDynamicShape, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityMovementAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
affectNeighborsAfterRemoval, attack, canBeReplaced, canBeReplaced, defaultDestroyTime, defaultMapColor, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDescriptionId, getDestroyProgress, getDirectSignal, getDrops, getEntityInsideCollisionShape, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isSignalSource, mirror, neighborChanged, onExplosionHit, onPlace, onProjectileHit, properties, propertiesCodec, requiredFeatures, rotate, shouldChangedStateKeepBlockEntity, simpleCodec, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusion, useWithoutItemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.block.BonemealableBlock
getParticlePos, getTypeMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, ignitedByLava, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, playFallSound, playStepSound, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
-
Field Details
-
CODEC
-
MAX_AGE
public static final int MAX_AGE- See Also:
-
AGE
-
SHAPES
-
-
Constructor Details
-
CropBlock
-
-
Method Details
-
codec
- Specified by:
codecin classVegetationBlock
-
getShape
protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) - Overrides:
getShapein classBlockBehaviour
-
mayPlaceOn
- Overrides:
mayPlaceOnin classVegetationBlock
-
getAgeProperty
-
getMaxAge
public int getMaxAge() -
getAge
-
getStateForAge
-
isMaxAge
-
isRandomlyTicking
- Overrides:
isRandomlyTickingin classBlockBehaviour
-
randomTick
protected void randomTick(BlockState p_221050_, ServerLevel p_221051_, BlockPos p_221052_, RandomSource p_221053_) Description copied from class:BlockBehaviourPerforms a random tick on a block.- Overrides:
randomTickin classBlockBehaviour
-
growCrops
-
getBonemealAgeIncrease
-
getGrowthSpeed
protected static float getGrowthSpeed(BlockState blockState, BlockGetter p_52274_, BlockPos p_52275_) -
canSurvive
- Overrides:
canSurvivein classVegetationBlock
-
hasSufficientLight
-
entityInside
protected void entityInside(BlockState p_52277_, Level p_52278_, BlockPos p_52279_, Entity p_52280_, InsideBlockEffectApplier p_405324_, boolean p_451780_) - Overrides:
entityInsidein classBlockBehaviour
-
getBaseSeedId
-
getCloneItemStack
protected ItemStack getCloneItemStack(LevelReader p_304482_, BlockPos p_52255_, BlockState p_52256_, boolean p_387989_) - Overrides:
getCloneItemStackin classBlockBehaviour
-
isValidBonemealTarget
- Specified by:
isValidBonemealTargetin interfaceBonemealableBlock
-
isBonemealSuccess
public boolean isBonemealSuccess(Level p_221045_, RandomSource p_221046_, BlockPos p_221047_, BlockState p_221048_) - Specified by:
isBonemealSuccessin interfaceBonemealableBlock
-
performBonemeal
public void performBonemeal(ServerLevel p_221040_, RandomSource p_221041_, BlockPos p_221042_, BlockState p_221043_) - Specified by:
performBonemealin interfaceBonemealableBlock
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinitionin classBlock
-