From f9acb96d070745a38d944b10e445a1ba50150489 Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Fri, 26 Apr 2024 20:30:12 -0400 Subject: [PATCH] hid and disabled recipes of all electric tool bits and blades except steel buzzsaw blade when gt5 tool config is off --- .../java/trinsdar/gt4r/GT4Reimagined.java | 9 +++++ .../gt4r/loader/MaterialRecipeLoader.java | 40 ++++++++++--------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/common/src/main/java/trinsdar/gt4r/GT4Reimagined.java b/common/src/main/java/trinsdar/gt4r/GT4Reimagined.java index ce5518a1..aa265279 100644 --- a/common/src/main/java/trinsdar/gt4r/GT4Reimagined.java +++ b/common/src/main/java/trinsdar/gt4r/GT4Reimagined.java @@ -3,6 +3,7 @@ import io.github.gregtechintergalactical.gtcore.data.GTCoreItems; import io.github.gregtechintergalactical.gtcore.item.ItemPowerUnit; import muramasa.antimatter.AntimatterAPI; +import muramasa.antimatter.data.AntimatterMaterialTypes; import muramasa.antimatter.datagen.AntimatterDynamics; import muramasa.antimatter.AntimatterMod; import muramasa.antimatter.datagen.providers.AntimatterBlockStateProvider; @@ -28,6 +29,10 @@ import java.util.Arrays; import java.util.stream.Collectors; +import static muramasa.antimatter.data.AntimatterMaterialTypes.*; +import static muramasa.antimatter.data.AntimatterMaterialTypes.DRILLBIT; +import static trinsdar.gt4r.data.Materials.Steel; + public class GT4Reimagined extends AntimatterMod { @@ -83,6 +88,10 @@ public void onRegistrationEvent(RegistrationEvent event, Side side) { if (!AntimatterAPI.isModLoaded("gti")){ l.addAll(AntimatterAPI.all(IAntimatterTool.class).stream().filter(i -> i.getAntimatterToolType().isPowered()).map(IBasicAntimatterTool::getItem).toList()); l.addAll(AntimatterAPI.all(ItemPowerUnit.class)); + l.addAll(WRENCHBIT.all().stream().map(m -> WRENCHBIT.get(m)).toList()); + l.addAll(CHAINSAWBIT.all().stream().map(m -> CHAINSAWBIT.get(m)).toList()); + l.addAll(DRILLBIT.all().stream().map(m -> DRILLBIT.get(m)).toList()); + l.addAll(BUZZSAW_BLADE.all().stream().filter(m -> m != Steel).map(m -> BUZZSAW_BLADE.get(m)).toList()); } else { l.add(GT4RData.RockCutterPowerUnit); l.add(AntimatterAPI.get(IAntimatterTool.class, "rock_cutter").getItem()); diff --git a/common/src/main/java/trinsdar/gt4r/loader/MaterialRecipeLoader.java b/common/src/main/java/trinsdar/gt4r/loader/MaterialRecipeLoader.java index 77825346..7611baf1 100644 --- a/common/src/main/java/trinsdar/gt4r/loader/MaterialRecipeLoader.java +++ b/common/src/main/java/trinsdar/gt4r/loader/MaterialRecipeLoader.java @@ -12,6 +12,7 @@ import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; import net.minecraft.resources.ResourceLocation; +import trinsdar.gt4r.GT4RConfig; import trinsdar.gt4r.GT4RRef; import trinsdar.gt4r.data.GT4RMaterialTags; @@ -50,25 +51,28 @@ public static void loadRecipes(Consumer output, AntimatterRecipe provider.shapeless(output,"gem_" + m.getId() + "_from_block", "blocks", GEM.get(m, 9), BLOCK.getMaterialTag(m)); } }); - AntimatterMaterialTypes.DRILLBIT.all().forEach(m -> { - if (m.has(PLATE) || m.has(GEM)){ - TagKey plate = m.has(PLATE) ? PLATE.getMaterialTag(m) : GEM.getMaterialTag(m); - provider.addItemRecipe(output, GT4RRef.ID, m.getId() + "_drillbit", "drillbits", AntimatterMaterialTypes.DRILLBIT.get(m), ImmutableMap.of('H', AntimatterDefaultTools.HAMMER.getTag(), 'P', plate, 'S', PLATE.getMaterialTag(Steel)), "PSP", "PSP", "SHS"); - } - }); - AntimatterMaterialTypes.CHAINSAWBIT.all().forEach(m -> { - if (m.has(PLATE) || m.has(GEM)){ - TagKey plate = m.has(PLATE) ? PLATE.getMaterialTag(m) : GEM.getMaterialTag(m); - provider.addItemRecipe(output, GT4RRef.ID, m.getId() + "_chainsawbit", "chainsawbits", AntimatterMaterialTypes.CHAINSAWBIT.get(m), ImmutableMap.of('H', AntimatterDefaultTools.HAMMER.getTag(), 'P', plate, 'S', PLATE.getMaterialTag(Steel), 'R', AntimatterMaterialTypes.RING.getMaterialTag(Steel)), "SRS", "PHP", "SRS"); - } - }); - AntimatterMaterialTypes.WRENCHBIT.all().forEach(m -> { - if (m.has(PLATE) || m.has(GEM)){ - TagKey plate = m.has(PLATE) ? PLATE.getMaterialTag(m) : GEM.getMaterialTag(m); - provider.addItemRecipe(output, GT4RRef.ID, m.getId() + "_wrenchbit", "wrenchbits", AntimatterMaterialTypes.WRENCHBIT.get(m), ImmutableMap.of('H', AntimatterDefaultTools.HAMMER.getTag(), 'P', plate, 'S', AntimatterMaterialTypes.SCREW.getMaterialTag(Steel), 'R', AntimatterMaterialTypes.RING.getMaterialTag(Steel), 's', AntimatterDefaultTools.SCREWDRIVER.getTag()), "HPS", "PRP", "SPs"); - } - }); + if (GT4RConfig.GT5_ELECTRIC_TOOLS.get()) { + AntimatterMaterialTypes.DRILLBIT.all().forEach(m -> { + if (m.has(PLATE) || m.has(GEM)){ + TagKey plate = m.has(PLATE) ? PLATE.getMaterialTag(m) : GEM.getMaterialTag(m); + provider.addItemRecipe(output, GT4RRef.ID, m.getId() + "_drillbit", "drillbits", AntimatterMaterialTypes.DRILLBIT.get(m), ImmutableMap.of('H', AntimatterDefaultTools.HAMMER.getTag(), 'P', plate, 'S', PLATE.getMaterialTag(Steel)), "PSP", "PSP", "SHS"); + } + }); + AntimatterMaterialTypes.CHAINSAWBIT.all().forEach(m -> { + if (m.has(PLATE) || m.has(GEM)){ + TagKey plate = m.has(PLATE) ? PLATE.getMaterialTag(m) : GEM.getMaterialTag(m); + provider.addItemRecipe(output, GT4RRef.ID, m.getId() + "_chainsawbit", "chainsawbits", AntimatterMaterialTypes.CHAINSAWBIT.get(m), ImmutableMap.of('H', AntimatterDefaultTools.HAMMER.getTag(), 'P', plate, 'S', PLATE.getMaterialTag(Steel), 'R', AntimatterMaterialTypes.RING.getMaterialTag(Steel)), "SRS", "PHP", "SRS"); + } + }); + AntimatterMaterialTypes.WRENCHBIT.all().forEach(m -> { + if (m.has(PLATE) || m.has(GEM)){ + TagKey plate = m.has(PLATE) ? PLATE.getMaterialTag(m) : GEM.getMaterialTag(m); + provider.addItemRecipe(output, GT4RRef.ID, m.getId() + "_wrenchbit", "wrenchbits", AntimatterMaterialTypes.WRENCHBIT.get(m), ImmutableMap.of('H', AntimatterDefaultTools.HAMMER.getTag(), 'P', plate, 'S', AntimatterMaterialTypes.SCREW.getMaterialTag(Steel), 'R', AntimatterMaterialTypes.RING.getMaterialTag(Steel), 's', AntimatterDefaultTools.SCREWDRIVER.getTag()), "HPS", "PRP", "SPs"); + } + }); + } AntimatterMaterialTypes.BUZZSAW_BLADE.all().forEach(m -> { + if (m != Steel && !GT4RConfig.GT5_ELECTRIC_TOOLS.get()) return; if (m.has(PLATE) || m.has(GEM)){ TagKey plate = m.has(PLATE) ? PLATE.getMaterialTag(m) : GEM.getMaterialTag(m); provider.addItemRecipe(output, GT4RRef.ID, m.getId() + "_buzzsaw_blade", "buzzsaw_blades", AntimatterMaterialTypes.BUZZSAW_BLADE.get(m), ImmutableMap.of('H', AntimatterDefaultTools.HAMMER.getTag(), 'P', plate, 'F', AntimatterDefaultTools.FILE.getTag(), 'W', AntimatterDefaultTools.WRENCH.getTag(), 'C', AntimatterDefaultTools.WIRE_CUTTER.getTag()), "WPH", "P P", "FPC");