Skip to content

Commit

Permalink
hid and disabled recipes of all electric tool bits and blades except …
Browse files Browse the repository at this point in the history
…steel buzzsaw blade when gt5 tool config is off
  • Loading branch information
Trinsdar committed Apr 27, 2024
1 parent e1dcba8 commit f9acb96
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
9 changes: 9 additions & 0 deletions common/src/main/java/trinsdar/gt4r/GT4Reimagined.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand Down Expand Up @@ -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());
Expand Down
40 changes: 22 additions & 18 deletions common/src/main/java/trinsdar/gt4r/loader/MaterialRecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -50,25 +51,28 @@ public static void loadRecipes(Consumer<FinishedRecipe> 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");
Expand Down

0 comments on commit f9acb96

Please sign in to comment.