diff --git a/src/main/java/modtweaker2/ModTweaker2.java b/src/main/java/modtweaker2/ModTweaker2.java index c7b80eb..edc2be1 100644 --- a/src/main/java/modtweaker2/ModTweaker2.java +++ b/src/main/java/modtweaker2/ModTweaker2.java @@ -101,7 +101,6 @@ public class ModTweaker2 { public void serverStart(FMLServerStartingEvent event) { logger.info("Starting ServerStart for " + ModProps.modid); proxy.registerCommands(); - TweakerPlugin.hasInit = true; } } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Arcane.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Arcane.java index 4ef6ba3..cd14b3b 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Arcane.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Arcane.java @@ -25,13 +25,13 @@ import thaumcraft.api.crafting.ShapelessArcaneRecipe; public class Arcane { @ZenMethod public static void addShaped(String key, IItemStack output, String aspects, IIngredient[][] ingredients) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(new ShapedArcaneRecipe(key, toStack(output), ThaumcraftHelper.parseAspects(aspects), toShapedObjects(ingredients)))); } @ZenMethod public static void addShapeless(String key, IItemStack output, String aspects, IIngredient[] ingredients) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(new ShapelessArcaneRecipe(key, toStack(output), ThaumcraftHelper.parseAspects(aspects), toObjects(ingredients)))); } @@ -54,7 +54,6 @@ public class Arcane { @ZenMethod public static void removeRecipe(IItemStack output) { - if (!TweakerPlugin.hasInit()) MineTweakerAPI.apply(new Remove(toStack(output))); } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Aspects.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Aspects.java index bf83e2e..0d4d680 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Aspects.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Aspects.java @@ -23,13 +23,13 @@ public class Aspects { /** Add/Remove/Set Aspects for items **/ @ZenMethod public static void add(IItemStack stack, String aspects) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(toStack(stack), aspects, false)); } @ZenMethod public static void set(IItemStack stack, String aspects) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(toStack(stack), aspects, true)); } @@ -76,7 +76,7 @@ public class Aspects { @ZenMethod public static void remove(IItemStack stack, String aspects) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Remove(toStack(stack), aspects)); } @@ -124,7 +124,7 @@ public class Aspects { MineTweakerAPI.getLogger().logError("No such entity " + entityName); return; } - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddEntity(entityName, aspects, false)); } @@ -134,7 +134,7 @@ public class Aspects { MineTweakerAPI.getLogger().logError("No such entity " + entityName); return; } - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddEntity(entityName, aspects, true)); } @@ -185,7 +185,7 @@ public class Aspects { MineTweakerAPI.getLogger().logError("No such entity " + entityName); return; } - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new RemoveEntity(entityName, aspects)); } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Crucible.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Crucible.java index d441d20..29b0dd6 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Crucible.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Crucible.java @@ -20,7 +20,7 @@ import thaumcraft.api.crafting.CrucibleRecipe; public class Crucible { @ZenMethod public static void addRecipe(String key, IItemStack result, IIngredient catalyst, String aspects) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(new CrucibleRecipe(key, toStack(result), toObject(catalyst), ThaumcraftHelper.parseAspects(aspects)))); } @@ -39,7 +39,7 @@ public class Crucible { @ZenMethod public static void removeRecipe(IItemStack output) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Remove(toStack(output))); } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Infusion.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Infusion.java index 150028d..9515cd0 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Infusion.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Infusion.java @@ -23,7 +23,7 @@ import thaumcraft.api.crafting.InfusionRecipe; public class Infusion { @ZenMethod public static void addRecipe(String key, IItemStack input, IItemStack[] recipe, String aspects, IItemStack result, int instability) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(new InfusionRecipe(key, toStack(result), instability, ThaumcraftHelper.parseAspects(aspects), toStack(input), toStacks(recipe)))); } @@ -31,13 +31,13 @@ public class Infusion { // fuzzy or not @ZenMethod public static void addRecipe(String key, IItemStack input, IItemStack[] recipe, String aspects, IItemStack result, int instability, boolean fuzzyCentre, boolean[] fuzzyRecipe) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(new MTInfusionRecipe(key, toStack(result), instability, ThaumcraftHelper.parseAspects(aspects), toStack(input), toStacks(recipe), fuzzyCentre, fuzzyRecipe))); } @ZenMethod public static void addEnchantment(String key, int enchantID, int instability, String aspects, IItemStack[] recipe) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddEnchant(new InfusionEnchantmentRecipe(key, Enchantment.enchantmentsList[enchantID], instability, ThaumcraftHelper.parseAspects(aspects), toStacks(recipe)))); } @@ -98,13 +98,13 @@ public class Infusion { @ZenMethod public static void removeRecipe(IItemStack output) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Remove(toStack(output))); } @ZenMethod public static void removeEnchant(int id) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new RemoveEnchant(Enchantment.enchantmentsList[id])); } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Research.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Research.java index c2a277e..5fc8ca7 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Research.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Research.java @@ -52,170 +52,170 @@ public class Research { } private static void addTab(String key, ResourceLocation icon, ResourceLocation background) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddTab(key, icon, background)); } @ZenMethod public static void removeTab(String tab) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new RemoveTab(tab)); } @ZenMethod public static void removeResearch(String research) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new RemoveResearch(research)); } @ZenMethod public static void orphanResearch(String research) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new OrphanResearch(research)); } @ZenMethod public static void addResearch(String key, String tab, @Optional String aspects, int x, int y, int difficulty, String domain, String path) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddResearch(new ResearchItem(key, tab, ThaumcraftHelper.parseAspects(aspects), x, y, difficulty, new ResourceLocation(domain, path)))); } @ZenMethod public static void addResearch(String key, String tab, @Optional String aspects, int x, int y, int difficulty, IItemStack item) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddResearch(new ResearchItem(key, tab, ThaumcraftHelper.parseAspects(aspects), x, y, difficulty, toStack(item)))); } @ZenMethod public static void addPage(String key, String unlocalized) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddPage(key, PageType.TEXT, unlocalized)); } @ZenMethod public static void addCraftingPage(String key, IItemStack item) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddPage(key, PageType.NORMAL_CRAFTING, toStack(item))); } @ZenMethod public static void addCruciblePage(String key, IItemStack item) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddPage(key, PageType.CRUCIBLE_CRAFTING, toStack(item))); } @ZenMethod public static void addArcanePage(String key, IItemStack item) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddPage(key, PageType.ARCANE_CRAFTING, toStack(item))); } @ZenMethod public static void addInfusionPage(String key, IItemStack item) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddPage(key, PageType.INFUSION_CRAFTING, toStack(item))); } @ZenMethod public static void addEnchantmentPage(String key, int i) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddPage(key, PageType.INFUSION_ENCHANTMENT, Enchantment.enchantmentsList[i])); } @ZenMethod public static void clearPages(String key) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new ClearPages(key)); } @ZenMethod public static void addPrereq(String key, String req, @Optional boolean hidden) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddPrereq(key, req, hidden)); } @ZenMethod public static void clearPrereqs(String key) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new ClearPrereqs(key)); } @ZenMethod public static void addSibling(String key, String sibling) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new AddSibling(key, sibling)); } @ZenMethod public static void clearSiblings(String key) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new ClearSiblings(key)); } @ZenMethod public static void setRound(String key, boolean flag) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new SetResearch(key, flag, SetType.ROUND)); } @ZenMethod public static void setSpikey(String key, boolean flag) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new SetResearch(key, flag, SetType.SPIKE)); } @ZenMethod public static void setStub(String key, boolean flag) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new SetResearch(key, flag, SetType.STUB)); } @ZenMethod public static void setSecondary(String key, boolean flag) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new SetResearch(key, flag, SetType.SECONDARY)); } @ZenMethod public static void setVirtual(String key, boolean flag) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new SetResearch(key, flag, SetType.VIRTUAL)); } @ZenMethod public static void setAutoUnlock(String key, boolean flag) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new SetResearch(key, flag, SetType.AUTO)); } @ZenMethod public static void setConcealed(String key, boolean flag) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new SetResearch(key, flag, SetType.CONCEAL)); } @ZenMethod public static void setAspects(String key, String aspects) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new SetAspects(key, ThaumcraftHelper.parseAspects(aspects))); } @ZenMethod public static void setComplexity(String key, int complexity) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Difficulty(key, complexity)); } @ZenMethod public static void refreshResearchRecipe(String key) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new RefreshResearch(key)); } @ZenMethod public static void moveResearch(String key, String destination, int x, int y) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new MoveResearch(key, destination, x, y)); } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Warp.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Warp.java index 8713f56..300cab0 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Warp.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Warp.java @@ -21,13 +21,11 @@ public class Warp { @ZenMethod public static void addToResearch(String key, int warp) { - if (!TweakerPlugin.hasInit()) MineTweakerAPI.apply(new Add(key, warp)); } @ZenMethod public static void addToItem(IItemStack stack, int warp) { - if (!TweakerPlugin.hasInit()) MineTweakerAPI.apply(new Add(toStack(stack), warp)); } @@ -86,31 +84,26 @@ public class Warp { @ZenMethod public static void removeFromResearch(String key) { - if (!TweakerPlugin.hasInit()) MineTweakerAPI.apply(new Remove(key)); } @ZenMethod public static void removeFromItem(IItemStack stack) { - if (!TweakerPlugin.hasInit()) MineTweakerAPI.apply(new Remove(toStack(stack))); } @ZenMethod public static void removeAll() { - if (!TweakerPlugin.hasInit()) MineTweakerAPI.apply(new MassRemove(RemoveType.BOTH)); } @ZenMethod public static void removeAllResearch() { - if (!TweakerPlugin.hasInit()) MineTweakerAPI.apply(new MassRemove(RemoveType.RESEARCH)); } @ZenMethod public static void removeAllItems() { - if (!TweakerPlugin.hasInit()) MineTweakerAPI.apply(new MassRemove(RemoveType.ITEMS)); } diff --git a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Crucible.java b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Crucible.java index fe2d3a3..025f699 100644 --- a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Crucible.java +++ b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Crucible.java @@ -19,7 +19,7 @@ import cofh.thermalexpansion.util.crafting.CrucibleManager.RecipeCrucible; public class Crucible { @ZenMethod public static void addRecipe(int energy, IItemStack input, ILiquidStack output) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(energy, toStack(input), toFluid(output))); } @@ -65,7 +65,7 @@ public class Crucible { @ZenMethod public static void removeRecipe(IItemStack input) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Remove(toStack(input))); } diff --git a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Furnace.java b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Furnace.java index 6182819..8bceade 100644 --- a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Furnace.java +++ b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Furnace.java @@ -15,7 +15,7 @@ import cofh.thermalexpansion.util.crafting.FurnaceManager.RecipeFurnace; public class Furnace { @ZenMethod public static void addRecipe(int energy, IItemStack input, IItemStack output) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(energy, toStack(input), toStack(output))); } @@ -61,7 +61,7 @@ public class Furnace { @ZenMethod public static void removeRecipe(IItemStack input) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Remove(toStack(input))); } diff --git a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Pulverizer.java b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Pulverizer.java index 25d93a1..eebe53e 100644 --- a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Pulverizer.java +++ b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Pulverizer.java @@ -15,13 +15,13 @@ import cofh.thermalexpansion.util.crafting.PulverizerManager.RecipePulverizer; public class Pulverizer { @ZenMethod public static void addRecipe(int energy, IItemStack input, IItemStack output) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(energy, toStack(input), toStack(output), null, 0)); } @ZenMethod public static void addRecipe(int energy, IItemStack input, IItemStack output, IItemStack secondary, int secondaryChance) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(energy, toStack(input), toStack(output), toStack(secondary), secondaryChance)); } @@ -71,7 +71,7 @@ public class Pulverizer { @ZenMethod public static void removeRecipe(IItemStack input) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Remove(toStack(input))); } diff --git a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Sawmill.java b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Sawmill.java index d596844..2c19138 100644 --- a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Sawmill.java +++ b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Sawmill.java @@ -69,7 +69,7 @@ public class Sawmill { @ZenMethod public static void removeRecipe(IItemStack input) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Remove(toStack(input))); } diff --git a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Smelter.java b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Smelter.java index 54692e4..b729d4d 100644 --- a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Smelter.java +++ b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Smelter.java @@ -48,7 +48,7 @@ public class Smelter { ItemStack out1 = toStack(output); ItemStack out2 = toStack(output2); RecipeSmelter recipe = (RecipeSmelter) ThermalHelper.getTERecipe(ThermalHelper.smelterRecipe, in1, in2, out1, out2, chance, energy); - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(in1, in2, recipe)); } @@ -95,7 +95,7 @@ public class Smelter { @ZenMethod public static void removeRecipe(IItemStack input, IItemStack input2) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Remove(toStack(input), toStack(input2))); } diff --git a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Transposer.java b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Transposer.java index 09ffac0..5381d6a 100644 --- a/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Transposer.java +++ b/src/main/java/modtweaker2/mods/thermalexpansion/handlers/Transposer.java @@ -61,7 +61,7 @@ public class Transposer { ItemStack out = toStack(output); FluidStack fluid = toFluid(liquid); RecipeTransposer recipe = (RecipeTransposer) ThermalHelper.getTERecipe(ThermalHelper.transposerRecipe, in, out, fluid, energy, chance); - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Add(in, fluid, recipe, isFillRecipe)); } @@ -128,7 +128,7 @@ public class Transposer { @ZenMethod public static void removeRecipe(IItemStack input, ILiquidStack liquid, boolean isFillRecipe) { - if (!TweakerPlugin.hasInit()) + MineTweakerAPI.apply(new Remove(toStack(input), toFluid(liquid), isFillRecipe)); } diff --git a/src/main/java/modtweaker2/utils/TweakerPlugin.java b/src/main/java/modtweaker2/utils/TweakerPlugin.java index cff464f..c4b0d38 100644 --- a/src/main/java/modtweaker2/utils/TweakerPlugin.java +++ b/src/main/java/modtweaker2/utils/TweakerPlugin.java @@ -7,7 +7,6 @@ import cpw.mods.fml.common.Loader; public class TweakerPlugin { private static ArrayList isLoaded = new ArrayList(); - public static boolean hasInit = false; public static void register(String mod, Class clazz) { if (Loader.isModLoaded(mod)) { @@ -28,7 +27,4 @@ public class TweakerPlugin { return isLoaded.contains(string); } - public static boolean hasInit(){ - return hasInit; - } }