From 7b162009c287c8d85e750ce77f4a52a182f7d5fd Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Tue, 27 Sep 2016 17:50:34 +0100 Subject: [PATCH] Hide Quantum chest and tanks when quantumstorage is loaded --- src/main/java/techreborn/compat/CompatManager.java | 2 ++ .../techreborn/compat/jei/TechRebornJeiPlugin.java | 6 ++++++ src/main/java/techreborn/init/ModRecipes.java | 14 +++++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main/java/techreborn/compat/CompatManager.java b/src/main/java/techreborn/compat/CompatManager.java index caaeac3cc..8804716e6 100644 --- a/src/main/java/techreborn/compat/CompatManager.java +++ b/src/main/java/techreborn/compat/CompatManager.java @@ -21,11 +21,13 @@ public class CompatManager public static CompatManager INSTANCE = new CompatManager(); public static boolean isIC2Loaded = false; + public static boolean isQuantumStorageLoaded = false; public ArrayList compatModules = new ArrayList<>(); public CompatManager() { isIC2Loaded = Loader.isModLoaded("IC2"); + isQuantumStorageLoaded = Loader.isModLoaded("quantumstorage"); registerCompact(MinetweakerCompat.class, "MineTweaker3"); registerCompact(TechRebornParts.class, "reborncore-mcmultipart"); registerCompact(ClientPartLoader.class, "reborncore-mcmultipart", "@client"); diff --git a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java index f2991f4aa..55e97fa2a 100644 --- a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java +++ b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java @@ -16,6 +16,7 @@ import techreborn.api.recipe.machines.AssemblingMachineRecipe; import techreborn.api.recipe.machines.ImplosionCompressorRecipe; import techreborn.client.container.*; import techreborn.client.gui.*; +import techreborn.compat.CompatManager; import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeCategory; import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeHandler; import techreborn.compat.jei.assemblingMachine.AssemblingMachineRecipeCategory; @@ -256,5 +257,10 @@ import java.util.List; registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.pump)); + if(CompatManager.isQuantumStorageLoaded){ + registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.quantumChest)); + registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.quantumTank)); + } + } } diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 63c77ae6c..9aa0cdb12 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -12,6 +12,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.UniversalBucket; +import net.minecraftforge.fml.common.Loader; import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.ArrayUtils; import reborncore.api.recipe.RecipeHandler; @@ -27,6 +28,7 @@ import techreborn.api.recipe.RecyclerRecipe; import techreborn.api.recipe.ScrapboxRecipe; import techreborn.api.recipe.machines.*; import techreborn.blocks.*; +import techreborn.compat.CompatManager; import techreborn.config.ConfigTechReborn; import techreborn.items.*; import techreborn.parts.powerCables.ItemStandaloneCables; @@ -65,6 +67,8 @@ public class ModRecipes public static void init() { + //Done again incase we loaded before QuantumStorage + CompatManager.isQuantumStorageLoaded = Loader.isModLoaded("quantumstorage"); addShapelessRecipes(); addGeneralShapedRecipes(); addMachineRecipes(); @@ -1009,9 +1013,11 @@ public class ModRecipes static void addMachineRecipes() { - CraftingHelper + if(!CompatManager.isQuantumStorageLoaded){ + CraftingHelper .addShapedOreRecipe(new ItemStack(ModBlocks.quantumTank), "EPE", "PCP", "EPE", 'P', "ingotPlatinum", - 'E', "circuitAdvanced", 'C', ModBlocks.quantumChest); + 'E', "circuitAdvanced", 'C', ModBlocks.quantumChest); + } CraftingHelper .addShapedOreRecipe(new ItemStack(ModBlocks.digitalChest), "PPP", "PDP", "PCP", 'P', "plateAluminum", @@ -2242,10 +2248,12 @@ public class ModRecipes CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 2), "HHH", "CBC", "HHH", 'H', "ingotChrome", 'C', "circuitElite", 'B', BlockMachineFrame.getFrameByName("highlyAdvancedMachine", 1)); - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.quantumChest), "DCD", "ATA", "DQD", 'D', + if(!CompatManager.isQuantumStorageLoaded){ + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.quantumChest), "DCD", "ATA", "DQD", 'D', ItemParts.getPartByName("dataOrb"), 'C', ItemParts.getPartByName("computerMonitor"), 'A', BlockMachineFrame.getFrameByName("highlyAdvancedMachine", 1), 'Q', ModBlocks.digitalChest, 'T', ModBlocks.Compressor); + } CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.PlasmaGenerator), "PPP", "PTP", "CGC", 'P', ItemPlates.getPlateByName("tungstensteel"), 'T', getOre("hvTransformer"),