GregTech CE Unofficial

GregTech CE Unofficial

412k Downloads

Fluid Builder Groovyscript compatibility, and issues with it

Nrmot opened this issue ยท 2 comments

commented

MAIN THING: the fluid system has been rewritten which broke a lot of scripts for many modpacks.

GregTech CEu Version

GTCEu 2.8

Related Problem

Issue 1

This happens when trying to modify a material from CEu source code, ie adding a liquid property

[16:17:04] [Client thread/FATAL] [FML]: The fluid registry is corrupted. Something has inserted a fluid without registering it
[16:17:04] [Client thread/FATAL] [FML]: There is 25 unregistered fluids
[16:17:04] [Client thread/FATAL] [FML]:   Fluid name : antimony, type: gregtech.api.fluids.GTFluid$GTMaterialFluid

Issue 2: Null fluid crash

java.lang.IllegalArgumentException: Cannot create a fluidstack from a null fluid
	at net.minecraftforge.fluids.FluidStack.<init>(FluidStack.java:49)
	at gregtech.api.unification.material.Material.getFluid(Material.java:241)
	at gregtech.loaders.recipe.RecyclingRecipes.registerExtractorRecycling(RecyclingRecipes.java:148)
	at gregtech.loaders.recipe.RecyclingRecipes.registerRecyclingRecipes(RecyclingRecipes.java:81)
	at gregtech.loaders.recipe.handlers.RecyclingRecipeHandler.processCrushing(RecyclingRecipeHandler.java:57)
	at gregtech.api.unification.ore.OrePrefix.lambda$addProcessingHandler$31(OrePrefix.java:597)
	at gregtech.api.unification.ore.OrePrefix.runGeneratedMaterialHandlers(OrePrefix.java:631)
	at gregtech.api.unification.ore.OrePrefix.runMaterialHandlers(OrePrefix.java:611)
	at gregtech.common.CommonProxy.runEarlyMaterialHandlers(CommonProxy.java:329)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_28_CommonProxy_runEarlyMaterialHandlers_Register.invoke(.dynamic)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
	at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144)
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:859)
	at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:636)
	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:747)
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336)
	at net.minecraft.client.Minecraft.init(Minecraft.java:582)
	at net.minecraft.client.Minecraft.run(Minecraft.java:422)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:165)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:29)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:87)
	at GradleStart.main(GradleStart.java:19)

Issue 3: Old ways of registering has been broken

groovy.lang.MissingMethodException: No signature of method: gregtech.api.unification.material.Material$Builder.fluidTemp() is applicable for argument types: (Integer) values: [50000]
Possible solutions: blastTemp(int), fluid(), blastTemp(int, java.lang.String), blastTemp(int, gregtech.api.unification.material.properties.BlastProperty$GasTier)

Your Solution

The proposal is to make Groovyscript compatibility for #2081

Or add backwards compatibility with the old way of registering fluids

Additional Information

the old ways to register fluids no longer work:
.fluid()
.gas()
.plasma()

commented

This is not just in GroovyScript, GTCEu crashes when addons use .fluid(), .gas(), .plasma(), and maybe .liquid()?

commented

Fixed by combination of #2203, #2212, #2215, #2216, #2222