diff --git a/src/main/java/com/github/gtexpert/gtbm/api/util/ModUtility.java b/src/main/java/com/github/gtexpert/gtbm/api/util/ModUtility.java index 1c51164..a6dc4a9 100644 --- a/src/main/java/com/github/gtexpert/gtbm/api/util/ModUtility.java +++ b/src/main/java/com/github/gtexpert/gtbm/api/util/ModUtility.java @@ -1,10 +1,10 @@ package com.github.gtexpert.gtbm.api.util; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; import java.util.Random; -import com.github.gtexpert.gtbm.api.ModValues; - import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; @@ -23,8 +23,12 @@ import gregtech.api.unification.stack.MaterialStack; import gregtech.common.items.MetaItems; +import com.github.gtexpert.gtbm.api.ModValues; + public class ModUtility { + public static List disabledItems = new ArrayList<>(); + public static @NotNull ItemStack getModItem(String modID, String itemName) { return GameRegistry.makeItemStack(modID + ":" + itemName, 0, 1, null); } diff --git a/src/main/java/com/github/gtexpert/gtbm/client/ClientProxy.java b/src/main/java/com/github/gtexpert/gtbm/client/ClientProxy.java index e2f6247..7670179 100644 --- a/src/main/java/com/github/gtexpert/gtbm/client/ClientProxy.java +++ b/src/main/java/com/github/gtexpert/gtbm/client/ClientProxy.java @@ -1,6 +1,11 @@ package com.github.gtexpert.gtbm.client; +import static com.github.gtexpert.gtbm.api.util.ModUtility.disabledItems; + +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -18,4 +23,17 @@ public void preInit(FMLPreInitializationEvent event) { @SubscribeEvent public static void registerModels(ModelRegistryEvent event) {} + + @SubscribeEvent + public static void onItemTooltip(ItemTooltipEvent event) { + ItemStack stack = event.getItemStack(); + if (disabledItems.size() > 1) { + for (ItemStack disabled : disabledItems) { + if (stack.isItemEqual(disabled)) { + event.getToolTip().add(I18n.format("gtbm.tooltip.warn.disabled_item")); + } + } + + } + } } diff --git a/src/main/java/com/github/gtexpert/gtbm/integration/forestry/ForestryConfigHolder.java b/src/main/java/com/github/gtexpert/gtbm/integration/forestry/ForestryConfigHolder.java index 9216bf6..2c573a6 100644 --- a/src/main/java/com/github/gtexpert/gtbm/integration/forestry/ForestryConfigHolder.java +++ b/src/main/java/com/github/gtexpert/gtbm/integration/forestry/ForestryConfigHolder.java @@ -15,4 +15,16 @@ public class ForestryConfigHolder { "default: NORMAL", "valid: [NORMAL, HARD]" }) public static String gameMode = "NORMAL"; + + @Config.Comment({ "If true, each will be uncraftable.", "default: false" }) + public static boolean Still = false, + Fabricator = false, + Centrifuge = false, + Bottler = false, + Fermenter = false, + Rainmaker = false, + Carpenter = false, + Moistener = false, + Raintank = false, + Squeezer = false; } diff --git a/src/main/java/com/github/gtexpert/gtbm/integration/forestry/ForestryModule.java b/src/main/java/com/github/gtexpert/gtbm/integration/forestry/ForestryModule.java index 3b217f6..28c9e07 100644 --- a/src/main/java/com/github/gtexpert/gtbm/integration/forestry/ForestryModule.java +++ b/src/main/java/com/github/gtexpert/gtbm/integration/forestry/ForestryModule.java @@ -14,11 +14,11 @@ import com.github.gtexpert.gtbm.module.Modules; @TModule( - moduleID = Modules.MODULE_FORESTRY, - containerID = ModValues.MODID, - modDependencies = Mods.Names.FORESTRY, - name = "GTBeesMatrix Forestry For Minecraft Integration", - description = "Forestry For Minecraft Integration Module") + moduleID = Modules.MODULE_FORESTRY, + containerID = ModValues.MODID, + modDependencies = Mods.Names.FORESTRY, + name = "GTBeesMatrix Forestry For Minecraft Integration", + description = "Forestry For Minecraft Integration Module") public class ForestryModule extends GTBMIntegrationSubmodule { @Override @@ -27,6 +27,7 @@ public void postInit(FMLPostInitializationEvent event) { FFMItemRecipe.init(); FFMMaterialsRecipe.init(); FFMToolRecipe.init(); + FFMCraftingRecipe.init(); CarpenterLoader.initBase(); CarpenterLoader.initMode(); diff --git a/src/main/java/com/github/gtexpert/gtbm/integration/forestry/recipes/FFMCraftingRecipe.java b/src/main/java/com/github/gtexpert/gtbm/integration/forestry/recipes/FFMCraftingRecipe.java new file mode 100644 index 0000000..ac27db4 --- /dev/null +++ b/src/main/java/com/github/gtexpert/gtbm/integration/forestry/recipes/FFMCraftingRecipe.java @@ -0,0 +1,49 @@ +package com.github.gtexpert.gtbm.integration.forestry.recipes; + +import static com.github.gtexpert.gtbm.api.util.ModUtility.*; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; + +import net.minecraft.item.ItemStack; + +import gregtech.api.recipes.ModHandler; + +import com.github.gtexpert.gtbm.api.util.Mods; +import com.github.gtexpert.gtbm.integration.forestry.ForestryConfigHolder; + +public class FFMCraftingRecipe { + + private static String id = Mods.Names.FORESTRY; + + public static void init() { + recipeRemoval(); + } + + public static void recipeRemoval() { + Map, String> recipes = new HashMap<>(); + recipes.put(() -> ForestryConfigHolder.Still, "still"); + recipes.put(() -> ForestryConfigHolder.Fabricator, "fabricator"); + recipes.put(() -> ForestryConfigHolder.Centrifuge, "centrifuge"); + recipes.put(() -> ForestryConfigHolder.Bottler, "bottler"); + recipes.put(() -> ForestryConfigHolder.Fermenter, "fermenter"); + recipes.put(() -> ForestryConfigHolder.Rainmaker, "Rainmaker"); + recipes.put(() -> ForestryConfigHolder.Carpenter, "carpenter"); + recipes.put(() -> ForestryConfigHolder.Moistener, "moistener"); + recipes.put(() -> ForestryConfigHolder.Raintank, "raintank"); + recipes.put(() -> ForestryConfigHolder.Squeezer, "squeezer"); + recipes.put(() -> ForestryConfigHolder.Fermenter, "fermenter"); + + recipes.forEach((config, name) -> { + if (config.get()) { + removeRecipeWithTooltip(getModItem(id, name)); + } + }); + } + + private static void removeRecipeWithTooltip(ItemStack stack) { + disabledItems.add(stack); + ModHandler.removeRecipeByOutput(stack); + } +} diff --git a/src/main/java/com/github/gtexpert/gtbm/integration/forestry/recipes/machines/CentrifugeLoader.java b/src/main/java/com/github/gtexpert/gtbm/integration/forestry/recipes/machines/CentrifugeLoader.java index e59cc9e..f10327c 100644 --- a/src/main/java/com/github/gtexpert/gtbm/integration/forestry/recipes/machines/CentrifugeLoader.java +++ b/src/main/java/com/github/gtexpert/gtbm/integration/forestry/recipes/machines/CentrifugeLoader.java @@ -2,20 +2,13 @@ import static gregtech.api.unification.ore.OrePrefix.*; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMaps; -import gregtech.api.unification.OreDictUnifier; -import gregtech.api.unification.material.Materials; import com.github.gtexpert.gtbm.api.util.Mods; -import forestry.factory.MachineUIDs; -import forestry.factory.ModuleFactory; - public class CentrifugeLoader { public static void init() { @@ -23,7 +16,6 @@ public static void init() { ItemStack wax = Mods.Forestry.getItem("beeswax"); ItemStack drop = Mods.Forestry.getItem("honey_drop"); - // Recipe was not added by GTCEu // GenDustry Section if (Mods.Gendustry.isModLoaded()) { for (int i = 10; i < 26; i++) { @@ -32,204 +24,6 @@ public static void init() { new int[] { 10000, 5000, 3000 }); } } - // If Forestry's Centrifuge is enabled, recipes will be added by GTCEu - if (ModuleFactory.machineEnabled(MachineUIDs.CENTRIFUGE)) return; - // Forestry Section - RecipeMaps.CENTRIFUGE_RECIPES.recipeBuilder() - .inputs(Mods.Forestry.getItem("propolis", 1, 3)) - .chancedOutput(Mods.Forestry.getItem("crafting_material", 1, 2), 6000, 0) - .chancedOutput(Mods.Forestry.getItem("propolis"), 1000, 0) - .EUt(5).duration(128).buildAndRegister(); - - registerCombRecipe(Mods.Forestry.getItem("bee_combs", 1), - new ItemStack[] { wax, drop }, - new int[] { 10000, 9000 }); - registerCombRecipe(Mods.Forestry.getItem("bee_combs", 1, 2), - new ItemStack[] { Mods.Forestry.getItem("refractory_wax"), Mods.Forestry.getItem("phosphor", 2) }, - new int[] { 10000, 7000 }); - registerCombRecipe(Mods.Forestry.getItem("bee_combs", 1, 3), - new ItemStack[] { Mods.Forestry.getItem("propolis"), drop }, - new int[] { 10000, 4000 }); - registerCombRecipe(Mods.Forestry.getItem("bee_combs", 1, 4), - new ItemStack[] { wax, drop, new ItemStack(Items.SNOWBALL), Mods.Forestry.getItem("pollen", 1, 1) }, - new int[] { 8000, 7000, 4000, 2000 }); - registerCombRecipe(Mods.Forestry.getItem("bee_combs", 1, 5), - new ItemStack[] { Mods.Forestry.getItem("honeydew"), drop }, - new int[] { 10000, 4000 }); - registerCombRecipe(Mods.Forestry.getItem("bee_combs", 1, 6), - new ItemStack[] { drop, Mods.Forestry.getItem("propolis", 1, 3) }, - new int[] { 10000, 8000 }); - registerCombRecipe(Mods.Forestry.getItem("bee_combs", 1, 7), - new ItemStack[] { wax, drop }, - new int[] { 10000, 9000 }); - registerCombRecipe(Mods.Forestry.getItem("bee_combs", 1, 15), - new ItemStack[] { wax, drop }, - new int[] { 10000, 9000 }); - registerCombRecipe(Mods.Forestry.getItem("bee_combs", 1, 16), - new ItemStack[] { Mods.Forestry.getItem("honeydew"), new ItemStack(Items.QUARTZ), drop }, - new int[] { 6000, 3000, 2000 }); - // ExtraBee Section - if (Mods.ExtraBees.isModLoaded()) { - registerCombRecipe(combExtraBee(0), - new ItemStack[] { wax, drop }, - new int[] { 10000, 5000 }); - registerCombRecipe(combExtraBee(1), - new ItemStack[] { new ItemStack(Items.ROTTEN_FLESH), wax, drop }, - new int[] { 8000, 2000, 2000 }); - registerCombRecipe(combExtraBee(2), - new ItemStack[] { new ItemStack(Items.DYE, 1, 15), wax, drop }, - new int[] { 8000, 2000, 2000 }); - registerCombRecipe(combExtraBee(3), - new ItemStack[] { drop, Mods.ExtraBees.getItem("propolis", 1, 1) }, - new int[] { 7500, 600 }); - registerCombRecipe(combExtraBee(4), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Coal), wax, drop }, - new int[] { 10000, 8000, 7500 }); - registerCombRecipe(combExtraBee(6), - new ItemStack[] { Mods.ExtraBees.getItem("propolis"), drop }, - new int[] { 10000, 9000 }); - registerCombRecipe(combExtraBee(7), - new ItemStack[] { Mods.ExtraBees.getItem("honey_drop", 1, 6), drop }, - new int[] { 10000, 9000 }); - registerCombRecipe(combExtraBee(8), - new ItemStack[] { Mods.ExtraBees.getItem("honey_drop", 1, 3), drop }, - new int[] { 10000, 9000 }); - registerCombRecipe(combExtraBee(9), - new ItemStack[] { Mods.ExtraBees.getItem("honey_drop", 1, 7), drop }, - new int[] { 10000, 9000 }); - registerCombRecipe(combExtraBee(10), - new ItemStack[] { Mods.ExtraBees.getItem("honey_drop", 1, 8), drop }, - new int[] { 10000, 9000 }); - registerCombRecipe(combExtraBee(11), - new ItemStack[] { wax, drop }, - new int[] { 5000, 2500 }); - registerCombRecipe(combExtraBee(12), - new ItemStack[] { OreDictUnifier.get(dust, Materials.Redstone), wax, drop }, - new int[] { 10000, 8000, 5000 }); - registerCombRecipe(combExtraBee(14), - new ItemStack[] { Mods.ExtraBees.getItem("honey_drop"), wax, - OreDictUnifier.get(dust, Materials.Redstone) }, - new int[] { 10000, 8000, 7500 }); - registerCombRecipe(combExtraBee(15), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Iron), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(16), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Gold), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(17), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Copper), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(18), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Tin), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(19), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Silver), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(21), - new ItemStack[] { wax, drop }, - new int[] { 5000, 2500 }); - registerCombRecipe(combExtraBee(22), - new ItemStack[] { drop, new ItemStack(Items.CLAY_BALL), wax }, - new int[] { 8000, 8000, 2500 }); - registerCombRecipe(combExtraBee(23), - new ItemStack[] { wax, drop }, - new int[] { 1000, 9000 }); - registerCombRecipe(combExtraBee(24), - new ItemStack[] { new ItemStack(Blocks.BROWN_MUSHROOM_BLOCK), wax, - new ItemStack(Blocks.RED_MUSHROOM_BLOCK) }, - new int[] { 10000, 9000, 7500 }); - registerCombRecipe(combExtraBee(25), - new ItemStack[] { Mods.ExtraBees.getItem("propolis", 1, 7), drop }, - new int[] { 7000, 5000 }); - registerCombRecipe(combExtraBee(27), - new ItemStack[] { wax, OreDictUnifier.get(dust, Materials.Sulfur), - Mods.ExtraBees.getItem("honey_drop", 1, 1) }, - new int[] { 8000, 7500, 5000 }); - registerCombRecipe(combExtraBee(28), - new ItemStack[] { wax, Mods.ExtraBees.getItem("honey_drop", 1, 2) }, - new int[] { 8000, 8000 }); - registerCombRecipe(combExtraBee(29), - new ItemStack[] { wax, new ItemStack(Items.SLIME_BALL), drop }, - new int[] { 10000, 7500, 7500 }); - registerCombRecipe(combExtraBee(30), - new ItemStack[] { new ItemStack(Items.BLAZE_POWDER), wax }, - new int[] { 10000, 7500 }); - registerCombRecipe(combExtraBee(32), - new ItemStack[] { Mods.ExtraBees.getItem("honey_drop", 1, 5), drop }, - new int[] { 8000, 7500 }); - registerCombRecipe(combExtraBee(36), - new ItemStack[] { OreDictUnifier.get(dust, Materials.Obsidian), drop }, - new int[] { 7500, 5000 }); - registerCombRecipe(combExtraBee(37), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Lead), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(40), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Zinc), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(41), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Titanium), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(42), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Tungsten), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(45), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Platinum), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(46), - new ItemStack[] { new ItemStack(Items.DYE, 6, 4), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(48), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Pyrite), - OreDictUnifier.get(dustSmall, Materials.Iron), wax, drop }, - new int[] { 10000, 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(50), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Cinnabar), wax, drop, - OreDictUnifier.get(dust, Materials.Redstone) }, - new int[] { 10000, 5000, 2500, 500 }); - registerCombRecipe(combExtraBee(51), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Sphalerite), - OreDictUnifier.get(dustSmall, Materials.Zinc), wax, drop }, - new int[] { 10000, 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(52), - new ItemStack[] { Mods.ExtraBees.getItem("misc", 1, 2), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(53), - new ItemStack[] { Mods.ExtraBees.getItem("misc", 1, 3), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(54), - new ItemStack[] { Mods.ExtraBees.getItem("misc", 1, 4), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(56), - new ItemStack[] { Mods.ExtraBees.getItem("misc", 1, 1), wax, drop }, - new int[] { 10000, 5000, 2500 }); - - int meta = 13; - for (int i = 57; i < 73; i++) { - registerCombRecipe(combExtraBee(i), - new ItemStack[] { Mods.ExtraBees.getItem("honey_drop", 1, meta), drop, wax }, - new int[] { 10000, 8000, 8000 }); - meta++; - } - registerCombRecipe(combExtraBee(73), - new ItemStack[] { OreDictUnifier.get(dustSmall, Materials.Nickel), wax, drop }, - new int[] { 10000, 5000, 2500 }); - registerCombRecipe(combExtraBee(75), - new ItemStack[] { OreDictUnifier.get(dust, Materials.Glowstone), drop }, - new int[] { 10000, 2500 }); - registerCombRecipe(combExtraBee(76), - new ItemStack[] { OreDictUnifier.get(dust, Materials.Saltpeter), drop }, - new int[] { 10000, 2500 }); - registerCombRecipe(combExtraBee(79), - new ItemStack[] { Mods.Forestry.getItem("fertilizer_bio"), drop }, - new int[] { 10000, 2500 }); - registerCombRecipe(combExtraBee(81), - new ItemStack[] { drop, new ItemStack(Items.QUARTZ), - OreDictUnifier.get(dust, Materials.CertusQuartz) }, - new int[] { 2500, 2500, 2000 }); - registerCombRecipe(combExtraBee(82), - new ItemStack[] { drop, OreDictUnifier.get(dust, Materials.EnderPearl) }, - new int[] { 2500, 2500 }); - } } public static void registerCombRecipe(ItemStack comb, ItemStack[] output, int[] chance) { @@ -253,8 +47,4 @@ public static void registerCombRecipe(ItemStack comb, ItemStack[] output, int[] builder.buildAndRegister(); } - - public static ItemStack combExtraBee(int meta) { - return Mods.ExtraBees.getItem("honey_comb", 1, meta); - } } diff --git a/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/GendustryConfigHolder.java b/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/GendustryConfigHolder.java index e79c902..2a1363e 100644 --- a/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/GendustryConfigHolder.java +++ b/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/GendustryConfigHolder.java @@ -9,4 +9,17 @@ @Config(modid = ModValues.MODID, name = ModValues.MODID + "/integration/" + Modules.MODULE_GENDUSTRY, category = "Gendustry") -public class GendustryConfigHolder {} +public class GendustryConfigHolder { + + @Config.Comment({ "If true, each will be uncraftable.", "default: false" }) + public static boolean MutagenProducer = false, + Mutatron = false, + IndustrialApiary = false, + GeneticImprinter = false, + GeneticSampler = false, + AdvancedMutagen = false, + ProteinLiquifier = false, + DNAExtractor = false, + GeneticTransposer = false, + GeneticReplicator = false; +} diff --git a/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/GendustryModule.java b/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/GendustryModule.java index 1a877ba..04e8a44 100644 --- a/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/GendustryModule.java +++ b/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/GendustryModule.java @@ -1,5 +1,6 @@ package com.github.gtexpert.gtbm.integration.gendustry; +import com.github.gtexpert.gtbm.integration.gendustry.recipes.GendustryCraftingRecipe; import net.minecraft.block.Block; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; @@ -14,11 +15,11 @@ import com.github.gtexpert.gtbm.module.Modules; @TModule( - moduleID = Modules.MODULE_GENDUSTRY, - containerID = ModValues.MODID, - modDependencies = { Mods.Names.FORESTRY, Mods.Names.GENDUSTRY }, - name = "GTBeesMatrix Gendustry For Minecraft Integration", - description = "Gendustry Integration Module") + moduleID = Modules.MODULE_GENDUSTRY, + containerID = ModValues.MODID, + modDependencies = { Mods.Names.FORESTRY, Mods.Names.GENDUSTRY }, + name = "GTBeesMatrix Gendustry For Minecraft Integration", + description = "Gendustry Integration Module") public class GendustryModule extends GTBMIntegrationSubmodule { @Override @@ -30,5 +31,6 @@ public void registerBlocks(RegistryEvent.Register event) { public void postInit(FMLPostInitializationEvent event) { GendustryItemsRecipe.init(); GendustryBlocksRecipe.init(); + GendustryCraftingRecipe.init(); } } diff --git a/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/recipes/GendustryCraftingRecipe.java b/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/recipes/GendustryCraftingRecipe.java new file mode 100644 index 0000000..8ec465d --- /dev/null +++ b/src/main/java/com/github/gtexpert/gtbm/integration/gendustry/recipes/GendustryCraftingRecipe.java @@ -0,0 +1,48 @@ +package com.github.gtexpert.gtbm.integration.gendustry.recipes; + +import static com.github.gtexpert.gtbm.api.util.ModUtility.*; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; + +import com.github.gtexpert.gtbm.integration.gendustry.GendustryConfigHolder; +import net.minecraft.item.ItemStack; + +import gregtech.api.recipes.ModHandler; + +import com.github.gtexpert.gtbm.api.util.Mods; + +public class GendustryCraftingRecipe { + + private static final String id = Mods.Names.GENDUSTRY; + + public static void init() { + recipeRemoval(); + } + + public static void recipeRemoval() { + Map, String> recipes = new HashMap<>(); + recipes.put(() -> GendustryConfigHolder.MutagenProducer, "mutagen_producer"); + recipes.put(() -> GendustryConfigHolder.Mutatron, "mutatron"); + recipes.put(() -> GendustryConfigHolder.IndustrialApiary, "industrial_apiary"); + recipes.put(() -> GendustryConfigHolder.GeneticImprinter, "genetic_imprinter"); + recipes.put(() -> GendustryConfigHolder.GeneticSampler, "sampler"); + recipes.put(() -> GendustryConfigHolder.AdvancedMutagen, "mutatron_advanced"); + recipes.put(() -> GendustryConfigHolder.ProteinLiquifier, "protein_liquifier"); + recipes.put(() -> GendustryConfigHolder.DNAExtractor, "dna_extractor"); + recipes.put(() -> GendustryConfigHolder.GeneticTransposer, "transposer"); + recipes.put(() -> GendustryConfigHolder.GeneticReplicator, "replicator"); + + recipes.forEach((config, name) -> { + if (config.get()) { + removeRecipeWithTooltip(Mods.Gendustry.getItem(name)); + } + }); + } + + private static void removeRecipeWithTooltip(ItemStack stack) { + disabledItems.add(stack); + ModHandler.removeRecipeByOutput(stack); + } +} diff --git a/src/main/resources/assets/gtbm/lang/en_us.lang b/src/main/resources/assets/gtbm/lang/en_us.lang new file mode 100644 index 0000000..ebe2d93 --- /dev/null +++ b/src/main/resources/assets/gtbm/lang/en_us.lang @@ -0,0 +1 @@ +gtbm.tooltip.warn.disabled_item=§l§dThis item is disabled!! diff --git a/src/main/resources/assets/gtbm/lang/ja_jp.lang b/src/main/resources/assets/gtbm/lang/ja_jp.lang new file mode 100644 index 0000000..3dc5900 --- /dev/null +++ b/src/main/resources/assets/gtbm/lang/ja_jp.lang @@ -0,0 +1 @@ +gtbm.tooltip.warn.disabled_item=§l§dこのアイテムは無効化されています!!