Skip to content
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

Rework Metafluids #542

Merged
merged 25 commits into from
Feb 21, 2022
Merged

Rework Metafluids #542

merged 25 commits into from
Feb 21, 2022

Conversation

TechLord22
Copy link
Member

What:
This PR Reworks the MetaFluids class and everything associated with it. It primarily moves the class to API, where it should be from the beginning.

It then removes the concept of FluidState, merging it with FluidType. FluidType is now not a subclass of MetaFluids, and is also no longer an Enum for materials. It is used to make fluids from materials have more unique properties in a cleaner fashion.

MaterialFluid was also pulled out of MetaFluids, allowing better access to it. It should allow us to add more properties to GregTech fluids in the future if desired.

Outcome:
Reworked MetaFluids

Additional info:
The way things are currently done for existing fluid properties will cause no missing fluid entries in existing worlds.

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getMaterialTooltip tooltip function in FluidTooltipUtil needs to be updated for the new states

Water and Lava materials need to have FluidTypes assigned to them in their creation.

Something has broken tooltips in this PR, such that the mod name is no longer showing in tooltips. It might be one of the above comments

In addition, I received these warnings in the log, and fluids that were in machines before switching to this PR were removed upon load into the world https://pastebin.com/PkTy6bHr

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still issues with some fluids getting the incorrect fluid names:

[13:12:28] [Server thread/ERROR] [FML]: The fluid plasma.nitrogen (specified as gregtech:plasma.nitrogen) is missing from this instance - it will be removed
[13:12:28] [Server thread/ERROR] [FML]: The fluid plasma.oxygen (specified as gregtech:plasma.oxygen) is missing from this instance - it will be removed
[13:12:28] [Server thread/ERROR] [FML]: The fluid plasma.argon (specified as gregtech:plasma.argon) is missing from this instance - it will be removed
[13:12:28] [Server thread/ERROR] [FML]: The fluid plasma.iron (specified as gregtech:plasma.iron) is missing from this instance - it will be removed
[13:12:28] [Server thread/ERROR] [FML]: The fluid plasma.helium (specified as gregtech:plasma.helium) is missing from this instance - it will be removed
[13:12:28] [Server thread/ERROR] [FML]: The fluid plasma.nickel (specified as gregtech:plasma.nickel) is missing from this instance - it will be removed

@ALongStringOfNumbers
Copy link
Contributor

Crash when testing this PR when I moused over the water or distilled water fluid tile in JEI https://pastebin.com/n17munkB

The length of the tooltip for the fluid still needs to be checked, as there are some materials that do not have a chemical formula

@Rongmario
Copy link
Contributor

Checks are failing, rip

@ALongStringOfNumbers
Copy link
Contributor

ALongStringOfNumbers commented Feb 11, 2022

Hm, seems to be something slightly wrong. Before this PR, the Lava tile in JEI had the Temperature and State shown, with this PR nothing is shown.

Similarly, the Water tile in JEI showed the formula, temperature, and state, and now only shows the formula.

This is probably because they are not being added in MetaFluids#handleVanillaFluids()

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of how the tests were fixed, but everything else looks good to me

@Rongmario
Copy link
Contributor

#649 should provide a more practical fix for I18n related tests failing

@ALongStringOfNumbers ALongStringOfNumbers added the status: high priority Issue or PR should be prioritized for reviews label Feb 17, 2022
src/main/java/gregtech/api/fluids/MetaFluids.java Outdated Show resolved Hide resolved
src/main/java/gregtech/api/fluids/MetaFluids.java Outdated Show resolved Hide resolved
src/main/java/gregtech/api/fluids/MetaFluids.java Outdated Show resolved Hide resolved
src/main/java/gregtech/api/fluids/MetaFluids.java Outdated Show resolved Hide resolved
src/main/java/gregtech/api/fluids/MetaFluids.java Outdated Show resolved Hide resolved
src/main/java/gregtech/api/fluids/fluidType/FluidType.java Outdated Show resolved Hide resolved
@TechLord22 TechLord22 requested a review from Rongmario February 20, 2022 03:09
@TechLord22 TechLord22 merged commit f1b6868 into master Feb 21, 2022
@TechLord22 TechLord22 deleted the metafluids branch February 21, 2022 18:40
ChromaPIE added a commit to ChromaPIE/GregTech that referenced this pull request Feb 22, 2022
* Grab default meta when meta exceeds allowed values for meta blocks (GregTechCEu#621)

- Prevents world corrupting crash

* Logic hacking for certain contexts to abide to the correct StoneType (GregTechCEu#638)

* Rework Metafluids (GregTechCEu#542)

* rework metafluids

* add acid type to acids

* improve ct fluid validation

* material getter

* some ct support

* fluid state tooltip for each FluidType

* requested changes

* fix wrong fluid names

* fix FluidTooltipUtil method

* fix all fluid tooltips

* UU matter tooltip

* explicitly block plasmas in the fluid CT method

* fix plasma unlocalized names

* make fluid tooltips smart

* fix custom acid material textures

* fix vanilla fluid tooltips

* fix failing tests

* fix tooltip and ct error logging

* undo test "fix"

* more review comments

* change maps

* stop using lowercase

* use computeIfAbsent

* fix empty tooltips on items

* stop trying to register all fluids twice and fix temperatures

* Minor recipe and formula fixes (GregTechCEu#624)

* dimethylbenzene and 3,3-dichlorobenzidine ratio fixes

* fix IV Coil voltage

* disable Nitrobenzene decomposition to prevent dupes

* fix Butene formula

* fix Ethenone and Methyl Acetate formula

* fix Vinyl Acetate formula

* fix Monochloramine and Allyl Chloride formula

* fix Allyl Chloride properties

* Make sugar C6H12O6, like an actual carbohydrate

* fix Liquid Air formula

Co-authored-by: bruberu <[email protected]>

* Fix `drawFluidForGui` drawing incorrectly for some mods

* Fix fluid prospector crash on servers (GregTechCEu#676)

* fix problems with chanced outputs in jei (GregTechCEu#675)

* Maintenance fix (GregTechCEu#677)

* Fix muffler particles having little pos variation

* Polycaprolactam processing revamp (GregTechCEu#600)

* Polycaprolactam chain

* Use Blast Furnace instead

* Address review comments

* Fix problems (again)

* Update and use FluidTypes

* Third time's the charm?

* Change which event blocks were created in (GregTechCEu#535)

* Allow Robot Arms to Supply Exact more than 1 stack (GregTechCEu#635)

* Don't tick the preview world from updateFormedValid (GregTechCEu#608)

* UTF-8 (GregTechCEu#678)

Co-authored-by: Rongmario <[email protected]>
Co-authored-by: TechLord22 <[email protected]>
Co-authored-by: m2r1k5 <[email protected]>
Co-authored-by: bruberu <[email protected]>
Co-authored-by: DStrand1 <[email protected]>
Co-authored-by: Syrcan <[email protected]>
Co-authored-by: ALongStringOfNumbers <[email protected]>
Co-authored-by: KilaBash <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: high priority Issue or PR should be prioritized for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants