Class RegisterCauldronFluidContentEvent
- All Implemented Interfaces:
IModBusEvent
CauldronFluidContent for modded cauldrons.
Registering cauldrons is done by calling CauldronFluidContent.register(net.minecraft.world.level.block.Block, net.minecraft.world.level.material.Fluid, int, net.minecraft.world.level.block.state.properties.IntegerProperty)
and allows all cauldrons registered in this way to interoperate with each other
when accessed via the
invalid reference
Capabilities.FluidHandler#BLOCK
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidregister(Block block, Fluid fluid, int totalAmount, @Nullable IntegerProperty levelProperty) Register a new cauldron, allowing it to be filled and emptied through the standard capability.
-
Constructor Details
-
RegisterCauldronFluidContentEvent
RegisterCauldronFluidContentEvent()
-
-
Method Details
-
register
public void register(Block block, Fluid fluid, int totalAmount, @Nullable IntegerProperty levelProperty) Register a new cauldron, allowing it to be filled and emptied through the standard capability. In both cases, return the content of the cauldron, either the existing one, or the newly registered one.If the block is not a subclass of
AbstractCauldronBlock,BlockBehaviour.onPlace(BlockState, Level, BlockPos, BlockState, boolean)andmust be overridden to invalidate capabilities when the block changes! See how NeoForge patchesinvalid reference
BlockBehaviour#onRemove(BlockState, Level, BlockPos, BlockState, boolean)AbstractCauldronBlockfor reference.- Parameters:
block- the block of the cauldronfluid- the fluid stored in this cauldrontotalAmount- how much fluid can fit in the cauldron at maximum capacity, in millibucketslevelProperty- the property used by the cauldron to store its levels, ornullif the cauldron only has one level
-