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 (in short FF) is a mod/library aiming to provide energy implementation to Fabric mods.
Try using this battery on entities.
There are two basic things to remember: Containers and Interfaces.
Item accepting energy should implement IFluxContainer and always check in getFluxFor if object type is ItemStack. Other object types are welcome.BlockEntity can implement both IFlux and IFluxContainer. If controller is implemented then getFluxFor method should always check if object type is Direction. Other object types are welcome.-1 instead of energy amount (which won't be less than 0). This should be checked before calculating energy.Item has to create a fresh interface because it can't be stored in an item stack).IFlux::to should be used to transfer energy. This method can be overriden.FluxBattery class is provided in the API as a basic interface.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.
No files available for download.