-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move from LDLib's FluidStack implementation to Forge's FluidStack #1975
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna do the rest in intellij github's UI isn't happy rn
src/main/java/com/gregtechceu/gtceu/api/capability/IThermalFluidHandlerItemStack.java
Show resolved
Hide resolved
...in/java/com/gregtechceu/gtceu/api/data/chemical/material/properties/FluidPipeProperties.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/gui/widget/ScrollablePhantomFluidWidget.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/machine/steam/SimpleSteamMachine.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/list/AEFluidDisplayWidget.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/widget/list/AEFluidDisplayWidget.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/syncdata/FluidStackLoad.java
Outdated
Show resolved
Hide resolved
conflicts |
Last commit is the only new content. Rebased and resolved conflicts because things were getting a little out of hand. |
Adds classes in /api/misc/lib/ which are Forge FluidStack compatible stand-ins for LDLib's versions Creates a Payload for Forge FluidStacks and registers them with LDLib Adds a mixin for LDLib to allow for FluidStack syncing
Rewrites these classes to use Forge's native IFLuidHandler rather than LDLib's IFluidTransfer
Switches from hardcoded logic to using Forge's FluidUtil to add cleanliness
Now passes the interaction for drums and tanks if the held item isn't a fluidhandler Also cleaned up the CreativeTankMachine to more properly make use of being a subclass Implemented CreativeTankMachine right-click behavior
Removed any unnecessary BUCKET_VOLUME uses Moved new classes to appropriate packages Renamed Fluid classes to use Handler rather than Transfer
Also clean up some lingering references
This causes issues with loading certain machines:
I don't know how much this actually affects (as none of my tanks emptied) but a few of my fluid pipes spontaneously disconnected. |
Ready for merge after one last review. Will almost certainly break addons. |
merge #1945 first |
What
This PR moves the codebase off of LDLib's FluidStack implementation and onto Forge's native FluidStack implementation.
This includes switching from LDLib's IFluidTransfer to Forge's IFluidHandler. The behavior between the two is extremely similar, and this change will allow for better maintainability and better understanding of the depended-upon implementation, as Forge is very well documented.
Implementation Details
I have added a couple new methods to
GTUtils
which I use sporadically, please see them here so you don't have to go flopping around trying to find what a certain utility method will do.I also make very good use of Forge's
FluidUtil
class, which has many helper methods similar to LDLib's. See the docs for those here or check the implementation in your own IDE atnet.minecraftforge.fluids.FluidUtil.java
Potential Compatibility Issues
Forge's FluidStacks are limited to integer amounts, rather than the long-based FluidStacks from LDLib. This could potentially cause issues in certain cases, specifically during interactions with AE2.
Further testing is required for this, however. From what I can tell, it would only affect people who attempt to use more than 2.147 million buckets in an ME hatch or an ME Pattern Buffer.
If this is a cause for concern, please let me know.
If I have missed ANYTHING or if there are ANY questions please let me know.
The first commit
4ef64c9
are fairly simple switches and don't necessarily need the most attention. Please look over the other four commits well. Thanks.