Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TogAr2/MinestomFluids
Fluid/liquid library for Minestom
https://github.com/TogAr2/MinestomFluids
minestom minestom-library
Last synced: 3 days ago
JSON representation
Fluid/liquid library for Minestom
- Host: GitHub
- URL: https://github.com/TogAr2/MinestomFluids
- Owner: TogAr2
- License: mit
- Created: 2022-08-22T17:43:48.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-04T12:56:31.000Z (almost 2 years ago)
- Last Synced: 2024-08-04T00:13:02.259Z (3 months ago)
- Topics: minestom, minestom-library
- Language: Java
- Homepage:
- Size: 89.8 KB
- Stars: 15
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-minestom - MinestomFluids - Fluid handling and implementation. (Extensions)
README
# MinestomFluids
[![license](https://img.shields.io/github/license/TogAr2/MinestomFluids.svg?style=flat-square)](LICENSE)
[![platform](https://img.shields.io/badge/platform-Minestom-ff69b4?style=flat-square)](https://github.com/Minestom/Minestom)MinestomFluids is a simple library for Minestom, which adds fluid mechanics.
The maven repository is available on [jitpack](https://jitpack.io/#TogAr2/MinestomFluids).
## Usage
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:
```java
MinestomFluids.init();
MinecraftServer.getGlobalEventHandler().addChild(MinestomFluids.events());
```MinestomFluids will call a `WaterBlockBreakEvent` upon breaking a block, which can be cancelled to prevent the action.
## Contributing
You are welcome to open an issue or pull request.