diff --git a/common/src/main/java/trinsdar/gt4r/blockentity/single/BlockEntityFluidExtractor.java b/common/src/main/java/trinsdar/gt4r/blockentity/single/BlockEntitySmelter.java similarity index 71% rename from common/src/main/java/trinsdar/gt4r/blockentity/single/BlockEntityFluidExtractor.java rename to common/src/main/java/trinsdar/gt4r/blockentity/single/BlockEntitySmelter.java index 26dc4099..4dd6bf4f 100644 --- a/common/src/main/java/trinsdar/gt4r/blockentity/single/BlockEntityFluidExtractor.java +++ b/common/src/main/java/trinsdar/gt4r/blockentity/single/BlockEntitySmelter.java @@ -12,20 +12,21 @@ import trinsdar.gt4r.data.RecipeMaps; import trinsdar.gt4r.blockentity.multi.BlockEntityIndustrialBlastFurnace; -public class BlockEntityFluidExtractor extends BlockEntityMachine { - public BlockEntityFluidExtractor(Machine type, BlockPos pos, BlockState state) { +public class BlockEntitySmelter extends BlockEntityMachine { + public BlockEntitySmelter(Machine type, BlockPos pos, BlockState state) { super(type, pos, state); - this.recipeHandler.set(() -> new MachineRecipeHandler(this){ + this.recipeHandler.set(() -> new MachineRecipeHandler<>(this) { int heat = 0, maxHeat = 750; + @Override public void onMachineEvent(IMachineEvent event, Object... data) { super.onMachineEvent(event, data); - if (event instanceof BlockEntityIndustrialBlastFurnace.BFEvent){ + if (event instanceof BlockEntityIndustrialBlastFurnace.BFEvent) { maxHeat = 750; ItemStack stack = (ItemStack) data[0]; - if (!stack.isEmpty()){ - IRecipe coilRecipe = RecipeMaps.FLUID_EXTRACTOR_COILS.find(new ItemStack[]{stack}, new FluidHolder[]{}, tile.tier, r -> r.getSpecialValue() > 0); - if (coilRecipe != null){ + if (!stack.isEmpty()) { + IRecipe coilRecipe = RecipeMaps.SMELTER_COILS.find(new ItemStack[]{stack}, new FluidHolder[]{}, tile.tier, r -> r.getSpecialValue() > 0); + if (coilRecipe != null) { maxHeat += (coilRecipe.getSpecialValue() * stack.getCount()); } } diff --git a/common/src/main/java/trinsdar/gt4r/data/Guis.java b/common/src/main/java/trinsdar/gt4r/data/Guis.java index d2cbb404..98969932 100644 --- a/common/src/main/java/trinsdar/gt4r/data/Guis.java +++ b/common/src/main/java/trinsdar/gt4r/data/Guis.java @@ -62,7 +62,7 @@ public static void init(Side side) { AntimatterAPI.registerJEICategory(RecipeMaps.ORE_BYPRODUCTS, Guis.ORE_BYPRODUCTS); AntimatterAPI.registerJEICategory(RecipeMaps.INT_CIRCUITS, Guis.ORE_BYPRODUCTS_OLD); - AntimatterAPI.registerJEICategory(RecipeMaps.FLUID_EXTRACTOR_COILS, Guis.ORE_BYPRODUCTS_OLD); + AntimatterAPI.registerJEICategory(RecipeMaps.SMELTER_COILS, Guis.ORE_BYPRODUCTS_OLD); //TODO changing slots of a machine in world, will crash from GTItemHandler.validateSlot() @@ -133,7 +133,8 @@ public static void slots(){ MASS_FABRICATOR.add(COMPRESSOR).add(FL_IN, 53, 63).add(FL_OUT, 107, 63); REPLICATOR.add(FLUID_CANNER); FERMENTER.add(FLUID_CANNER); - FLUID_EXTRACTOR.add(COMPRESSOR).add(FL_OUT, 107, 63); + FLUID_PRESS.add(COMPRESSOR).add(FL_OUT, 107, 63); + SMELTER.add(FLUID_PRESS); FLUID_SOLIDIFIER.add(COMPRESSOR).add(FL_IN, 53, 63); DISTILLERY.add(FLUID_CANNER); BATH.add(THERMAL_CENTRIFUGE).add(FL_IN, 53, 63); @@ -288,7 +289,7 @@ public static void machineData(){ CHEMICAL_REACTOR.getGui().getMachineData().setProgressLocation("chemical_reactor"); FLUID_CANNER.getGui().getMachineData().setProgressLocation("canner"); FERMENTER.getGui().getMachineData().setProgressLocation("chemical_reactor"); - FLUID_EXTRACTOR.getGui().getMachineData().setProgressLocation("extractor"); + FLUID_PRESS.getGui().getMachineData().setProgressLocation("extractor"); DISTILLERY.getGui().getMachineData().setProgressLocation("chemical_reactor"); BATH.getGui().getMachineData().setProgressLocation("ore_washer"); SIFTER.getGui().getMachineData().setProgressLocation("sifter"); diff --git a/common/src/main/java/trinsdar/gt4r/data/Machines.java b/common/src/main/java/trinsdar/gt4r/data/Machines.java index c8a836c8..c103402e 100644 --- a/common/src/main/java/trinsdar/gt4r/data/Machines.java +++ b/common/src/main/java/trinsdar/gt4r/data/Machines.java @@ -62,10 +62,11 @@ public class Machines { public static BasicMachine FORGE_HAMMER = new UpgradeableMachine(GT4RRef.ID, "forge_hammer").setMap(HAMMERING).setTiers(LV).addFlags(GUI, ITEM).setTile(BlockEntityForgeHammer::new); public static BasicMachine ORE_WASHER = new UpgradeableMachine(GT4RRef.ID, "ore_washer").setMap(ORE_WASHING).setTiers(LV).addFlags(GUI, ITEM, FLUID); public static BasicMachine THERMAL_CENTRIFUGE = new UpgradeableMachine(GT4RRef.ID, "thermal_centrifuge").setTiers(MV).setMap(THERMAL_CENTRIFUGING).addFlags(GUI, ITEM, FLUID); - public static BasicMachine FLUID_EXTRACTOR = new UpgradeableMachine(GT4RRef.ID, "fluid_extractor").setMap(FLUID_EXTRACTING).setTiers(LV).addFlags(GUI, ITEM, FLUID); + public static BasicMachine FLUID_PRESS = new UpgradeableMachine(GT4RRef.ID, "fluid_press").setMap(RecipeMaps.FLUID_PRESS).setTiers(LV).addFlags(GUI, ITEM, FLUID); public static BasicMachine FLUID_SOLIDIFIER = new UpgradeableMachine(GT4RRef.ID, "fluid_solidifier").setMap(FLUID_SOLIDIFYING).setTiers(LV).addFlags(GUI, ITEM, FLUID); public static BasicMachine PUMP = new BasicMachine(GT4RRef.ID, "pump").addFlags(GUI, ITEM, FLUID).setTiers(LV).setTile(BlockEntityPump::new); public static BasicMachine SIFTER = new UpgradeableMachine(GT4RRef.ID, "sifter").setMap(SIFTING).setTiers(LV).addFlags(GUI, ITEM); + public static BasicMachine SMELTER = new UpgradeableMachine(GT4RRef.ID, "smelter").setMap(RecipeMaps.SMELTER).addFlags(GUI, ITEM, FLUID); public static BasicMachine BATH = new UpgradeableMachine(GT4RRef.ID, "bath").setMap(BATHING).setTiers(LV).addFlags(GUI, ITEM); public static BasicMachine DISTILLERY = new UpgradeableMachine(GT4RRef.ID, "distillery").setMap(BASIC_DISTILLING).setTiers(LV).addFlags(GUI, ITEM, FLUID); public static BasicMachine FERMENTER = new UpgradeableMachine(GT4RRef.ID, "fermenter").setMap(FERMENTING).setTiers(LV).addFlags(GUI, ITEM, FLUID); diff --git a/common/src/main/java/trinsdar/gt4r/data/RecipeMaps.java b/common/src/main/java/trinsdar/gt4r/data/RecipeMaps.java index 6f09f07f..03f553ee 100644 --- a/common/src/main/java/trinsdar/gt4r/data/RecipeMaps.java +++ b/common/src/main/java/trinsdar/gt4r/data/RecipeMaps.java @@ -63,14 +63,15 @@ public class RecipeMaps { public static RecipeMap DISASSEMBLING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "disassembler", new RecipeBuilder())); public static RecipeMap MASS_FABRICATING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "mass_fabricator", new RecipeBuilder())); public static RecipeMap REPLICATING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "replicator", new RecipeBuilder())); - public static RecipeMap FLUID_EXTRACTING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "fluid_extractor", new RecipeBuilder())); + public static RecipeMap FLUID_PRESS = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "fluid_press", new RecipeBuilder())); public static RecipeMap FLUID_SOLIDIFYING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "fluid_solidifier", new RecipeBuilder())); public static RecipeMap HAMMERING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "forge_hammer", new SteamBuilder(STEAM_FORGE_HAMMER))); public static RecipeMap SIFTING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "sifter", new SteamBuilder(STEAM_SIFTER))); + public static RecipeMap SMELTER = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "smelter", new RecipeBuilder())); public static RecipeMap BASIC_DISTILLING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "distillery", new RecipeBuilder())); public static RecipeMap DUSTBIN = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "dustbin", new RecipeBuilder())); public static RecipeMap FERMENTING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "fermenter", new RecipeBuilder())); - public static RecipeMap FLUID_EXTRACTOR_COILS = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "fluid_extractor_coils", new RecipeBuilder())).setIcon(() -> GT4RData.CupronickelHeatingCoil); + public static RecipeMap SMELTER_COILS = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "smelter_coils", new RecipeBuilder())).setIcon(() -> GT4RData.CupronickelHeatingCoil); public static RecipeMap COKING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "coke_oven", new RecipeBuilder())); public static RecipeMap PYROLYSING = AntimatterAPI.register(RecipeMap.class, new RecipeMap<>(GT4RRef.ID, "pyrolysis_oven", new RecipeBuilder())); diff --git a/common/src/main/java/trinsdar/gt4r/data/client/RecipeRenderer.java b/common/src/main/java/trinsdar/gt4r/data/client/RecipeRenderer.java index 3c225a51..104d4b29 100644 --- a/common/src/main/java/trinsdar/gt4r/data/client/RecipeRenderer.java +++ b/common/src/main/java/trinsdar/gt4r/data/client/RecipeRenderer.java @@ -59,7 +59,7 @@ public void render(PoseStack stack, IRecipe recipe, Font fontRenderer, int guiOf public static void clientMaps() { RecipeMaps.ORE_BYPRODUCTS.setInfoRenderer(InfoRenderers.EMPTY_RENDERER); RecipeMaps.INT_CIRCUITS.setInfoRenderer(INT_CIRCUIT_RENDERER); - RecipeMaps.FLUID_EXTRACTOR_COILS.setInfoRenderer(FLUID_EXTRACTOR_COILS_RENDERER); + RecipeMaps.SMELTER_COILS.setInfoRenderer(FLUID_EXTRACTOR_COILS_RENDERER); RecipeMaps.THERMAL_BOILER_FUELS.setInfoRenderer(InfoRenderers.EMPTY_RENDERER); RecipeMaps.STEAM_FUELS.setInfoRenderer(FUEL_RENDERER); RecipeMaps.GAS_FUELS.setInfoRenderer(FUEL_RENDERER); diff --git a/common/src/main/java/trinsdar/gt4r/events/AntimatterEvents.java b/common/src/main/java/trinsdar/gt4r/events/AntimatterEvents.java index c886e2af..7cca5440 100644 --- a/common/src/main/java/trinsdar/gt4r/events/AntimatterEvents.java +++ b/common/src/main/java/trinsdar/gt4r/events/AntimatterEvents.java @@ -41,7 +41,7 @@ import trinsdar.gt4r.loader.machines.ExtruderLoader; import trinsdar.gt4r.loader.machines.FermentingLoader; import trinsdar.gt4r.loader.machines.FluidCanningLoader; -import trinsdar.gt4r.loader.machines.FluidExtractorLoader; +import trinsdar.gt4r.loader.machines.FluidPressLoader; import trinsdar.gt4r.loader.machines.FluidSolidifierLoader; import trinsdar.gt4r.loader.machines.ForgeHammerLoader; import trinsdar.gt4r.loader.machines.FurnaceLoader; @@ -50,6 +50,7 @@ import trinsdar.gt4r.loader.machines.MassFabLoader; import trinsdar.gt4r.loader.machines.OreByproducts; import trinsdar.gt4r.loader.machines.SiftingLoader; +import trinsdar.gt4r.loader.machines.SmelterLoader; import trinsdar.gt4r.loader.machines.ThermalCentrifuge; import trinsdar.gt4r.loader.machines.WasherLoader; import trinsdar.gt4r.loader.machines.WiremillLoader; @@ -85,10 +86,11 @@ public static void registerRecipeLoaders(IAntimatterRegistrar registrar, IRecipe loader.accept("chemical_reactor", ChemicalReactorLoader::init); loader.accept("fuels", FuelBurnHandler::init); loader.accept("heat_exchanger", HeatExchangerLoader::init); - loader.accept("fluid_extractor", FluidExtractorLoader::init); + loader.accept("fluid_extractor", FluidPressLoader::init); loader.accept("fluid_solidifier", FluidSolidifierLoader::init); loader.accept("bathing", BathingLoader::init); loader.accept("solid_fuel_boiler", SolidFuelBoilerHandler::init); + loader.accept("smelter", SmelterLoader::init); loader.accept("distilling", DistillingLoader::init); loader.accept("fermenting", FermentingLoader::init); loader.accept("industrial_sawmilling", IndustrialSawmill::init); diff --git a/common/src/main/java/trinsdar/gt4r/gui/slots/SlotCoil.java b/common/src/main/java/trinsdar/gt4r/gui/slots/SlotCoil.java index 1e4c761b..fb2f83b1 100644 --- a/common/src/main/java/trinsdar/gt4r/gui/slots/SlotCoil.java +++ b/common/src/main/java/trinsdar/gt4r/gui/slots/SlotCoil.java @@ -12,7 +12,7 @@ import trinsdar.gt4r.data.Machines; import trinsdar.gt4r.data.RecipeMaps; import trinsdar.gt4r.blockentity.multi.BlockEntityIndustrialBlastFurnace; -import trinsdar.gt4r.blockentity.single.BlockEntityFluidExtractor; +import trinsdar.gt4r.blockentity.single.BlockEntitySmelter; import javax.annotation.Nonnull; @@ -23,8 +23,8 @@ public SlotCoil(SlotType type, IGuiHandler tile, ExtendedItemContainer @Override public boolean mayPlace(@Nonnull ItemStack stack) { - if (holder instanceof BlockEntityFluidExtractor){ - return RecipeMaps.FLUID_EXTRACTOR_COILS.acceptsItem(stack); + if (holder instanceof BlockEntitySmelter){ + return RecipeMaps.SMELTER_COILS.acceptsItem(stack); } BlockEntityMachine m = (BlockEntityMachine) holder; return stack.getItem() == GT4RData.KanthalHeatingCoil || stack.getItem() == GT4RData.NichromeHeatingCoil || (m.getMachineType() == Machines.PYROLYSIS_OVEN && stack.getItem() == GT4RData.CupronickelHeatingCoil); @@ -37,7 +37,7 @@ public boolean mayPickup(Player playerIn) { @Override public int getMaxStackSize() { - if (holder instanceof BlockEntityFluidExtractor){ + if (holder instanceof BlockEntitySmelter){ return 6; } return 4; @@ -45,7 +45,7 @@ public int getMaxStackSize() { @Override public int getMaxStackSize(@Nonnull ItemStack stack) { - if (holder instanceof BlockEntityFluidExtractor){ + if (holder instanceof BlockEntitySmelter){ return 6; } return 4; diff --git a/common/src/main/java/trinsdar/gt4r/loader/crafting/MachineCrafting.java b/common/src/main/java/trinsdar/gt4r/loader/crafting/MachineCrafting.java index 5c881dd4..c87206a8 100644 --- a/common/src/main/java/trinsdar/gt4r/loader/crafting/MachineCrafting.java +++ b/common/src/main/java/trinsdar/gt4r/loader/crafting/MachineCrafting.java @@ -20,7 +20,6 @@ import net.minecraft.world.item.Items; import trinsdar.gt4r.GT4RRef; import muramasa.antimatter.data.ForgeCTags; -import trinsdar.gt4r.data.GT4RData; import trinsdar.gt4r.data.GT4RMaterialTags; import trinsdar.gt4r.data.TierMaps; @@ -252,7 +251,7 @@ private static void loadUtilityBlockRecipes(Consumer output, Ant } private static void loadHatchRecipes(Consumer output, AntimatterRecipeProvider provider){ - provider.addItemRecipe(output, GT4RRef.ID, "fluid_extractor", "machines", FLUID_EXTRACTOR.getItem(LV), of('C', CIRCUITS_BASIC, 'G', ForgeCTags.GLASS, 'M', MACHINE_HULLS_BASIC, 'P', PISTONS, 'p', PumpModule), " C ", "pMP", "GCG"); + provider.addItemRecipe(output, GT4RRef.ID, "fluid_press", "machines", FLUID_PRESS.getItem(LV), of('C', CIRCUITS_BASIC, 'G', ForgeCTags.GLASS, 'M', MACHINE_HULLS_BASIC, 'P', PISTONS, 'p', PumpModule), " C ", "pMP", "GCG"); provider.addItemRecipe(output, GT4RRef.ID, "fluid_solidifier", "machines", FLUID_SOLIDIFIER.getItem(LV), of('C', CIRCUITS_BASIC, 'G', ForgeCTags.GLASS, 'M', MACHINE_HULLS_BASIC, 'P', PumpModule, 'c', ForgeCTags.CHESTS_WOODEN), " G ", "PMP", "CcC"); provider.addItemRecipe(output, GT4RRef.ID, "item_input_hatch", "hatches", HATCH_ITEM_I.getItem(LV), of('P', AntimatterMaterialTypes.PLATE.getMaterialTag(StainlessSteel), 'G', GEARS_STEELS, 'M', MACHINE_HULLS_BASIC, 'C', ForgeCTags.CHESTS_WOODEN), "PCP", "GMG", "PPP"); provider.addItemRecipe(output, GT4RRef.ID, "item_output_hatch", "hatches", HATCH_ITEM_O.getItem(LV), of('P', AntimatterMaterialTypes.PLATE.getMaterialTag(StainlessSteel), 'G', GEARS_STEELS, 'M', MACHINE_HULLS_BASIC, 'C', ForgeCTags.CHESTS_WOODEN), "PPP", "GMG", "PCP"); diff --git a/common/src/main/java/trinsdar/gt4r/loader/machines/FluidExtractorLoader.java b/common/src/main/java/trinsdar/gt4r/loader/machines/FluidExtractorLoader.java deleted file mode 100644 index c33045d6..00000000 --- a/common/src/main/java/trinsdar/gt4r/loader/machines/FluidExtractorLoader.java +++ /dev/null @@ -1,78 +0,0 @@ -package trinsdar.gt4r.loader.machines; - -import muramasa.antimatter.data.AntimatterMaterialTypes; -import muramasa.antimatter.material.Material; -import muramasa.antimatter.material.MaterialTags; -import muramasa.antimatter.material.MaterialTypeItem; -import muramasa.antimatter.recipe.ingredient.RecipeIngredient; -import muramasa.antimatter.util.AntimatterPlatformUtils; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.tags.ItemTags; -import muramasa.antimatter.data.ForgeCTags; -import trinsdar.gt4r.data.GT4RData; - -import static muramasa.antimatter.data.AntimatterMaterialTypes.*; -import static trinsdar.gt4r.data.Materials.FishOil; -import static trinsdar.gt4r.data.Materials.Honey; -import static trinsdar.gt4r.data.Materials.SeedOil; -import static trinsdar.gt4r.data.RecipeMaps.FLUID_EXTRACTING; -import static trinsdar.gt4r.data.RecipeMaps.FLUID_EXTRACTOR_COILS; - -public class FluidExtractorLoader { - public static void init() { - FLUID_EXTRACTOR_COILS.RB().ii(RecipeIngredient.of(GT4RData.CupronickelHeatingCoil, 1)).add("cupronickel_heating_coil",0, 0, 250); - FLUID_EXTRACTOR_COILS.RB().ii(RecipeIngredient.of(GT4RData.KanthalHeatingCoil, 1)).add("kanthal_heating_coil",0, 0, 500); - FLUID_EXTRACTOR_COILS.RB().ii(RecipeIngredient.of(GT4RData.NichromeHeatingCoil, 1)).add("nichrome_heating_coil",0, 0, 750); - ROD.all().forEach(r -> { - add(r, ROD, 0.5f); - }); - PLATE.all().forEach(r -> { - add(r, PLATE, 1f); - }); - INGOT.all().forEach(r -> { - add(r, INGOT, 1f); - if (r.has(DUST)){ - add(r, DUST, 1f); - } - }); - GEAR.all().forEach(r -> { - add(r, GEAR, 4f); - }); - PLATE_DENSE.all().forEach(r -> { - add(r, PLATE_DENSE, 9f); - }); - - FLUID_EXTRACTING.RB() - .ii(RecipeIngredient.of(ForgeCTags.SEEDS,1)) - .fo(SeedOil.getLiquid(10)) - .add("seed_oil",32, 2); - FLUID_EXTRACTING.RB() - .ii(RecipeIngredient.of(ItemTags.FISHES,1)) - .fo(FishOil.getLiquid(10)) - .add("fish_oil",32, 2); - FLUID_EXTRACTING.RB() - .ii(RecipeIngredient.of(Items.HONEY_BOTTLE,1)) - .fo(Honey.getLiquid(250)) - .io(new ItemStack(Items.GLASS_BOTTLE)) - .add("honey",32, 2); - } - - private static void add(Material m, MaterialTypeItem i, float ratio) { - if (!m.has(LIQUID)) return; - long amount = amount(ratio); - FLUID_EXTRACTING.RB() - .ii(i.getMaterialIngredient(m, 1)) - .fo(m.getLiquid(amount)) - .add(m.getId() + "_" + i.getId(), (long)(m.getMass()*((float)amount/ratio())), 64, MaterialTags.MELTING_POINT.getInt(m)); - } - - private static long ratio(){ - return AntimatterPlatformUtils.isForge() ? 144L : 9000L; - } - - private static long amount(float ingots){ - return (long) (ratio() * ingots); - } -} diff --git a/common/src/main/java/trinsdar/gt4r/loader/machines/FluidPressLoader.java b/common/src/main/java/trinsdar/gt4r/loader/machines/FluidPressLoader.java new file mode 100644 index 00000000..f2c98c5e --- /dev/null +++ b/common/src/main/java/trinsdar/gt4r/loader/machines/FluidPressLoader.java @@ -0,0 +1,35 @@ +package trinsdar.gt4r.loader.machines; + +import muramasa.antimatter.material.Material; +import muramasa.antimatter.material.MaterialTags; +import muramasa.antimatter.material.MaterialTypeItem; +import muramasa.antimatter.recipe.ingredient.RecipeIngredient; +import muramasa.antimatter.util.AntimatterPlatformUtils; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.tags.ItemTags; +import muramasa.antimatter.data.ForgeCTags; + +import static muramasa.antimatter.data.AntimatterMaterialTypes.*; +import static trinsdar.gt4r.data.Materials.FishOil; +import static trinsdar.gt4r.data.Materials.Honey; +import static trinsdar.gt4r.data.Materials.SeedOil; +import static trinsdar.gt4r.data.RecipeMaps.FLUID_PRESS; + +public class FluidPressLoader { + public static void init() { + FLUID_PRESS.RB() + .ii(RecipeIngredient.of(ForgeCTags.SEEDS,1)) + .fo(SeedOil.getLiquid(10)) + .add("seed_oil",32, 2); + FLUID_PRESS.RB() + .ii(RecipeIngredient.of(ItemTags.FISHES,1)) + .fo(FishOil.getLiquid(10)) + .add("fish_oil",32, 2); + FLUID_PRESS.RB() + .ii(RecipeIngredient.of(Items.HONEY_BOTTLE,1)) + .fo(Honey.getLiquid(250)) + .io(new ItemStack(Items.GLASS_BOTTLE)) + .add("honey",32, 2); + } +} diff --git a/common/src/main/java/trinsdar/gt4r/loader/machines/SmelterLoader.java b/common/src/main/java/trinsdar/gt4r/loader/machines/SmelterLoader.java new file mode 100644 index 00000000..f4e0721a --- /dev/null +++ b/common/src/main/java/trinsdar/gt4r/loader/machines/SmelterLoader.java @@ -0,0 +1,63 @@ +package trinsdar.gt4r.loader.machines; + +import muramasa.antimatter.data.AntimatterMaterialTypes; +import muramasa.antimatter.material.Material; +import muramasa.antimatter.material.MaterialTags; +import muramasa.antimatter.material.MaterialTypeItem; +import muramasa.antimatter.recipe.ingredient.RecipeIngredient; +import muramasa.antimatter.util.AntimatterPlatformUtils; +import trinsdar.gt4r.data.GT4RData; +import trinsdar.gt4r.data.GT4RMaterialTags; + +import static muramasa.antimatter.Ref.L; +import static muramasa.antimatter.Ref.U; +import static muramasa.antimatter.data.AntimatterMaterialTypes.*; +import static muramasa.antimatter.data.AntimatterMaterialTypes.PLATE_DENSE; +import static muramasa.antimatter.data.AntimatterMaterials.Lava; +import static muramasa.antimatter.material.MaterialTags.MOLTEN; +import static trinsdar.gt4r.data.Materials.*; +import static trinsdar.gt4r.data.RecipeMaps.*; + +public class SmelterLoader { + public static void init() { + SMELTER_COILS.RB().ii(RecipeIngredient.of(GT4RData.CupronickelHeatingCoil, 1)).add("cupronickel_heating_coil",0, 0, 250); + SMELTER_COILS.RB().ii(RecipeIngredient.of(GT4RData.KanthalHeatingCoil, 1)).add("kanthal_heating_coil",0, 0, 500); + SMELTER_COILS.RB().ii(RecipeIngredient.of(GT4RData.NichromeHeatingCoil, 1)).add("nichrome_heating_coil",0, 0, 750); + MaterialTypeItem[] items = new MaterialTypeItem[]{INGOT, NUGGET, PLATE, PLATE_DENSE, ROD, ROD_LONG, RING, FOIL, BOLT, SCREW, GEAR, GEAR_SMALL, WIRE_FINE, ROTOR}; + for (MaterialTypeItem item : items) { + item.all().forEach(m -> { + add(m, item, item.getUnitValue()); + }); + } + DUST.all().forEach(m -> { + if (m.has(LIQUID) && m.has(MOLTEN) && !m.has(GT4RMaterialTags.NEEDS_BLAST_FURNACE)){ + add(m, DUST, DUST.getUnitValue()); + } + }); + addLava(Obsidian, ROD_LONG, ROD_LONG.getUnitValue()); + addLava(Obsidian, PLATE, PLATE.getUnitValue()); + addLava(Obsidian, DUST, DUST.getUnitValue()); + } + + private static void add(Material m, MaterialTypeItem i, long materialAmount) { + if (!m.has(AntimatterMaterialTypes.LIQUID)) return; + long amount = //(long) (L * ratio); + (L * materialAmount) / U; + long duration = Math.max(1, (24 * materialAmount) / U); + SMELTER.RB() + .ii(RecipeIngredient.of(i.getMaterialTag(m),1)) + .fo(m.getLiquid(amount)) + .add(m.getId() + "_from_" + i.getId(), (long)(m.getMass()*((float)amount/L)), Math.max(8, (int) Math.sqrt(2 * MaterialTags.MELTING_POINT.getInt(m))), duration); + } + + private static void addLava(Material m, MaterialTypeItem i, long materialAmount) { + long flUnit = AntimatterPlatformUtils.isFabric() ? L : 111; + long amount = //(long) (L * ratio); + (flUnit * materialAmount) / U; + long duration = Math.max(1, (24 * materialAmount) / U); + SMELTER.RB() + .ii(RecipeIngredient.of(i.getMaterialTag(m),1)) + .fo(Lava.getLiquid(amount)) + .add(m.getId() + "_from_" + i.getId(), (long)(m.getMass()*((float)amount/L)), Math.max(8, (int) Math.sqrt(2 * MaterialTags.MELTING_POINT.getInt(m))), duration); + } +}