diff --git a/src/main/java/com/zorbatron/zbgt/api/unification/material/ZBGTMaterials.java b/src/main/java/com/zorbatron/zbgt/api/unification/material/ZBGTMaterials.java index 663ec2f4..2672379f 100644 --- a/src/main/java/com/zorbatron/zbgt/api/unification/material/ZBGTMaterials.java +++ b/src/main/java/com/zorbatron/zbgt/api/unification/material/ZBGTMaterials.java @@ -12,7 +12,6 @@ public final class ZBGTMaterials { // Elements public static Material Adamantium; - public static Material LiquidNitrogen; public static Material Quantium; // First degree materials @@ -71,8 +70,14 @@ public static void init() { ZBGTSecondDegreeMaterials.register(); ZBGTThirdDegreeMaterials.register(); ZBGTUnknownCompositionMaterials.register(); + } + + public static void initChanges() { + ZBGTMaterialExtraProperties.init(); + ZBGTMaterialExtraFlags.init(); + } - ZBGTMaterialExtraProperties.register(); - ZBGTMaterialExtraFlags.register(); + public static void initLateChanges() { + ZBGTMaterialExtraProperties.initLate(); } } diff --git a/src/main/java/com/zorbatron/zbgt/api/unification/material/materials/ZBGTElementMaterials.java b/src/main/java/com/zorbatron/zbgt/api/unification/material/materials/ZBGTElementMaterials.java index 584fd8ce..f07b609d 100644 --- a/src/main/java/com/zorbatron/zbgt/api/unification/material/materials/ZBGTElementMaterials.java +++ b/src/main/java/com/zorbatron/zbgt/api/unification/material/materials/ZBGTElementMaterials.java @@ -5,8 +5,6 @@ import static com.zorbatron.zbgt.api.unification.material.ZBGTMaterials.*; import static com.zorbatron.zbgt.api.util.ZBGTUtility.zbgtId; -import gregtech.api.fluids.FluidBuilder; -import gregtech.api.unification.Elements; import gregtech.api.unification.material.Material; import gregtech.api.unification.material.info.MaterialIconSet; @@ -21,12 +19,6 @@ public static void register() { .element(Ad) .build(); - LiquidNitrogen = new Material.Builder(id++, zbgtId("zb_liquid_nitrogen")) - .liquid(new FluidBuilder().temperature(77)) - .color(0xE1FAFA) - .element(Elements.N) - .build(); - Quantium = new Material.Builder(id++, zbgtId("quantium")) .dust().ore(true) .color(0x00d10b).iconSet(MaterialIconSet.SHINY) diff --git a/src/main/java/com/zorbatron/zbgt/api/unification/material/modifications/ZBGTMaterialExtraFlags.java b/src/main/java/com/zorbatron/zbgt/api/unification/material/modifications/ZBGTMaterialExtraFlags.java index 86e65788..9f12cb3f 100644 --- a/src/main/java/com/zorbatron/zbgt/api/unification/material/modifications/ZBGTMaterialExtraFlags.java +++ b/src/main/java/com/zorbatron/zbgt/api/unification/material/modifications/ZBGTMaterialExtraFlags.java @@ -29,7 +29,7 @@ public static void setFlags(List materials, MaterialFlag... flags) { } } - public static void register() { + public static void init() { doublePlates(); densePlates(); screwsBolts(); diff --git a/src/main/java/com/zorbatron/zbgt/api/unification/material/modifications/ZBGTMaterialExtraProperties.java b/src/main/java/com/zorbatron/zbgt/api/unification/material/modifications/ZBGTMaterialExtraProperties.java index b1cbc773..2d9ca244 100644 --- a/src/main/java/com/zorbatron/zbgt/api/unification/material/modifications/ZBGTMaterialExtraProperties.java +++ b/src/main/java/com/zorbatron/zbgt/api/unification/material/modifications/ZBGTMaterialExtraProperties.java @@ -22,7 +22,7 @@ public final class ZBGTMaterialExtraProperties { - public static void register() { + public static void init() { ingots(); fluids(); wires(); @@ -30,6 +30,17 @@ public static void register() { ores(); } + public static void initLate() { + if (Nitrogen.getProperty(PropertyKey.FLUID).get(FluidStorageKeys.LIQUID) == null) { + Nitrogen.getProperty(PropertyKey.FLUID).enqueueRegistration(FluidStorageKeys.LIQUID, + new FluidBuilder() + .temperature(77) + .color(0x008D8F) + .name("liquid_nitrogen") + .translation("gregtech.fluid.liquid_generic")); + } + } + private static void ingots() { Material[] materials = { Cerium }; diff --git a/src/main/java/com/zorbatron/zbgt/common/CommonProxy.java b/src/main/java/com/zorbatron/zbgt/common/CommonProxy.java index d368b21c..9d93a876 100644 --- a/src/main/java/com/zorbatron/zbgt/common/CommonProxy.java +++ b/src/main/java/com/zorbatron/zbgt/common/CommonProxy.java @@ -14,6 +14,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fml.client.event.ConfigChangedEvent; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.registries.IForgeRegistry; @@ -37,6 +38,7 @@ import gregtech.api.cover.CoverDefinition; import gregtech.api.unification.material.event.MaterialEvent; import gregtech.api.unification.material.event.MaterialRegistryEvent; +import gregtech.api.unification.material.event.PostMaterialEvent; import gregtech.api.util.Mods; @Mod.EventBusSubscriber(modid = ZBGTCore.MODID) @@ -101,10 +103,22 @@ public static void registerItems(RegistryEvent.Register event) { @SubscribeEvent public static void registerMaterials(MaterialEvent event) { - ZBGTLog.logger.info("Registering materials and material modifications..."); + ZBGTLog.logger.info("Registering materials"); ZBGTMaterials.init(); } + @SubscribeEvent + public static void materialChanges(PostMaterialEvent event) { + ZBGTLog.logger.info("Registering material modifications..."); + ZBGTMaterials.initChanges(); + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public static void lateMaterialChanges(PostMaterialEvent event) { + ZBGTLog.logger.info("Registering late material modifications..."); + ZBGTMaterials.initLateChanges(); + } + @SubscribeEvent public static void createMaterialRegistry(MaterialRegistryEvent event) { GregTechAPI.materialManager.createRegistry(ZBGTCore.MODID); diff --git a/src/main/java/com/zorbatron/zbgt/mixin/WorldGenRegistryMixin.java b/src/main/java/com/zorbatron/zbgt/mixin/WorldGenRegistryMixin.java index 64cb8439..3028629c 100644 --- a/src/main/java/com/zorbatron/zbgt/mixin/WorldGenRegistryMixin.java +++ b/src/main/java/com/zorbatron/zbgt/mixin/WorldGenRegistryMixin.java @@ -39,7 +39,7 @@ private static void addAddonFiles(Path root, @No root.resolve(FileUtility.slashToNativeSep(definition.getDepositName()))); if (element == null) { - GTLog.logger.error("Addon mod tried to register bad ore definition at {}", + GTLog.logger.error("Addon mod tried to init bad ore definition at {}", definition.getDepositName()); itemsToRemove.add(definition); continue; @@ -55,7 +55,7 @@ private static void addAddonFiles(Path root, @No root.resolve(FileUtility.slashToNativeSep(definition.getDepositName()))); if (element == null) { - GTLog.logger.error("Addon mod tried to register bad ore definition at {}", + GTLog.logger.error("Addon mod tried to init bad ore definition at {}", definition.getDepositName()); itemsToRemove.add(definition); continue; diff --git a/src/main/java/com/zorbatron/zbgt/recipe/MaterialRecipes.java b/src/main/java/com/zorbatron/zbgt/recipe/MaterialRecipes.java index 19f7e987..9757ef2e 100644 --- a/src/main/java/com/zorbatron/zbgt/recipe/MaterialRecipes.java +++ b/src/main/java/com/zorbatron/zbgt/recipe/MaterialRecipes.java @@ -15,6 +15,7 @@ import com.zorbatron.zbgt.api.ZBGTAPI; import com.zorbatron.zbgt.api.util.ZBGTMods; +import gregtech.api.fluids.store.FluidStorageKeys; import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.builders.BlastRecipeBuilder; import gregtech.api.recipes.builders.SimpleRecipeBuilder; @@ -60,7 +61,7 @@ private static void chemicalReactor() { private static void vacuumFreezer() { VACUUM_RECIPES.recipeBuilder() .fluidInputs(Nitrogen.getFluid(1000)) - .fluidOutputs(LiquidNitrogen.getFluid(1000)) + .fluidOutputs(Nitrogen.getFluid(FluidStorageKeys.LIQUID, 1000)) .EUt(VA[HV]).duration(15) .buildAndRegister(); @@ -311,7 +312,7 @@ private static void ebf() { .buildAndRegister(); RecipeBuilder aluminumNitrideBuilder = BLAST_RECIPES.recipeBuilder() - .fluidInputs(LiquidNitrogen.getFluid(2000)) + .fluidInputs(Nitrogen.getFluid(FluidStorageKeys.LIQUID, 2000)) .output(dust, AluminumNitride, 2) .fluidOutputs(CarbonMonoxide.getFluid(3000)) .EUt(VA[EV]).duration(20 * 10)