-
Notifications
You must be signed in to change notification settings - Fork 158
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
Open
krossgg
wants to merge
11
commits into
GregTechCEu:1.20.1
Choose a base branch
from
krossgg:ldlib-dump
base: 1.20.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
screret
requested changes
Sep 18, 2024
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
screret
requested changes
Sep 19, 2024
...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
screret
approved these changes
Sep 20, 2024
conflicts |
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
Last commit is the only new content. Rebased and resolved conflicts because things were getting a little out of hand. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.