From 51d7c88e8a6241c962c3a94c5de260593501860a Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Thu, 14 Sep 2023 22:55:48 -0400 Subject: [PATCH] made gt salt water get tfc salt water when tfc is loaded --- .../integration/forge/tfc/TFCRegistrar.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/forge/src/main/java/muramasa/gregtech/integration/forge/tfc/TFCRegistrar.java b/forge/src/main/java/muramasa/gregtech/integration/forge/tfc/TFCRegistrar.java index 3ff00b5e3..a8167d342 100644 --- a/forge/src/main/java/muramasa/gregtech/integration/forge/tfc/TFCRegistrar.java +++ b/forge/src/main/java/muramasa/gregtech/integration/forge/tfc/TFCRegistrar.java @@ -1,13 +1,16 @@ package muramasa.gregtech.integration.forge.tfc; import muramasa.antimatter.AntimatterAPI; +import muramasa.antimatter.data.AntimatterMaterialTypes; import muramasa.antimatter.datagen.AntimatterDynamics; import muramasa.antimatter.datagen.providers.AntimatterBlockTagProvider; import muramasa.antimatter.datagen.providers.AntimatterFluidTagProvider; import muramasa.antimatter.datagen.providers.AntimatterItemTagProvider; import muramasa.antimatter.event.forge.AntimatterLoaderEvent; import muramasa.antimatter.event.forge.AntimatterProvidersEvent; +import muramasa.antimatter.fluid.AntimatterFluid; import muramasa.antimatter.material.Material; +import muramasa.antimatter.material.MaterialTypeFluid; import muramasa.antimatter.ore.StoneType; import muramasa.antimatter.recipe.loader.IRecipeRegistrate; import muramasa.antimatter.registration.IAntimatterRegistrar; @@ -30,9 +33,11 @@ import net.dries007.tfc.util.Helpers; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.material.Fluids; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import tesseract.FluidPlatformUtils; import java.util.function.BiConsumer; @@ -73,6 +78,15 @@ public void onRegistrationEvent(RegistrationEvent event, Side side) { AntimatterAPI.register(StoneType.class, new StoneType(GTIRef.ID, sand.name().toLowerCase() + "_raw_sandstone", Material.NULL, new Texture("tfc", "block/sandstone/bottom/" + sand.name().toLowerCase()), SoundType.SAND, false).setStateSupplier(() -> AntimatterPlatformUtils.getBlockFromId("tfc", "raw_sandstone/" + sand.name().toLowerCase()).defaultBlockState())); return true; }); + AntimatterMaterialTypes.LIQUID.set((m, i) -> { + if (m == null || !AntimatterMaterialTypes.LIQUID.allowGen(m)) return MaterialTypeFluid.getEmptyFluidAndLog(AntimatterMaterialTypes.LIQUID, m); + if (m.getId().equals("water")) return FluidPlatformUtils.createFluidStack(Fluids.WATER, i); + else if (m.getId().equals("lava")) return FluidPlatformUtils.createFluidStack(Fluids.LAVA, i); + else if (m == SaltWater) return FluidPlatformUtils.createFluidStack(TFCFluids.SALT_WATER.getSource(), i); + AntimatterFluid fluid = AntimatterAPI.get(AntimatterFluid.class, AntimatterMaterialTypes.LIQUID.getId() + "_" + m.getId()); + if (fluid == null) throw new IllegalStateException("Tried to get null fluid"); + return FluidPlatformUtils.createFluidStack(fluid.getFluid(), i); + }); } }