MinestomFluids is a simple library for Minestom, which adds fluid mechanics.
The maven repository is available on jitpack.
To use the library, add it as a dependency to your project.
Before using it, you should call MinestomFluids.init()
.
This will register the custom BlockPlacementRule
that allows the fluids to detect when a neighbour changes.
After you've initialized the extension, you can get an EventNode
containing listeners which provide fluid ticking using MinestomBlocks.events()
.
By adding this node as a child to any other node, you enable the fluids in that scope.
Example:
MinestomFluids.init();
MinecraftServer.getGlobalEventHandler().addChild(MinestomFluids.events());
MinestomFluids will call a WaterBlockBreakEvent
upon breaking a block, which can be cancelled to prevent the action.
You are welcome to open an issue or pull request.