From 25ae719ab98d2942ae013f16dcae2fc1c22cd0f6 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sun, 30 Apr 2023 23:07:11 +0200 Subject: [PATCH] magic --- .../mods/botania/handlers/Apothecary.java | 28 ++ .../mods/chisel/handlers/Groups.java | 26 +- .../mods/extraUtils/handlers/QED.java | 37 ++- .../mods/forestry/ForestryListAddition.java | 2 +- .../mods/forestry/ForestryListRemoval.java | 2 +- .../mods/forestry/handlers/Carpenter.java | 58 +++- .../mods/forestry/handlers/Centrifuge.java | 13 + .../mods/forestry/handlers/Fermenter.java | 22 ++ .../mods/forestry/handlers/Squeezer.java | 35 +++ .../handlers/ThermionicFabricator.java | 46 ++- .../railcraft/handlers/RollingMachine.java | 40 ++- .../mods/tconstruct/handlers/Casting.java | 56 ++++ .../mods/tconstruct/handlers/Drying.java | 18 ++ .../mods/tconstruct/handlers/Smeltery.java | 72 +++++ .../mods/thaumcraft/Thaumcraft.java | 264 +++++++++++++++++- .../mods/thaumcraft/handlers/Arcane.java | 50 +++- .../mods/thaumcraft/handlers/Aspects.java | 7 + .../mods/thaumcraft/handlers/Crucible.java | 40 ++- .../mods/thaumcraft/handlers/Infusion.java | 63 +++++ .../mods/thaumcraft/handlers/Warp.java | 14 +- .../mods/thaumcraft/research/AddPage.java | 12 + .../mods/thaumcraft/research/AddPrereq.java | 2 + .../mods/thaumcraft/research/AddResearch.java | 21 ++ .../mods/thaumcraft/research/AddSibling.java | 2 + .../mods/thaumcraft/research/AddTab.java | 3 + .../mods/thaumcraft/research/ClearPages.java | 2 + .../thaumcraft/research/ClearPrereqs.java | 2 + .../thaumcraft/research/ClearSiblings.java | 2 + .../mods/thaumcraft/research/Difficulty.java | 2 + .../thaumcraft/research/MoveResearch.java | 2 + .../thaumcraft/research/OrphanResearch.java | 2 + .../thaumcraft/research/RefreshResearch.java | 2 + .../thaumcraft/research/RemoveResearch.java | 2 + .../mods/thaumcraft/research/RemoveTab.java | 2 + .../mods/thaumcraft/research/SetAspects.java | 2 + .../mods/thaumcraft/research/SetResearch.java | 34 ++- 36 files changed, 944 insertions(+), 43 deletions(-) diff --git a/src/main/java/modtweaker2/mods/botania/handlers/Apothecary.java b/src/main/java/modtweaker2/mods/botania/handlers/Apothecary.java index 0e7b2cc..44f8e8f 100644 --- a/src/main/java/modtweaker2/mods/botania/handlers/Apothecary.java +++ b/src/main/java/modtweaker2/mods/botania/handlers/Apothecary.java @@ -12,6 +12,7 @@ import minetweaker.MineTweakerAPI; import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; import modtweaker2.helpers.LogHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.utils.BaseListAddition; import modtweaker2.utils.BaseListRemoval; import stanhebben.zenscript.annotations.ZenClass; @@ -44,6 +45,21 @@ public class Apothecary { recipes.add(recipe); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (RecipePetals recipe : successful) { + Thaumcraft.info( + "BotaniaAPI.registerPetalRecipe(" + Thaumcraft.convertStack(recipe.getOutput()) + + ", " + + Thaumcraft.convertArrayInLine(recipe.getInputs().toArray(new Object[0])) + + ");"); + } + } + } + @Override public String getRecipeInfo(RecipePetals recipe) { return LogHelper.getStackDescription(recipe.getOutput()); @@ -83,6 +99,18 @@ public class Apothecary { super(Apothecary.name, BotaniaAPI.petalRecipes, recipes); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (RecipePetals recipe : successful) { + Thaumcraft.info( + "BotaniaHelper.removePetalRecipe(" + Thaumcraft.convertStack(recipe.getOutput()) + ");"); + } + } + } + @Override public String getRecipeInfo(RecipePetals recipe) { return LogHelper.getStackDescription(recipe.getOutput()); diff --git a/src/main/java/modtweaker2/mods/chisel/handlers/Groups.java b/src/main/java/modtweaker2/mods/chisel/handlers/Groups.java index 8f0f3ee..e9aa82f 100644 --- a/src/main/java/modtweaker2/mods/chisel/handlers/Groups.java +++ b/src/main/java/modtweaker2/mods/chisel/handlers/Groups.java @@ -4,6 +4,10 @@ import minetweaker.IUndoableAction; import minetweaker.MineTweakerAPI; import minetweaker.api.item.IItemStack; import modtweaker2.mods.chisel.ChiselHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; + +import net.minecraft.item.ItemStack; + import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenMethod; @@ -26,7 +30,7 @@ public class Groups { MineTweakerAPI.getLogger().logError("Can't create variation from " + stack); return; } - MineTweakerAPI.apply(new AddVariation(group, variation, stack.toString())); + MineTweakerAPI.apply(new AddVariation(group, variation, stack.toString(), stack)); } static class AddVariation implements IUndoableAction { @@ -34,16 +38,23 @@ public class Groups { ICarvingGroup group; ICarvingVariation variation; String variationName; + IItemStack stack; - public AddVariation(ICarvingGroup group, ICarvingVariation variation, String variationName) { + public AddVariation(ICarvingGroup group, ICarvingVariation variation, String variationName, IItemStack stack) { this.group = group; this.variation = variation; this.variationName = variationName; + this.stack = stack; } @Override public void apply() { CarvingUtils.getChiselRegistry().addVariation(group.getName(), variation); + Thaumcraft.info( + "ChiselHelper.addVariationFromStack(\"" + group.getName() + + "\", " + + Thaumcraft.convertStack((ItemStack) stack.getInternal()) + + ");"); } @Override @@ -79,7 +90,7 @@ public class Groups { MineTweakerAPI.getLogger().logError("Can't find variation from " + stack); return; } - MineTweakerAPI.apply(new RemoveVariation(variation, stack.toString())); + MineTweakerAPI.apply(new RemoveVariation(variation, stack.toString(), stack)); } static class RemoveVariation implements IUndoableAction { @@ -87,16 +98,21 @@ public class Groups { ICarvingVariation variation; String variationName; ICarvingGroup group; + IItemStack stack; - public RemoveVariation(ICarvingVariation variation, String variationName) { + public RemoveVariation(ICarvingVariation variation, String variationName, IItemStack stack) { this.variation = variation; this.variationName = variationName; + this.stack = stack; } @Override public void apply() { group = CarvingUtils.getChiselRegistry().getGroup(variation.getBlock(), variation.getBlockMeta()); CarvingUtils.getChiselRegistry().removeVariation(variation.getBlock(), variation.getBlockMeta()); + Thaumcraft.info( + "ChiselHelper.removeVariationStack(" + Thaumcraft.convertStack((ItemStack) stack.getInternal()) + + ");"); } @Override @@ -147,6 +163,7 @@ public class Groups { @Override public void apply() { CarvingUtils.getChiselRegistry().addGroup(group); + Thaumcraft.info("ChiselHelper.addGroup(\"" + group.getName() + "\");"); } @Override @@ -196,6 +213,7 @@ public class Groups { @Override public void apply() { CarvingUtils.getChiselRegistry().removeGroup(group.getName()); + Thaumcraft.info("CarvingUtils.getChiselRegistry().removeGroup(\"" + group.getName() + "\");"); } @Override diff --git a/src/main/java/modtweaker2/mods/extraUtils/handlers/QED.java b/src/main/java/modtweaker2/mods/extraUtils/handlers/QED.java index 33bcc0c..444cfa3 100644 --- a/src/main/java/modtweaker2/mods/extraUtils/handlers/QED.java +++ b/src/main/java/modtweaker2/mods/extraUtils/handlers/QED.java @@ -10,6 +10,7 @@ import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; import modtweaker2.helpers.InputHelper; import modtweaker2.helpers.LogHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.utils.BaseListAddition; import modtweaker2.utils.BaseListRemoval; @@ -28,15 +29,32 @@ public class QED { @ZenMethod public static void addShapedRecipe(IItemStack output, IIngredient[][] recipe) { - MineTweakerAPI - .apply(new Add(new ShapedOreRecipe(InputHelper.toStack(output), InputHelper.toShapedObjects(recipe)))); + MineTweakerAPI.apply( + new Add( + new ShapedOreRecipe(InputHelper.toStack(output), InputHelper.toShapedObjects(recipe)), + InputHelper.toShapedObjects(recipe))); } private static class Add extends BaseListAddition { - public Add(IRecipe recipe) { + Object[] rawRecipe; + + public Add(IRecipe recipe, Object[] rawRecipe) { super("QED", EnderConstructorRecipesHandler.recipes); recipes.add(recipe); + this.rawRecipe = rawRecipe; + } + + @Override + public void apply() { + super.apply(); + if (!successful.isEmpty()) { + for (IRecipe recipe : successful) { + Thaumcraft.info( + "EnderConstructorRecipesHandler.addRecipe(" + Thaumcraft.convertStack( + recipe.getRecipeOutput()) + ", " + Thaumcraft.convertArrayInLine(rawRecipe) + ");"); + } + } } @Override @@ -73,6 +91,19 @@ public class QED { super("QED", EnderConstructorRecipesHandler.recipes, stacks); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (IRecipe recipe : successful) { + Thaumcraft.info( + "ExtraUtilitiesHelper.removeQEDRecipe(" + Thaumcraft.convertStack(recipe.getRecipeOutput()) + + ");"); + } + } + } + @Override protected String getRecipeInfo(IRecipe recipe) { return recipe.toString(); diff --git a/src/main/java/modtweaker2/mods/forestry/ForestryListAddition.java b/src/main/java/modtweaker2/mods/forestry/ForestryListAddition.java index 25a26c9..c132958 100644 --- a/src/main/java/modtweaker2/mods/forestry/ForestryListAddition.java +++ b/src/main/java/modtweaker2/mods/forestry/ForestryListAddition.java @@ -27,7 +27,7 @@ public abstract class ForestryListAddition { - public Add(ICarpenterRecipe recipe) { + Object[] rawRecipe; + + public Add(ICarpenterRecipe recipe, Object[] rawRecipe) { super(Carpenter.name, RecipeManagers.carpenterManager); recipes.add(recipe); + this.rawRecipe = rawRecipe; + } + + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (ICarpenterRecipe recipe : successful) { + Thaumcraft.info( + "RecipeManagers.carpenterManager.addRecipe(" + recipe.getPackagingTime() + + ", " + + Thaumcraft.convertFluidStack(recipe.getFluidResource()) + + ", " + + Thaumcraft.convertStack(recipe.getBox()) + + ", " + + Thaumcraft.convertStack(recipe.getCraftingGridRecipe().getRecipeOutput()) + + ", " + + Thaumcraft.convertArrayInLine(rawRecipe) + + ");"); + } + } } @Override @@ -157,6 +189,20 @@ public class Carpenter { super(Carpenter.name, RecipeManagers.carpenterManager, recipes); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (ICarpenterRecipe recipe : successful) { + Thaumcraft.info( + "ForestryHelper.removeCarpenterRecipe(" + + Thaumcraft.convertStack(recipe.getCraftingGridRecipe().getRecipeOutput()) + + ");"); + } + } + } + @Override protected String getRecipeInfo(ICarpenterRecipe recipe) { return LogHelper.getStackDescription(recipe.getCraftingGridRecipe().getRecipeOutput()); diff --git a/src/main/java/modtweaker2/mods/forestry/handlers/Centrifuge.java b/src/main/java/modtweaker2/mods/forestry/handlers/Centrifuge.java index 08848e4..ab14d76 100644 --- a/src/main/java/modtweaker2/mods/forestry/handlers/Centrifuge.java +++ b/src/main/java/modtweaker2/mods/forestry/handlers/Centrifuge.java @@ -17,6 +17,7 @@ import modtweaker2.helpers.LogHelper; import modtweaker2.mods.forestry.ForestryListAddition; import modtweaker2.mods.forestry.ForestryListRemoval; import modtweaker2.mods.forestry.recipes.CentrifugeRecipe; +import modtweaker2.mods.thaumcraft.Thaumcraft; import net.minecraft.item.ItemStack; @@ -105,6 +106,18 @@ public class Centrifuge { super(Centrifuge.name, RecipeManagers.centrifugeManager, recipes); } + @Override + public void apply() { + super.apply(); + if (!successful.isEmpty()) { + for (ICentrifugeRecipe recipe : successful) { + Thaumcraft.info( + "ForestryHelper.removeCentrifugeRecipe(" + Thaumcraft.convertStack(recipe.getInput()) + + ");"); + } + } + } + @Override protected String getRecipeInfo(ICentrifugeRecipe recipe) { return LogHelper.getStackDescription(recipe.getInput()); diff --git a/src/main/java/modtweaker2/mods/forestry/handlers/Fermenter.java b/src/main/java/modtweaker2/mods/forestry/handlers/Fermenter.java index 0145eff..415e01c 100644 --- a/src/main/java/modtweaker2/mods/forestry/handlers/Fermenter.java +++ b/src/main/java/modtweaker2/mods/forestry/handlers/Fermenter.java @@ -21,6 +21,7 @@ import modtweaker2.helpers.LogHelper; import modtweaker2.mods.forestry.ForestryListAddition; import modtweaker2.mods.forestry.ForestryListRemoval; import modtweaker2.mods.forestry.recipes.FermenterRecipe; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.utils.BaseMapAddition; import modtweaker2.utils.BaseMapRemoval; @@ -86,6 +87,27 @@ public class Fermenter { recipes.add(recipe); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (IFermenterRecipe recipe : successful) { + Thaumcraft.info( + "RecipeManagers.fermenterManager.addRecipe(" + Thaumcraft.convertStack(recipe.getResource()) + + ", " + + recipe.getFermentationValue() + + ", " + + recipe.getModifier() + + ", " + + Thaumcraft.convertFluidStack(recipe.getOutput()) + + ", " + + Thaumcraft.convertFluidStack(recipe.getFluidResource()) + + ");"); + } + } + } + @Override public String getRecipeInfo(IFermenterRecipe recipe) { return LogHelper.getStackDescription(recipe.getOutput()); diff --git a/src/main/java/modtweaker2/mods/forestry/handlers/Squeezer.java b/src/main/java/modtweaker2/mods/forestry/handlers/Squeezer.java index 7c80f10..c3d5ca0 100644 --- a/src/main/java/modtweaker2/mods/forestry/handlers/Squeezer.java +++ b/src/main/java/modtweaker2/mods/forestry/handlers/Squeezer.java @@ -19,6 +19,7 @@ import modtweaker2.helpers.LogHelper; import modtweaker2.mods.forestry.ForestryListAddition; import modtweaker2.mods.forestry.ForestryListRemoval; import modtweaker2.mods.forestry.recipes.SqueezerRecipe; +import modtweaker2.mods.thaumcraft.Thaumcraft; import stanhebben.zenscript.annotations.Optional; import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenMethod; @@ -88,6 +89,26 @@ public class Squeezer { recipes.add(recipe); } + @Override + public void apply() { + super.apply(); + if (!successful.isEmpty()) { + for (ISqueezerRecipe recipe : successful) { + Thaumcraft.info( + "RecipeManagers.squeezerManager.addRecipe(" + recipe.getProcessingTime() + + ", " + + Thaumcraft.convertStacks(recipe.getResources()) + + ", " + + Thaumcraft.convertFluidStack(recipe.getFluidOutput()) + + ", " + + Thaumcraft.convertStack(recipe.getRemnants()) + + ", " + + recipe.getRemnantsChance() + + ");"); + } + } + } + @Override public String getRecipeInfo(ISqueezerRecipe recipe) { return LogHelper.getStackDescription(recipe.getFluidOutput()); @@ -144,6 +165,20 @@ public class Squeezer { super(Squeezer.name, RecipeManagers.squeezerManager, recipes); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (ISqueezerRecipe recipe : successful) { + Thaumcraft.info( + "ForestryHelper.removeSqueezerRecipe(" + + Thaumcraft.convertFluidStack(recipe.getFluidOutput()) + + ");"); + } + } + } + @Override public String getRecipeInfo(ISqueezerRecipe recipe) { return LogHelper.getStackDescription(recipe.getFluidOutput()); diff --git a/src/main/java/modtweaker2/mods/forestry/handlers/ThermionicFabricator.java b/src/main/java/modtweaker2/mods/forestry/handlers/ThermionicFabricator.java index 5274689..1b74764 100644 --- a/src/main/java/modtweaker2/mods/forestry/handlers/ThermionicFabricator.java +++ b/src/main/java/modtweaker2/mods/forestry/handlers/ThermionicFabricator.java @@ -16,6 +16,7 @@ import modtweaker2.mods.forestry.ForestryListRemoval; import modtweaker2.mods.forestry.recipes.DescriptiveRecipe; import modtweaker2.mods.forestry.recipes.FabricatorRecipe; import modtweaker2.mods.forestry.recipes.FabricatorSmeltingRecipe; +import modtweaker2.mods.thaumcraft.Thaumcraft; import net.minecraftforge.fluids.FluidRegistry; @@ -85,7 +86,8 @@ public class ThermionicFabricator { IDescriptiveRecipe recipe = new DescriptiveRecipe(3, 3, toShapedObjects(ingredients), toStack(output), false); MineTweakerAPI.apply( new AddCast( - new FabricatorRecipe(toStack(plan), FluidRegistry.getFluidStack("glass", fluidInput), recipe))); + new FabricatorRecipe(toStack(plan), FluidRegistry.getFluidStack("glass", fluidInput), recipe), + toShapedObjects(ingredients))); } @Deprecated @@ -93,7 +95,10 @@ public class ThermionicFabricator { public static void addCast(ILiquidStack fluidInput, IIngredient[][] ingredients, IItemStack plan, IItemStack output) { IDescriptiveRecipe recipe = new DescriptiveRecipe(3, 3, toShapedObjects(ingredients), toStack(output), false); - MineTweakerAPI.apply(new AddCast(new FabricatorRecipe(toStack(plan), toFluid(fluidInput), recipe))); + MineTweakerAPI.apply( + new AddCast( + new FabricatorRecipe(toStack(plan), toFluid(fluidInput), recipe), + toShapedObjects(ingredients))); } /* @@ -115,9 +120,31 @@ public class ThermionicFabricator { private static class AddCast extends ForestryListAddition { - public AddCast(IFabricatorRecipe recipe) { + Object[] rawRecipe; + + public AddCast(IFabricatorRecipe recipe, Object[] rawRecipe) { super(ThermionicFabricator.nameCasting, RecipeManagers.fabricatorManager); recipes.add(recipe); + this.rawRecipe = rawRecipe; + } + + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (IFabricatorRecipe recipe : successful) { + Thaumcraft.info( + "RecipeManagers.fabricatorManager.addRecipe(" + Thaumcraft.convertStack(recipe.getPlan()) + + ", " + + Thaumcraft.convertFluidStack(recipe.getLiquid()) + + ", " + + Thaumcraft.convertStack(recipe.getRecipeOutput()) + + ", " + + Thaumcraft.convertArrayInLine(rawRecipe) + + ");"); + } + } } @Override @@ -211,6 +238,19 @@ public class ThermionicFabricator { super(ThermionicFabricator.nameCasting, RecipeManagers.fabricatorManager, recipes); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (IFabricatorRecipe recipe : successful) { + Thaumcraft.info( + "ForestryHelper.removeFabricatorRecipe(" + Thaumcraft.convertStack(recipe.getRecipeOutput()) + + ");"); + } + } + } + @Override public String getRecipeInfo(IFabricatorRecipe recipe) { return LogHelper.getStackDescription(recipe.getRecipeOutput()); diff --git a/src/main/java/modtweaker2/mods/railcraft/handlers/RollingMachine.java b/src/main/java/modtweaker2/mods/railcraft/handlers/RollingMachine.java index 9a45eaf..a7aab44 100644 --- a/src/main/java/modtweaker2/mods/railcraft/handlers/RollingMachine.java +++ b/src/main/java/modtweaker2/mods/railcraft/handlers/RollingMachine.java @@ -11,6 +11,7 @@ import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; import modtweaker2.helpers.LogHelper; import modtweaker2.mods.railcraft.RailcraftHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.utils.BaseCraftingAddition; import modtweaker2.utils.BaseCraftingRemoval; @@ -30,19 +31,39 @@ public class RollingMachine { @ZenMethod public static void addShaped(IItemStack output, IIngredient[][] ingredients) { - MineTweakerAPI.apply(new Add(new ShapedOreRecipe(toStack(output), toShapedObjects(ingredients)))); + MineTweakerAPI.apply( + new Add( + new ShapedOreRecipe(toStack(output), toShapedObjects(ingredients)), + toShapedObjects(ingredients))); } @ZenMethod public static void addShapeless(IItemStack output, IIngredient[] ingredients) { - MineTweakerAPI.apply(new Add(new ShapelessOreRecipe(toStack(output), toObjects(ingredients)))); + MineTweakerAPI.apply( + new Add(new ShapelessOreRecipe(toStack(output), toObjects(ingredients)), toObjects(ingredients))); } private static class Add extends BaseCraftingAddition { - public Add(IRecipe recipe) { + Object[] rawRecipe; + + public Add(IRecipe recipe, Object[] rawRecipe) { super(RollingMachine.name, RailcraftHelper.rolling); recipes.add(recipe); + this.rawRecipe = rawRecipe; + } + + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (IRecipe recipe : successful) { + Thaumcraft.info( + "RailcraftCraftingManager.rollingMachine.addRecipe(" + Thaumcraft.convertStack( + recipe.getRecipeOutput()) + ", " + Thaumcraft.convertArrayInLine(rawRecipe) + ");"); + } + } } } @@ -68,5 +89,18 @@ public class RollingMachine { public Remove(List recipes) { super(RollingMachine.name, RailcraftHelper.rolling, recipes); } + + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (IRecipe recipe : successful) { + Thaumcraft.info( + "RailcraftHelper.removeRollingRecipe(" + Thaumcraft.convertStack(recipe.getRecipeOutput()) + + ");"); + } + } + } } } diff --git a/src/main/java/modtweaker2/mods/tconstruct/handlers/Casting.java b/src/main/java/modtweaker2/mods/tconstruct/handlers/Casting.java index b6bdd70..0577cec 100644 --- a/src/main/java/modtweaker2/mods/tconstruct/handlers/Casting.java +++ b/src/main/java/modtweaker2/mods/tconstruct/handlers/Casting.java @@ -17,6 +17,7 @@ import minetweaker.api.item.IngredientAny; import minetweaker.api.liquid.ILiquidStack; import modtweaker2.helpers.LogHelper; import modtweaker2.mods.tconstruct.TConstructHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.utils.BaseListAddition; import modtweaker2.utils.BaseListRemoval; import stanhebben.zenscript.annotations.Optional; @@ -68,6 +69,44 @@ public class Casting { this.recipes.add(recipe); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (CastingRecipe recipe : successful) { + if (list == TConstructHelper.basinCasting) { + Thaumcraft.info( + "TConstructRegistry.getBasinCasting().addCastingRecipe(" + + Thaumcraft.convertStack(recipe.output) + + ", " + + Thaumcraft.convertFluidStack(recipe.castingMetal) + + ", " + + Thaumcraft.convertStack(recipe.cast) + + ", " + + (recipe.consumeCast ? "true" : "false") + + ", " + + recipe.coolTime + + ");"); + + } else if (list == TConstructHelper.tableCasting) { + Thaumcraft.info( + "TConstructRegistry.getTableCasting().addCastingRecipe(" + + Thaumcraft.convertStack(recipe.output) + + ", " + + Thaumcraft.convertFluidStack(recipe.castingMetal) + + ", " + + Thaumcraft.convertStack(recipe.cast) + + ", " + + (recipe.consumeCast ? "true" : "false") + + ", " + + recipe.coolTime + + ");"); + } + } + } + } + @Override protected String getRecipeInfo(CastingRecipe recipe) { return LogHelper.getStackDescription(recipe.output); @@ -144,6 +183,23 @@ public class Casting { super(Casting.name, list, recipes); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (CastingRecipe recipe : successful) { + if (list == TConstructHelper.basinCasting) { + Thaumcraft.info( + "TConstructHelper.removeBasinRecipe(" + Thaumcraft.convertStack(recipe.output) + ");"); + } else if (list == TConstructHelper.tableCasting) { + Thaumcraft.info( + "TConstructHelper.removeTableRecipe(" + Thaumcraft.convertStack(recipe.output) + ");"); + } + } + } + } + @Override protected String getRecipeInfo(CastingRecipe recipe) { return LogHelper.getStackDescription(recipe.output); diff --git a/src/main/java/modtweaker2/mods/tconstruct/handlers/Drying.java b/src/main/java/modtweaker2/mods/tconstruct/handlers/Drying.java index 65d7507..9ca44ab 100644 --- a/src/main/java/modtweaker2/mods/tconstruct/handlers/Drying.java +++ b/src/main/java/modtweaker2/mods/tconstruct/handlers/Drying.java @@ -11,6 +11,7 @@ import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; import modtweaker2.helpers.LogHelper; import modtweaker2.mods.tconstruct.TConstructHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.utils.BaseListAddition; import modtweaker2.utils.BaseListRemoval; import stanhebben.zenscript.annotations.ZenClass; @@ -43,6 +44,23 @@ public class Drying { this.recipes.add(recipe); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (DryingRecipe recipe : successful) { + Thaumcraft.info( + "DryingRackRecipes.addDryingRecipe(" + Thaumcraft.convertStack(recipe.input) + + ", " + + recipe.time + + ", " + + Thaumcraft.convertStack(recipe.result) + + ");"); + } + } + } + @Override protected String getRecipeInfo(DryingRecipe recipe) { return LogHelper.getStackDescription(recipe.result); diff --git a/src/main/java/modtweaker2/mods/tconstruct/handlers/Smeltery.java b/src/main/java/modtweaker2/mods/tconstruct/handlers/Smeltery.java index a259f92..b1dd170 100644 --- a/src/main/java/modtweaker2/mods/tconstruct/handlers/Smeltery.java +++ b/src/main/java/modtweaker2/mods/tconstruct/handlers/Smeltery.java @@ -23,6 +23,7 @@ import minetweaker.api.item.IItemStack; import minetweaker.api.liquid.ILiquidStack; import modtweaker2.helpers.LogHelper; import modtweaker2.mods.tconstruct.TConstructHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.utils.BaseListAddition; import modtweaker2.utils.BaseListRemoval; import modtweaker2.utils.BaseMapAddition; @@ -69,6 +70,21 @@ public class Smeltery { this.recipes.add(recipe); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (AlloyMix recipe : successful) { + Thaumcraft.info( + "Smeltery.addAlloyMixing(" + Thaumcraft.convertFluidStack(recipe.result) + + ", " + + Thaumcraft.convertArrayInLine(recipe.mixers.toArray(new FluidStack[0])) + + ");"); + } + } + } + @Override protected String getRecipeInfo(AlloyMix recipe) { return LogHelper.getStackDescription(recipe.result); @@ -105,6 +121,19 @@ public class Smeltery { super(nameAlloy, TConstructHelper.alloys, recipes); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (AlloyMix recipe : successful) { + Thaumcraft.info( + "TConstructHelper.removeSmelterAlloyMix(" + Thaumcraft.convertFluidStack(recipe.result) + + ");"); + } + } + } + @Override protected String getRecipeInfo(AlloyMix recipe) { return LogHelper.getStackDescription(recipe.result); @@ -167,6 +196,19 @@ public class Smeltery { recipe.temperature, recipe.fluid); successful.add(recipe); + + Thaumcraft.info( + "Smeltery.addMelting(" + Thaumcraft.convertStack(recipe.input) + + ", " + + Thaumcraft.convertBlock(recipe.getRendererBlock()) + + ", " + + recipe.getRendererMeta() + + ", " + + recipe.temperature + + ", " + + Thaumcraft.convertFluidStack(recipe.fluid) + + ");"); + } } @@ -226,6 +268,8 @@ public class Smeltery { TConstructHelper.renderIndex.remove(recipe.meta); successful.add(recipe); + + Thaumcraft.info("TConstructHelper.removeMeltingRecipe(" + Thaumcraft.convertStack(recipe.input) + ");"); } } @@ -303,6 +347,17 @@ public class Smeltery { super(Smeltery.nameFuel, TConstructHelper.fuelList, recipes); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (Entry recipe : successful.entrySet()) { + Thaumcraft.info("TConstructHelper.removeFuel(" + Thaumcraft.convertFluid(recipe.getKey()) + ");"); + } + } + } + @Override public String getRecipeInfo(Entry recipe) { return LogHelper.getStackDescription(new FluidStack(recipe.getKey(), 1)); @@ -331,6 +386,23 @@ public class Smeltery { super(Smeltery.nameFuel, TConstructHelper.fuelList, recipes); } + @Override + public void apply() { + super.apply(); + + if (!successful.isEmpty()) { + for (Entry recipe : successful.entrySet()) { + Thaumcraft.info( + "Smeltery.addSmelteryFuel(" + Thaumcraft.convertFluid(recipe.getKey()) + + ", " + + recipe.getValue()[0] + + ", " + + recipe.getValue()[1] + + ");"); + } + } + } + @Override public String getRecipeInfo(Entry recipe) { return LogHelper.getStackDescription(new FluidStack(recipe.getKey(), 1)); diff --git a/src/main/java/modtweaker2/mods/thaumcraft/Thaumcraft.java b/src/main/java/modtweaker2/mods/thaumcraft/Thaumcraft.java index 2da6342..ac8b98d 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/Thaumcraft.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/Thaumcraft.java @@ -1,5 +1,8 @@ package modtweaker2.mods.thaumcraft; +import java.util.Iterator; +import java.util.Map; + import minetweaker.MineTweakerAPI; import modtweaker2.mods.thaumcraft.aspect.AspectBracketHandler; import modtweaker2.mods.thaumcraft.handlers.Arcane; @@ -10,16 +13,263 @@ import modtweaker2.mods.thaumcraft.handlers.Loot; import modtweaker2.mods.thaumcraft.handlers.Research; import modtweaker2.mods.thaumcraft.handlers.Warp; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import cpw.mods.fml.common.registry.GameRegistry; + public class Thaumcraft { + private static final Logger TCLOG = LogManager.getLogger("[SCRIPTS TO CODE TRANSLATOR]"); + public static String addingResearch = null; + public static int setting = 0; + public static int wasSettingBefore = 0; + + public static void info(String s) { + if (addingResearch != null) { + if (setting != 0) TCLOG.info(")"); + TCLOG.info(".registerResearchItem();"); + addingResearch = null; + } + TCLOG.info(s); + addingResearch = null; + setting = 0; + wasSettingBefore = 0; + } + + public static void researchInfo(String r, String s) { + if (addingResearch == null || !addingResearch.equals(r)) { + info("ResearchCategories.getResearch(\"" + r + "\")" + s + ";"); + return; + } + if (setting != 0) { + wasSettingBefore |= setting; + setting = 0; + TCLOG.info(")"); + } + TCLOG.info(s); + } + + public static void addPageInfo(String r, String s) { + final int setID = 0b1; + if (addingResearch == null || !addingResearch.equals(r)) { + info("TCHelper.addResearchPage(\"" + r + "\", " + s + ");"); + return; + } + if ((setting & setID) == 0) { + if ((wasSettingBefore & setID) != 0) { + info("TCHelper.addResearchPage(\"" + r + "\", " + s + ");"); + return; + } + if (setting != 0) { + wasSettingBefore |= setting; + setting = 0; + TCLOG.info(")"); + } + setting = setID; + TCLOG.info(".setPages(" + s); + } else TCLOG.info(", " + s); + } + + public static void addPrereq(String r, String s, boolean hidden) { + if (hidden) addPrereqHidden(r, s); + else addPrereqNormal(r, s); + } + + public static void addPrereqNormal(String r, String s) { + final int setID = 0b10; + if (addingResearch == null || !addingResearch.equals(r)) { + info("TCHelper.addResearchPrereq(\"" + r + "\", " + s + ", false);"); + return; + } + if ((setting & setID) == 0) { + if ((wasSettingBefore & setID) != 0) { + info("TCHelper.addResearchPrereq(\"" + addingResearch + "\", " + s + ", false);"); + return; + } + if (setting != 0) { + wasSettingBefore |= setting; + setting = 0; + TCLOG.info(")"); + } + setting = setID; + TCLOG.info(".setParents(" + s); + } else TCLOG.info(", " + s); + } + + public static void addPrereqHidden(String r, String s) { + final int setID = 0b100; + if (addingResearch == null || !addingResearch.equals(r)) { + info("TCHelper.addResearchPrereq(\"" + r + "\", " + s + ", true);"); + return; + } + if ((setting & setID) == 0) { + if ((wasSettingBefore & setID) != 0) { + info("TCHelper.addResearchPrereq(\"" + addingResearch + "\", " + s + ", true);"); + return; + } + if (setting != 0) { + wasSettingBefore |= setting; + setting = 0; + TCLOG.info(")"); + } + setting = setID; + TCLOG.info(".setParentsHidden(" + s); + } else TCLOG.info(", " + s); + } + + public static void addSibling(String r, String s) { + final int setID = 0b1000; + if (addingResearch == null || !addingResearch.equals(r)) { + info("TCHelper.addResearchSibling(\"" + r + "\", " + s + ");"); + return; + } + if ((setting & setID) == 0) { + if ((wasSettingBefore & setID) != 0) { + info("TCHelper.addResearchSibling(\"" + addingResearch + "\", " + s + ");"); + return; + } + if (setting != 0) { + wasSettingBefore |= setting; + setting = 0; + TCLOG.info(")"); + } + setting = setID; + TCLOG.info(".setSiblings(" + s); + } else TCLOG.info(", " + s); + } + + public static String convertBlock(Block block) { + if (block == null) return "null"; + GameRegistry.UniqueIdentifier itemIdentifier = GameRegistry.findUniqueIdentifierFor(block); + return "GameRegistry.findBlock(\"" + itemIdentifier.modId + "\", \"" + itemIdentifier.name + "\")"; + } + + public static String convertStack(ItemStack stack) { + if (stack == null) return "null"; + GameRegistry.UniqueIdentifier itemIdentifier = GameRegistry.findUniqueIdentifierFor(stack.getItem()); + int meta = stack.getItemDamage(); + int size = stack.stackSize; + NBTTagCompound tagCompound = stack.stackTagCompound; + if (tagCompound == null || tagCompound.hasNoTags()) { + return "getModItem(\"" + itemIdentifier.modId + + "\", \"" + + itemIdentifier.name + + "\", " + + size + + ", " + + meta + + ", missing)"; + } else { + return "createItemStack(\"" + itemIdentifier.modId + + "\", \"" + + itemIdentifier.name + + "\", " + + size + + ", " + + meta + + ", " + + "\"" + + tagCompound.toString().replace("\"", "\\\"") + + "\"" + + ", missing)"; + } + } + + public static String convertStacks(ItemStack[] list) { + StringBuilder stacks = new StringBuilder("new ItemStack[]{"); + for (ItemStack stack : list) { + stacks.append(convertStack(stack)).append(", "); + } + stacks.append("}"); + return stacks.toString(); + } + + public static String convertAspects(AspectList list) { + StringBuilder aspects = new StringBuilder("new AspectList()"); + for (Map.Entry aspect : list.aspects.entrySet()) { + aspects.append(".add(Aspect.getAspect(\"").append(aspect.getKey().getTag()).append("\"), ") + .append(aspect.getValue()).append(")"); + } + return aspects.toString(); + } + + public static String convertAspectsInLine(AspectList list) { + StringBuilder aspects = new StringBuilder(); + for (Iterator> iterator = list.aspects.entrySet().iterator(); iterator.hasNext();) { + Map.Entry aspect = iterator.next(); + aspects.append("Aspect.getAspect(\"").append(aspect.getKey().getTag()).append("\")"); + if (iterator.hasNext()) aspects.append(", "); + } + return aspects.toString(); + } + + public static String convertArray(Object[] arr) { + StringBuilder arrayString = new StringBuilder("new Object[] {"); + for (Object o : arr) { + if (o instanceof String) arrayString.append((String) o); + else if (o instanceof ItemStack) arrayString.append(convertStack((ItemStack) o)); + else arrayString.append(o); + arrayString.append(", "); + } + arrayString.append("}"); + return arrayString.toString(); + } + + public static String convertArray(String[] arr) { + StringBuilder arrayString = new StringBuilder("new String[] {"); + for (String o : arr) { + arrayString.append("\"").append(o).append("\"").append(", "); + } + arrayString.append("}"); + return arrayString.toString(); + } + + public static String convertArrayInLine(Object[] arr) { + StringBuilder arrayString = new StringBuilder(); + for (int i = 0, arrLength = arr.length; i < arrLength; i++) { + Object o = arr[i]; + if (o instanceof String) arrayString.append("\"").append((String) o).append("\""); + else if (o instanceof Character) arrayString.append("'").append((char) o).append("'"); + else if (o instanceof ItemStack) arrayString.append(convertStack((ItemStack) o)); + else if (o instanceof FluidStack) arrayString.append(convertFluidStack((FluidStack) o)); + else arrayString.append(o); + if (i + 1 < arrLength) arrayString.append(", "); + } + return arrayString.toString(); + } + + public static String convertFluidStack(FluidStack stack) { + if (stack == null) return "null"; + return "FluidRegistry.getFluidStack(\"" + stack.getFluid().getName() + "\", " + stack.amount + ")"; + } + + public static String convertFluidStack(Fluid stack) { + if (stack == null) return "null"; + return "FluidRegistry.getFluidStack(\"" + stack.getName() + "\", 1000)"; + } + + public static String convertFluid(Fluid fluid) { + if (fluid == null) return "null"; + return "FluidRegistry.getFluid(\"" + fluid.getName() + "\")"; + } + public Thaumcraft() { MineTweakerAPI.registerBracketHandler(new AspectBracketHandler()); - MineTweakerAPI.registerClass(Arcane.class); - MineTweakerAPI.registerClass(Aspects.class); - MineTweakerAPI.registerClass(Crucible.class); - MineTweakerAPI.registerClass(Infusion.class); - MineTweakerAPI.registerClass(Research.class); - MineTweakerAPI.registerClass(Warp.class); - MineTweakerAPI.registerClass(Loot.class); + MineTweakerAPI.registerClass(Arcane.class); // DONE + MineTweakerAPI.registerClass(Aspects.class); // DONE + MineTweakerAPI.registerClass(Crucible.class); // DONE + MineTweakerAPI.registerClass(Infusion.class); // DONE + MineTweakerAPI.registerClass(Research.class); // DONE + MineTweakerAPI.registerClass(Warp.class); // DONE + MineTweakerAPI.registerClass(Loot.class); // DONE } } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Arcane.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Arcane.java index 1575b2b..e7861c6 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Arcane.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Arcane.java @@ -13,6 +13,7 @@ import minetweaker.MineTweakerAPI; import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; import modtweaker2.helpers.LogHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import modtweaker2.utils.BaseListAddition; import modtweaker2.utils.BaseListRemoval; @@ -41,7 +42,8 @@ public class Arcane { key, toStack(output), ThaumcraftHelper.parseAspects(aspects), - toShapedObjects(ingredients)))); + toShapedObjects(ingredients)), + toShapedObjects(ingredients))); } @ZenMethod @@ -52,14 +54,45 @@ public class Arcane { key, toStack(output), ThaumcraftHelper.parseAspects(aspects), - toObjects(ingredients)))); + toObjects(ingredients)), + toObjects(ingredients))); } private static class Add extends BaseListAddition { - public Add(IArcaneRecipe recipe) { + Object[] rawRecipe; + + public Add(IArcaneRecipe recipe, Object[] rawRecipe) { super(Arcane.name, ThaumcraftApi.getCraftingRecipes()); recipes.add(recipe); + this.rawRecipe = rawRecipe; + } + + @Override + public void apply() { + super.apply(); + if (!successful.isEmpty()) { + for (IArcaneRecipe a : successful) { + if (a instanceof ShapedArcaneRecipe) Thaumcraft.info( + "ThaumcraftApi.addArcaneCraftingRecipe(\"" + a.getResearch() + + "\", " + + Thaumcraft.convertStack(a.getRecipeOutput()) + + ", " + + Thaumcraft.convertAspects(((ShapedArcaneRecipe) a).aspects) + + ", " + + Thaumcraft.convertArrayInLine(rawRecipe) + + ");"); + else Thaumcraft.info( + "ThaumcraftApi.addShapelessArcaneCraftingRecipe(\"" + a.getResearch() + + "\", " + + Thaumcraft.convertStack(a.getRecipeOutput()) + + ", " + + Thaumcraft.convertAspects(((ShapelessArcaneRecipe) a).aspects) + + ", " + + Thaumcraft.convertArrayInLine(rawRecipe) + + ");"); + } + } } @Override @@ -101,6 +134,17 @@ public class Arcane { super(Arcane.name, ThaumcraftApi.getCraftingRecipes(), recipes); } + @Override + public void apply() { + super.apply(); + if (!successful.isEmpty()) { + for (IArcaneRecipe a : successful) { + Thaumcraft + .info("TCHelper.removeArcaneRecipe(" + Thaumcraft.convertStack(a.getRecipeOutput()) + ");"); + } + } + } + @Override protected String getRecipeInfo(IArcaneRecipe recipe) { ItemStack stack = recipe.getRecipeOutput(); diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Aspects.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Aspects.java index a6b98f4..2006097 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Aspects.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Aspects.java @@ -6,6 +6,7 @@ import java.util.Arrays; import minetweaker.MineTweakerAPI; import minetweaker.api.item.IItemStack; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import modtweaker2.utils.BaseUndoable; @@ -61,6 +62,12 @@ public class Aspects { ThaumcraftApi.objectTags.put(Arrays.asList(stack.getItem(), stack.getItemDamage()), newList); + Thaumcraft.info( + "ThaumcraftApi.registerObjectTag(" + Thaumcraft.convertStack(stack) + + ", " + + Thaumcraft.convertAspects(newList) + + ");"); + success = true; } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Crucible.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Crucible.java index 9d30f07..5ab7b98 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Crucible.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Crucible.java @@ -12,9 +12,13 @@ import minetweaker.MineTweakerAPI; import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; import modtweaker2.helpers.LogHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import modtweaker2.utils.BaseListAddition; import modtweaker2.utils.BaseListRemoval; + +import net.minecraft.item.ItemStack; + import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenMethod; import thaumcraft.api.ThaumcraftApi; @@ -33,14 +37,35 @@ public class Crucible { key, toStack(result), toObject(catalyst), - ThaumcraftHelper.parseAspects(aspects)))); + ThaumcraftHelper.parseAspects(aspects)), + toObject(catalyst))); } private static class Add extends BaseListAddition { - public Add(CrucibleRecipe recipe) { + Object catalystRaw; + + public Add(CrucibleRecipe recipe, Object catalystRaw) { super(Crucible.name, ThaumcraftApi.getCraftingRecipes()); recipes.add(recipe); + this.catalystRaw = catalystRaw; + } + + @Override + public void apply() { + super.apply(); + for (CrucibleRecipe a : successful) { + Thaumcraft.info( + "ThaumcraftApi.addCrucibleRecipe(\"" + a.key + + "\", " + + Thaumcraft.convertStack(a.getRecipeOutput()) + + ", " + + (catalystRaw instanceof String ? catalystRaw + : Thaumcraft.convertStack((ItemStack) catalystRaw)) + + ", " + + Thaumcraft.convertAspects(a.aspects) + + ");"); + } } @Override @@ -78,6 +103,17 @@ public class Crucible { super(Crucible.name, ThaumcraftApi.getCraftingRecipes(), recipes); } + @Override + public void apply() { + super.apply(); + if (!successful.isEmpty()) { + for (CrucibleRecipe a : successful) { + Thaumcraft.info( + "TCHelper.removeCrucibleRecipe(" + Thaumcraft.convertStack(a.getRecipeOutput()) + ");"); + } + } + } + @Override protected String getRecipeInfo(CrucibleRecipe recipe) { return LogHelper.getStackDescription(recipe.getRecipeOutput()); diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Infusion.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Infusion.java index 2c65e37..45f9174 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Infusion.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Infusion.java @@ -12,6 +12,7 @@ import minetweaker.MineTweakerAPI; import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; import modtweaker2.helpers.LogHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import modtweaker2.mods.thaumcraft.recipe.MTInfusionRecipe; import modtweaker2.utils.BaseListAddition; @@ -84,6 +85,26 @@ public class Infusion { recipes.add(recipe); } + @Override + public void apply() { + super.apply(); + for (InfusionRecipe a : successful) { + Thaumcraft.info( + "ThaumcraftApi.addInfusionCraftingRecipe(\"" + a.getResearch() + + "\", " + + Thaumcraft.convertStack((ItemStack) a.getRecipeOutput()) + + ", " + + a.getInstability() + + ", " + + Thaumcraft.convertAspects(a.getAspects()) + + ", " + + Thaumcraft.convertStack(a.getRecipeInput()) + + ", " + + Thaumcraft.convertStacks(a.getComponents()) + + ");"); + } + } + @Override protected String getRecipeInfo(InfusionRecipe recipe) { Object out = ((InfusionRecipe) recipe).getRecipeOutput(); @@ -100,6 +121,26 @@ public class Infusion { recipes.add(inp); } + @Override + public void apply() { + super.apply(); + for (InfusionEnchantmentRecipe a : successful) { + Thaumcraft.info( + "ThaumcraftApi.addInfusionCraftingRecipe(\"" + a.research + + "\", " + + "Enchantment.enchantmentsList[" + + a.enchantment.effectId + + "]" + + ", " + + a.instability + + ", " + + Thaumcraft.convertAspects(a.getAspects()) + + ", " + + Thaumcraft.convertStacks(a.components) + + ");"); + } + } + @Override protected String getRecipeInfo(InfusionEnchantmentRecipe recipe) { return recipe.getEnchantment().getName(); @@ -161,6 +202,18 @@ public class Infusion { super(Infusion.name, ThaumcraftApi.getCraftingRecipes(), recipes); } + @Override + public void apply() { + super.apply(); + if (!successful.isEmpty()) { + for (InfusionRecipe a : successful) { + Thaumcraft.info( + "TCHelper.removeInfusionRecipe(" + Thaumcraft.convertStack((ItemStack) a.getRecipeOutput()) + + ");"); + } + } + } + @Override protected String getRecipeInfo(InfusionRecipe recipe) { @@ -180,6 +233,16 @@ public class Infusion { super(Infusion.enchName, ThaumcraftApi.getCraftingRecipes(), recipes); } + @Override + public void apply() { + super.apply(); + if (!successful.isEmpty()) { + for (InfusionEnchantmentRecipe a : successful) { + Thaumcraft.info("TCHelper.removeInfusionEnchantmentRecipe(" + a.getEnchantment().effectId + ");"); + } + } + } + @Override protected String getRecipeInfo(InfusionEnchantmentRecipe recipe) { return recipe.getEnchantment().getName(); diff --git a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Warp.java b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Warp.java index 0f90368..a362728 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/handlers/Warp.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/handlers/Warp.java @@ -9,6 +9,7 @@ import java.util.List; import minetweaker.IUndoableAction; import minetweaker.MineTweakerAPI; import minetweaker.api.item.IItemStack; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import net.minecraft.item.ItemStack; @@ -41,8 +42,17 @@ public class Warp { } public void apply() { - if (target instanceof String) ThaumcraftApi.addWarpToResearch((String) target, warp); - else if (target instanceof ItemStack) ThaumcraftApi.addWarpToItem((ItemStack) target, warp); + if (target instanceof String) { + ThaumcraftApi.addWarpToResearch((String) target, warp); + Thaumcraft.info("ThaumcraftApi.addWarpToResearch(\"" + (String) target + "\", " + warp + ");"); + } else if (target instanceof ItemStack) { + ThaumcraftApi.addWarpToItem((ItemStack) target, warp); + Thaumcraft.info( + "ThaumcraftApi.addWarpToItem(" + Thaumcraft.convertStack((ItemStack) target) + + ", " + + warp + + ");"); + } } public boolean canUndo() { diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/AddPage.java b/src/main/java/modtweaker2/mods/thaumcraft/research/AddPage.java index 0977c51..93da27e 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/AddPage.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/AddPage.java @@ -4,6 +4,7 @@ import static modtweaker2.helpers.StackHelper.areEqual; import static modtweaker2.mods.thaumcraft.ThaumcraftHelper.getResearchSafe; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import net.minecraft.enchantment.Enchantment; @@ -42,12 +43,15 @@ public class AddPage implements IUndoableAction { @Override public void apply() { + String pageTX = null; if (type == PageType.NORMAL_CRAFTING) { for (Object craft : CraftingManager.getInstance().getRecipeList()) { if (craft instanceof IRecipe) { IRecipe theCraft = (IRecipe) craft; if (theCraft.getRecipeOutput() != null && areEqual(theCraft.getRecipeOutput(), target)) { page = new ResearchPage(theCraft); + pageTX = "new ResearchPage(TCHelper.findCraftingRecipe(" + Thaumcraft.convertStack(target) + + "))"; break; } } @@ -58,6 +62,7 @@ public class AddPage implements IUndoableAction { IArcaneRecipe theCraft = (IArcaneRecipe) craft; if (theCraft.getRecipeOutput() != null && areEqual(theCraft.getRecipeOutput(), target)) { page = new ResearchPage(theCraft); + pageTX = "new ResearchPage(TCHelper.findArcaneRecipe(" + Thaumcraft.convertStack(target) + "))"; break; } } @@ -68,6 +73,8 @@ public class AddPage implements IUndoableAction { CrucibleRecipe theCraft = (CrucibleRecipe) craft; if (theCraft.getRecipeOutput() != null && areEqual(theCraft.getRecipeOutput(), target)) { page = new ResearchPage(theCraft); + pageTX = "new ResearchPage(TCHelper.findCrucibleRecipe(" + Thaumcraft.convertStack(target) + + "))"; break; } } @@ -79,6 +86,8 @@ public class AddPage implements IUndoableAction { if (theCraft.getRecipeOutput() != null && theCraft.getRecipeOutput() instanceof ItemStack && areEqual(((ItemStack) (theCraft.getRecipeOutput())), target)) { page = new ResearchPage(theCraft); + pageTX = "new ResearchPage(TCHelper.findInfusionRecipe(" + Thaumcraft.convertStack(target) + + "))"; break; } } @@ -89,12 +98,14 @@ public class AddPage implements IUndoableAction { InfusionEnchantmentRecipe theCraft = (InfusionEnchantmentRecipe) craft; if (theCraft.getEnchantment() != null && theCraft.getEnchantment() == enchant) { page = new ResearchPage(theCraft); + pageTX = "new ResearchPage(TCHelper.findInfusionEnchantRecipe(" + enchant.effectId + "))"; break; } } } } if (page == null) return; + if (pageTX == null) pageTX = "new ResearchPage(\"" + page.text + "\")"; oldPages = ResearchCategories.researchCategories.get(tab).research.get(key).getPages(); if (oldPages == null) oldPages = new ResearchPage[0]; ResearchPage[] newPages = new ResearchPage[oldPages.length + 1]; @@ -103,6 +114,7 @@ public class AddPage implements IUndoableAction { } newPages[oldPages.length] = page; ResearchCategories.researchCategories.get(tab).research.get(key).setPages(newPages); + Thaumcraft.addPageInfo(key, pageTX); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/AddPrereq.java b/src/main/java/modtweaker2/mods/thaumcraft/research/AddPrereq.java index 3d4c79f..0362f8b 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/AddPrereq.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/AddPrereq.java @@ -3,6 +3,7 @@ package modtweaker2.mods.thaumcraft.research; import static modtweaker2.mods.thaumcraft.ThaumcraftHelper.getResearchSafe; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; @@ -43,6 +44,7 @@ public class AddPrereq implements IUndoableAction { newPrereqs[oldPrereqs.length] = prereq; ResearchCategories.researchCategories.get(tab).research.get(key).setParentsHidden(newPrereqs); } + Thaumcraft.addPrereq(key, "\"" + prereq + "\"", hidden); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/AddResearch.java b/src/main/java/modtweaker2/mods/thaumcraft/research/AddResearch.java index 675c4bd..789e3f6 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/AddResearch.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/AddResearch.java @@ -1,6 +1,7 @@ package modtweaker2.mods.thaumcraft.research; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import net.minecraft.item.ItemStack; @@ -30,16 +31,36 @@ public class AddResearch implements IUndoableAction { @Override public void apply() { oldResearch = ResearchCategories.getResearch(research.key); + String a = "new ResearchItem(\"" + research.key + + "\", \"" + + research.category + + "\", " + + Thaumcraft.convertAspects(research.tags) + + ", " + + research.displayColumn + + ", " + + research.displayRow + + ", " + + research.getComplexity() + + ", " + + Thaumcraft.convertStack(research.icon_item) + + ")"; if (itemTriggers != null) { research = research.setItemTriggers(itemTriggers); + a += ".setItemTriggers(" + Thaumcraft.convertStacks(itemTriggers) + ")"; } if (entityTriggers != null) { research = research.setEntityTriggers(entityTriggers); + a += ".setEntityTriggers(" + Thaumcraft.convertArray(entityTriggers) + ")"; } if (aspectTriggers != null) { research = research.setAspectTriggers(aspectTriggers.getAspects()); + a += ".setAspectTriggers(" + Thaumcraft.convertAspectsInLine(aspectTriggers) + ")"; } research.registerResearchItem(); + + Thaumcraft.info(a); + Thaumcraft.addingResearch = research.key; } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/AddSibling.java b/src/main/java/modtweaker2/mods/thaumcraft/research/AddSibling.java index 115f77e..41d9eb9 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/AddSibling.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/AddSibling.java @@ -3,6 +3,7 @@ package modtweaker2.mods.thaumcraft.research; import static modtweaker2.mods.thaumcraft.ThaumcraftHelper.getResearchSafe; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; @@ -30,6 +31,7 @@ public class AddSibling implements IUndoableAction { } newSiblings[oldSiblings.length] = sibling; ResearchCategories.researchCategories.get(tab).research.get(key).setSiblings(sibling); + Thaumcraft.addSibling(key, "\"" + sibling + "\""); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/AddTab.java b/src/main/java/modtweaker2/mods/thaumcraft/research/AddTab.java index 95cbf89..3d610f7 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/AddTab.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/AddTab.java @@ -1,6 +1,7 @@ package modtweaker2.mods.thaumcraft.research; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import net.minecraft.util.ResourceLocation; @@ -21,6 +22,8 @@ public class AddTab implements IUndoableAction { @Override public void apply() { ResearchCategories.registerCategory(tab, icon, background); + Thaumcraft.info( + "ResearchCategories.registerCategory(\"" + tab + "\", \"" + icon + "\", \"" + background + "\");"); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/ClearPages.java b/src/main/java/modtweaker2/mods/thaumcraft/research/ClearPages.java index 0292ce4..4150ba7 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/ClearPages.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/ClearPages.java @@ -3,6 +3,7 @@ package modtweaker2.mods.thaumcraft.research; import static modtweaker2.mods.thaumcraft.ThaumcraftHelper.getResearchSafe; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; @@ -23,6 +24,7 @@ public class ClearPages implements IUndoableAction { public void apply() { oldPages = ResearchCategories.researchCategories.get(tab).research.get(key).getPages(); ResearchCategories.researchCategories.get(tab).research.get(key).setPages(new ResearchPage[0]); + Thaumcraft.info("TCHelper.clearPages(\"" + key + "\");"); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/ClearPrereqs.java b/src/main/java/modtweaker2/mods/thaumcraft/research/ClearPrereqs.java index f9e10e0..2346644 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/ClearPrereqs.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/ClearPrereqs.java @@ -3,6 +3,7 @@ package modtweaker2.mods.thaumcraft.research; import static modtweaker2.mods.thaumcraft.ThaumcraftHelper.getResearchSafe; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; @@ -25,6 +26,7 @@ public class ClearPrereqs implements IUndoableAction { secretPrereqs = ResearchCategories.researchCategories.get(tab).research.get(key).parentsHidden; ResearchCategories.researchCategories.get(tab).research.get(key).setParents(new String[0]); ResearchCategories.researchCategories.get(tab).research.get(key).setParentsHidden(new String[0]); + Thaumcraft.info("TCHelper.clearPrereq(\"" + key + "\");"); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/ClearSiblings.java b/src/main/java/modtweaker2/mods/thaumcraft/research/ClearSiblings.java index 2e2e8cf..3402e10 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/ClearSiblings.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/ClearSiblings.java @@ -3,6 +3,7 @@ package modtweaker2.mods.thaumcraft.research; import static modtweaker2.mods.thaumcraft.ThaumcraftHelper.getResearchSafe; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; @@ -22,6 +23,7 @@ public class ClearSiblings implements IUndoableAction { public void apply() { siblings = ResearchCategories.researchCategories.get(tab).research.get(key).siblings; ResearchCategories.researchCategories.get(tab).research.get(key).setSiblings(new String[0]); + Thaumcraft.info("TCHelper.clearSiblings(\"" + key + "\");"); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/Difficulty.java b/src/main/java/modtweaker2/mods/thaumcraft/research/Difficulty.java index bc0bbdf..4139c66 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/Difficulty.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/Difficulty.java @@ -5,6 +5,7 @@ import static modtweaker2.mods.thaumcraft.ThaumcraftHelper.getResearchSafe; import java.lang.reflect.Field; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; @@ -47,6 +48,7 @@ public class Difficulty implements IUndoableAction { } catch (Exception e) { e.printStackTrace(); } + Thaumcraft.info("TCHelper.setResearchComplexity(\"" + key + "\", " + difficulty + ");"); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/MoveResearch.java b/src/main/java/modtweaker2/mods/thaumcraft/research/MoveResearch.java index f71ae74..ad4793c 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/MoveResearch.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/MoveResearch.java @@ -3,6 +3,7 @@ package modtweaker2.mods.thaumcraft.research; import java.lang.reflect.Field; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; @@ -38,6 +39,7 @@ public class MoveResearch implements IUndoableAction { } catch (Exception e) { e.printStackTrace(); } + Thaumcraft.info("TCHelper.moveResearch(\"" + key + "\", \"" + newTab + "\", " + x + ", " + y + ");"); } } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/OrphanResearch.java b/src/main/java/modtweaker2/mods/thaumcraft/research/OrphanResearch.java index 5ccf5f3..0c02718 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/OrphanResearch.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/OrphanResearch.java @@ -9,6 +9,7 @@ import java.util.function.Function; import minetweaker.IUndoableAction; import modtweaker2.helpers.LogHelper; +import modtweaker2.mods.thaumcraft.Thaumcraft; import org.apache.commons.lang3.ArrayUtils; @@ -58,6 +59,7 @@ public class OrphanResearch implements IUndoableAction { remove(research, researchItem.siblings, siblings, researchItem::setSiblings); } } + Thaumcraft.info("TCHelper.orphanResearch(\"" + key + "\");"); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/RefreshResearch.java b/src/main/java/modtweaker2/mods/thaumcraft/research/RefreshResearch.java index a6c6435..09e3bfc 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/RefreshResearch.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/RefreshResearch.java @@ -3,6 +3,7 @@ package modtweaker2.mods.thaumcraft.research; import static modtweaker2.helpers.StackHelper.areEqual; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import net.minecraft.item.ItemStack; @@ -90,6 +91,7 @@ public class RefreshResearch implements IUndoableAction { } } } + Thaumcraft.info("TCHelper.refreshResearchPages(\"" + research + "\");"); } } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/RemoveResearch.java b/src/main/java/modtweaker2/mods/thaumcraft/research/RemoveResearch.java index efed2db..424a34f 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/RemoveResearch.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/RemoveResearch.java @@ -1,6 +1,7 @@ package modtweaker2.mods.thaumcraft.research; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; @@ -21,6 +22,7 @@ public class RemoveResearch implements IUndoableAction { if (tab != null) { removed = ResearchCategories.researchCategories.get(tab).research.get(key); ResearchCategories.researchCategories.get(tab).research.remove(key); + Thaumcraft.info("TCHelper.removeResearch(\"" + key + "\");"); } } diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/RemoveTab.java b/src/main/java/modtweaker2/mods/thaumcraft/research/RemoveTab.java index 16d9015..067336d 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/RemoveTab.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/RemoveTab.java @@ -1,6 +1,7 @@ package modtweaker2.mods.thaumcraft.research; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchCategoryList; @@ -17,6 +18,7 @@ public class RemoveTab implements IUndoableAction { public void apply() { list = ResearchCategories.getResearchList(tab); ResearchCategories.researchCategories.remove(tab); + Thaumcraft.info("ResearchCategories.researchCategories.remove(\"" + tab + "\");"); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/SetAspects.java b/src/main/java/modtweaker2/mods/thaumcraft/research/SetAspects.java index f191601..d8c1442 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/SetAspects.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/SetAspects.java @@ -5,6 +5,7 @@ import static modtweaker2.mods.thaumcraft.ThaumcraftHelper.getResearchSafe; import java.lang.reflect.Field; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchCategories; @@ -48,6 +49,7 @@ public class SetAspects implements IUndoableAction { } catch (Exception e) { e.printStackTrace(); } + Thaumcraft.info("TCHelper.setResearchAspects(\"" + key + "\", " + Thaumcraft.convertAspects(list) + ");"); } @Override diff --git a/src/main/java/modtweaker2/mods/thaumcraft/research/SetResearch.java b/src/main/java/modtweaker2/mods/thaumcraft/research/SetResearch.java index 937f64b..f735bae 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/research/SetResearch.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/research/SetResearch.java @@ -5,6 +5,7 @@ import static modtweaker2.mods.thaumcraft.ThaumcraftHelper.getResearchSafe; import java.lang.reflect.Field; import minetweaker.IUndoableAction; +import modtweaker2.mods.thaumcraft.Thaumcraft; import modtweaker2.mods.thaumcraft.ThaumcraftHelper; import modtweaker2.mods.thaumcraft.handlers.Research.SetType; import thaumcraft.api.research.ResearchCategories; @@ -29,14 +30,31 @@ public class SetResearch implements IUndoableAction { public void apply() { ResearchItem research = ResearchCategories.researchCategories.get(tab).research.get(key); if (flag) { - if (type == SetType.AUTO) research.setAutoUnlock(); - else if (type == SetType.ROUND) research.setRound(); - else if (type == SetType.SPIKE) research.setSpecial(); - else if (type == SetType.SECONDARY) research.setSecondary(); - else if (type == SetType.STUB) research.setStub(); - else if (type == SetType.VIRTUAL) research.setVirtual(); - else if (type == SetType.CONCEAL) research.setConcealed(); - else if (type == SetType.HIDDEN) research.setHidden(); + if (type == SetType.AUTO) { + research.setAutoUnlock(); + Thaumcraft.researchInfo(key, ".setAutoUnlock()"); + } else if (type == SetType.ROUND) { + research.setRound(); + Thaumcraft.researchInfo(key, ".setRound()"); + } else if (type == SetType.SPIKE) { + research.setSpecial(); + Thaumcraft.researchInfo(key, ".setSpecial()"); + } else if (type == SetType.SECONDARY) { + research.setSecondary(); + Thaumcraft.researchInfo(key, ".setSecondary()"); + } else if (type == SetType.STUB) { + research.setStub(); + Thaumcraft.researchInfo(key, ".setStub()"); + } else if (type == SetType.VIRTUAL) { + research.setVirtual(); + Thaumcraft.researchInfo(key, ".setVirtual()"); + } else if (type == SetType.CONCEAL) { + research.setConcealed(); + Thaumcraft.researchInfo(key, ".setConcealed()"); + } else if (type == SetType.HIDDEN) { + research.setHidden(); + Thaumcraft.researchInfo(key, ".setHidden()"); + } applied = true; } else { try {