Class FlowerPotBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.FlowerPotBlock
- All Implemented Interfaces:
FeatureElement, ItemLike, IBlockExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class Block
Block.UpdateFlagsNested classes/interfaces inherited from class BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.PostProcess, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable Supplier<FlowerPotBlock> private final BlockNeo: Field accesses are redirected togetPotted()with a coremod.private static final VoxelShapeFields inherited from class 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 BlockBehaviour
bounceRestitution, descriptionId, drops, dynamicShape, explosionResistance, fallDistanceReduction, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsConstructorDescriptionFlowerPotBlock(@Nullable Supplier<FlowerPotBlock> emptyPot, @Nullable Supplier<? extends Block> potted, BlockBehaviour.Properties properties) Neo: Constructs a flower pot with the given empty pot and potted flower/plant.FlowerPotBlock(Block potted, BlockBehaviour.Properties properties) Deprecated.Neo: Use the other constructors for empty pots and full pots.FlowerPotBlock(BlockBehaviour.Properties properties) Neo: Constructs an empty flower pot. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlant(Identifier flower, Supplier<? extends Block> fullPot) Deprecated, for removal: This API element is subject to removal in a future version.Neo: To be removed in 26.3.protected ItemStackgetCloneItemStack(LevelReader level, BlockPos pos, BlockState state, boolean includeData) getFullPot(Block plant) Neo: Returns the full pot associated with the given plant block, orBlocks.AIRif there is no associated full pot.Neo: Returns an unmodifiable view of the map of plant blocks to their associated full pot block.Map<Identifier, Supplier<? extends Block>> Deprecated, for removal: This API element is subject to removal in a future version.Neo: To be removed in 26.3.protected VoxelShapegetShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) private booleanisEmpty()protected booleanisPathfindable(BlockState state, PathComputationType type) protected booleanisRandomlyTicking(BlockState state) opposite(BlockState state) protected voidrandomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) protected BlockStateupdateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) protected InteractionResultuseItemOn(ItemStack itemStack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) protected InteractionResultuseWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) Methods inherited from class Block
animateTick, asBlock, asItem, bounceOn, box, boxes, boxZ, boxZ, boxZ, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, column, column, createBlockStateDefinition, cube, cube, defaultBlockState, destroy, dropFromBlockInteractLootTable, dropFromExplosion, dropFromLootTable, dropResources, dropResources, dropResources, fallOn, getBounceRestitution, getDrops, getDrops, getExplosionResistance, getFallDistanceReduction, 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, spawnDestroyByEntityParticles, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class BlockBehaviour
affectNeighborsAfterRemoval, attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDescriptionId, getDestroyProgress, getDirectSignal, getDrops, getEntityInsideCollisionShape, getFluidState, getInteractionShape, getLightDampening, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isSignalSource, mirror, neighborChanged, onExplosionHit, onPlace, onProjectileHit, ownSignal, propagatesSkylightDown, properties, requiredFeatures, rotate, shouldChangedStateKeepBlockEntity, shouldRedstoneWireConnectTo, showAsInteractableInSpectatorMode, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, useShapeForLightOcclusionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface FeatureElement
isEnabledMethods inherited from interface IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBlockPathType, getBounceRestitution, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRelocability, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, ignitedByLava, isBurning, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, playFallSound, playStepSound, rotate, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
-
Field Details
-
POTTED_BY_CONTENT
-
SHAPE
-
potted
Neo: Field accesses are redirected togetPotted()with a coremod. -
emptyPot
-
flowerDelegate
-
-
Constructor Details
-
FlowerPotBlock
Deprecated.Neo: Use the other constructors for empty pots and full pots. -
FlowerPotBlock
public FlowerPotBlock(@Nullable Supplier<FlowerPotBlock> emptyPot, @Nullable Supplier<? extends Block> potted, BlockBehaviour.Properties properties) Neo: Constructs a flower pot with the given empty pot and potted flower/plant. For mod use, eliminates the need to extend this class, and prevents modded flower pots from altering vanilla behavior.
Use the other constructor for constructing empty pots.
- Parameters:
emptyPot- The empty pot for this potpotted- The potted flower/plant
-
FlowerPotBlock
Neo: Constructs an empty flower pot.
-
-
Method Details
-
getShape
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) - Overrides:
getShapein classBlockBehaviour
-
useItemOn
protected InteractionResult useItemOn(ItemStack itemStack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) - Overrides:
useItemOnin classBlockBehaviour
-
useWithoutItem
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) - Overrides:
useWithoutItemin classBlockBehaviour
-
getCloneItemStack
protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state, boolean includeData) - Overrides:
getCloneItemStackin classBlockBehaviour
-
isEmpty
private boolean isEmpty() -
updateShape
protected BlockState updateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) - Overrides:
updateShapein classBlockBehaviour
-
getPotted
-
isPathfindable
- Overrides:
isPathfindablein classBlockBehaviour
-
getEmptyPot
-
getFullPots
Neo: Returns an unmodifiable view of the map of plant blocks to their associated full pot block.- Returns:
- an unmodifiable view of the map of plant blocks to their associated full pot block
- Throws:
IllegalStateException- if this is called on a non-empty pot
-
getFullPot
Neo: Returns the full pot associated with the given plant block, orBlocks.AIRif there is no associated full pot.- Parameters:
plant- the plant block- Returns:
- the full pot associated with the given plant block, or
Blocks.AIRif there is no associated full pot - Throws:
IllegalStateException- if this is called on a non-empty pot
-
addPlant
@Deprecated(forRemoval=true, since="26.2") public void addPlant(Identifier flower, Supplier<? extends Block> fullPot) Deprecated, for removal: This API element is subject to removal in a future version.Neo: To be removed in 26.3. Full pots are automatically added to the maps of their respective empty pots. This does not support adding arbitrary blocks as 'full pots'. If you use this feature, please raise this in the NeoForge issue tracker. -
getFullPotsView
@Deprecated(forRemoval=true, since="26.2") public Map<Identifier, Supplier<? extends Block>> getFullPotsView()Deprecated, for removal: This API element is subject to removal in a future version.Neo: To be removed in 26.3. UsegetFullPots()instead. -
isRandomlyTicking
- Overrides:
isRandomlyTickingin classBlockBehaviour
-
randomTick
- Overrides:
randomTickin classBlockBehaviour
-
opposite
-