Fabric Flux
No reviews yet
Simple energy API for Fabric mods
Features machines that produce and store energy or resources.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
Resources
External Links
About
Description
Warning: This mod is not part of Fabric. It is a 3rd party library that allows developers to create energy-based mods with Fabric.
Fabric Flux
Fabric Flux (in short FF) is a mod/library aiming to provide energy implementation to Fabric mods.
Battery
Try using this battery on entities.
How this works
There are two basic things to remember: Containers and Interfaces.
- Flux Container is an object that provides access to interfaces. Some containers may require some data for access. For example: Item will require ItemStack to provide an interface.
- Flux Interface is used to transfer energy from one container to another. Two interfaces are needed to complete an energy transfer.
Implementation tips for developers
- Every
Itemaccepting energy should implementIFluxContainerand always check ingetFluxForif object type isItemStack. Other object types are welcome. - Any
BlockEntitycan implement bothIFluxandIFluxContainer. If controller is implemented thengetFluxFormethod should always check if object type isDirection. Other object types are welcome. - If an interface simply does not accept input/output, it has to return
-1instead of energy amount (which won't be less than0). This should be checked before calculating energy. - DO NOT STORE Flux Interfaces, only containers. Some interfaces can be freshly created by a controller. There are some exceptions for items like (dis)charging a battery (
Itemhas to create a fresh interface because it can't be stored in an item stack). IFlux::toshould be used to transfer energy. This method can be overriden.FluxBatteryclass is provided in the API as a basic interface.
Energy API differences
FF differs a bit from Forge Energy API. This mod has less methods to implement and it is not capability-based (it uses containers instead). There are no canExtractEnergy/canReceiveEnergy counterparts, checking with extractFlux/receiveFlux(0, true) does the same, although this is not required.
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers
Statistics
Resources