Package net.minecraft.world.level.block
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 net.minecraft.world.level.block.Block
Block.ShapePairKey
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<FlowerPotBlock> private final Supplier
<FlowerPotBlock> private final Map
<ResourceLocation, Supplier<? extends Block>> private final Block
Neo: Field accesses are redirected togetPotted()
with a coremod.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_SKIP_ALL_SIDEEFFECTS, UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS, UPDATE_SKIP_ON_PLACE, UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE, UPDATE_SUPPRESS_DROPS
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
descriptionId, 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
ConstructorsConstructorDescriptionFlowerPotBlock
(Supplier<FlowerPotBlock> emptyPot, Supplier<? extends Block> p_53528_, BlockBehaviour.Properties properties) For mod use, eliminates the need to extend this class, and prevents modded flower pots from altering vanilla behavior.FlowerPotBlock
(Block p_53528_, BlockBehaviour.Properties p_53529_) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlant
(ResourceLocation flower, Supplier<? extends Block> fullPot) Maps the given flower to the filled pot it is for.com.mojang.serialization.MapCodec
<FlowerPotBlock> codec()
protected ItemStack
getCloneItemStack
(LevelReader p_304505_, BlockPos p_53532_, BlockState p_53533_, boolean p_388306_) Map
<ResourceLocation, Supplier<? extends Block>> Returns all the filled pots that can be spawned from filling this pot.protected VoxelShape
getShape
(BlockState p_53556_, BlockGetter p_53557_, BlockPos p_53558_, CollisionContext p_53559_) private boolean
isEmpty()
protected boolean
isPathfindable
(BlockState p_53535_, PathComputationType p_53538_) protected boolean
isRandomlyTicking
(BlockState p_383068_) opposite
(BlockState p_383006_) protected void
randomTick
(BlockState p_382880_, ServerLevel p_383169_, BlockPos p_382955_, RandomSource p_383144_) protected BlockState
updateShape
(BlockState p_53547_, LevelReader p_374311_, ScheduledTickAccess p_374506_, BlockPos p_53551_, Direction p_53548_, BlockPos p_53552_, BlockState p_53549_, RandomSource p_374435_) protected InteractionResult
useItemOn
(ItemStack p_316610_, BlockState p_316240_, Level p_316456_, BlockPos p_316502_, Player p_316491_, InteractionHand p_316444_, BlockHitResult p_316826_) protected InteractionResult
useWithoutItem
(BlockState p_316363_, Level p_316655_, BlockPos p_316654_, Player p_316338_, BlockHitResult p_316518_) Methods inherited from class net.minecraft.world.level.block.Block
animateTick, asBlock, asItem, box, boxes, boxZ, boxZ, boxZ, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, column, column, createBlockStateDefinition, cube, cube, defaultBlockState, destroy, dropFromExplosion, 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, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
affectNeighborsAfterRemoval, attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, 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, propagatesSkylightDown, properties, propertiesCodec, requiredFeatures, rotate, simpleCodec, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, useShapeForLightOcclusion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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, 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, 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
-
POTTED_BY_CONTENT
-
SHAPE
-
potted
Neo: Field accesses are redirected togetPotted()
with a coremod. -
fullPots
-
emptyPot
-
flowerDelegate
-
-
Constructor Details
-
FlowerPotBlock
Deprecated. -
FlowerPotBlock
public FlowerPotBlock(@Nullable Supplier<FlowerPotBlock> emptyPot, Supplier<? extends Block> p_53528_, BlockBehaviour.Properties properties) For mod use, eliminates the need to extend this class, and prevents modded flower pots from altering vanilla behavior.- Parameters:
emptyPot
- The empty pot for this pot, or null for self.
-
-
Method Details
-
codec
-
getShape
protected VoxelShape getShape(BlockState p_53556_, BlockGetter p_53557_, BlockPos p_53558_, CollisionContext p_53559_) - Overrides:
getShape
in classBlockBehaviour
-
useItemOn
protected InteractionResult useItemOn(ItemStack p_316610_, BlockState p_316240_, Level p_316456_, BlockPos p_316502_, Player p_316491_, InteractionHand p_316444_, BlockHitResult p_316826_) - Overrides:
useItemOn
in classBlockBehaviour
-
useWithoutItem
protected InteractionResult useWithoutItem(BlockState p_316363_, Level p_316655_, BlockPos p_316654_, Player p_316338_, BlockHitResult p_316518_) - Overrides:
useWithoutItem
in classBlockBehaviour
-
getCloneItemStack
protected ItemStack getCloneItemStack(LevelReader p_304505_, BlockPos p_53532_, BlockState p_53533_, boolean p_388306_) - Overrides:
getCloneItemStack
in classBlockBehaviour
-
isEmpty
private boolean isEmpty() -
updateShape
protected BlockState updateShape(BlockState p_53547_, LevelReader p_374311_, ScheduledTickAccess p_374506_, BlockPos p_53551_, Direction p_53548_, BlockPos p_53552_, BlockState p_53549_, RandomSource p_374435_) - Overrides:
updateShape
in classBlockBehaviour
-
getPotted
-
isPathfindable
- Overrides:
isPathfindable
in classBlockBehaviour
-
getEmptyPot
-
addPlant
Maps the given flower to the filled pot it is for. Call this on the empty pot block. Attempting to call this on a filled pot will throw an exception.- Parameters:
flower
- The ResourceLocation of the flower block. Not flower itemfullPot
- The filled flower pot to map the flower block to
-
getFullPotsView
Returns all the filled pots that can be spawned from filling this pot. (If this pot is filled, returned map will be empty) -
isRandomlyTicking
- Overrides:
isRandomlyTicking
in classBlockBehaviour
-
randomTick
protected void randomTick(BlockState p_382880_, ServerLevel p_383169_, BlockPos p_382955_, RandomSource p_383144_) - Overrides:
randomTick
in classBlockBehaviour
-
opposite
-