mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-17 03:05:03 +00:00
Smeltery fix and various others
This commit is contained in:
1 parent
570e4f8607
commit
25feee0162
101 files changed
+2292
-1019
No files matched your search
@@ -1,19 +1,13 @@
|
||||
package modtweaker2;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.MineTweakerImplementationAPI;
|
||||
import minetweaker.MineTweakerImplementationAPI.ReloadEvent;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.api.server.ICommandFunction;
|
||||
import minetweaker.mc1710.MineTweakerMod;
|
||||
import minetweaker.util.IEventHandler;
|
||||
import modtweaker2.commands.EntityMappingLogger;
|
||||
import modtweaker2.mods.auracascade.aura.AuraLogger;
|
||||
import modtweaker2.mods.botania.commands.BotaniaBrewLogger;
|
||||
import modtweaker2.mods.botania.commands.BotaniaOrechidLogger;
|
||||
import modtweaker2.mods.botania.lexicon.commands.LexiconCategoryLogger;
|
||||
import modtweaker2.mods.botania.lexicon.commands.LexiconEntryLogger;
|
||||
import modtweaker2.mods.botania.lexicon.commands.LexiconKnowledgeTypesLogger;
|
||||
import modtweaker2.mods.botania.lexicon.commands.LexiconPageLogger;
|
||||
import modtweaker2.mods.chisel.commands.ChiselGroupLogger;
|
||||
@@ -22,53 +16,52 @@ import modtweaker2.mods.mekanism.gas.GasLogger;
|
||||
import modtweaker2.mods.tconstruct.MaterialLogger;
|
||||
import modtweaker2.mods.thaumcraft.commands.AspectLogger;
|
||||
import modtweaker2.mods.thaumcraft.research.commands.ResearchLogger;
|
||||
import modtweaker2.util.TweakerPlugin;
|
||||
import modtweaker2.utils.TweakerPlugin;
|
||||
|
||||
public class Commands {
|
||||
|
||||
public static void registerCommands() {
|
||||
registerMineTweakerCommand("tooltips", new String[] { "/minetweaker tooltips", " Adds tooltips to all items ingame with their mt script name, press ctrl on an item to print to the log" }, new ICommandFunction() {
|
||||
MineTweakerAPI.server.addMineTweakerCommand("tooltips", new String[] { "/minetweaker tooltips", " Adds tooltips to all items ingame with their mt script name, press ctrl on an item to print to the log" }, new ICommandFunction() {
|
||||
@Override
|
||||
public void execute(String[] arguments, IPlayer player) {
|
||||
ClientEvents.active = !ClientEvents.active;
|
||||
}
|
||||
});
|
||||
|
||||
registerMineTweakerCommand("entities", new String[] { "/minetweaker entities", " Outputs a list of entities class mapping keys and the entity IDs" }, new EntityMappingLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("entities", new String[] { "/minetweaker entities", " Outputs a list of entities class mapping keys and the entity IDs" }, new EntityMappingLogger());
|
||||
|
||||
if (TweakerPlugin.isLoaded("Mekanism")) {
|
||||
registerMineTweakerCommand("gases", new String[] { "/minetweaker gases", " Outputs a list of all gas names in the game to the minetweaker log" }, new GasLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("gases", new String[] { "/minetweaker gases", " Outputs a list of all gas names in the game to the minetweaker log" }, new GasLogger());
|
||||
}
|
||||
|
||||
if (TweakerPlugin.isLoaded("Thaumcraft")) {
|
||||
registerMineTweakerCommand("research", new String[] { "/minetweaker research", "/minetweaker research [CATEGORY]", " Outputs a list of all category names in the game to the minetweaker log," + " or outputs a list of all research keys in a category to the log." }, new ResearchLogger());
|
||||
registerMineTweakerCommand("aspectList", new String[] { "/minetweaker aspectList", " Outputs a list of all aspects registered to entities and items" }, new AspectLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("research", new String[] { "/minetweaker research", "/minetweaker research [CATEGORY]", " Outputs a list of all category names in the game to the minetweaker log," + " or outputs a list of all research keys in a category to the log." }, new ResearchLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("aspectList", new String[] { "/minetweaker aspectList", " Outputs a list of all aspects registered to entities and items" }, new AspectLogger());
|
||||
}
|
||||
|
||||
if (TweakerPlugin.isLoaded("TConstruct")) {
|
||||
registerMineTweakerCommand("materials", new String[] { "/minetweaker materials", " Outputs a list of all Tinker's Construct material names in the game to the minetweaker log" }, new MaterialLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("materials", new String[] { "/minetweaker materials", " Outputs a list of all Tinker's Construct material names in the game to the minetweaker log" }, new MaterialLogger());
|
||||
}
|
||||
|
||||
if (TweakerPlugin.isLoaded("Botania")) {
|
||||
registerMineTweakerCommand("lexiconCategories", new String[] { "/minetweaker lexiconCategories", " Outputs a list of lexicon categories" }, new LexiconCategoryLogger());
|
||||
registerMineTweakerCommand("lexiconEntries", new String[] { "/minetweaker lexiconEntries", "/minetweaker lexiconEntries [CATEGORY]", " Outputs a list of lexicon entries" }, new LexiconEntryLogger());
|
||||
registerMineTweakerCommand("lexiconPages", new String[] { "/minetweaker lexiconPages", "/minetweaker lexiconPages [ENTRY]", " Outputs a list of lexicon pages for the entry" }, new LexiconPageLogger());
|
||||
registerMineTweakerCommand("botaniaBrews", new String[] { "/minetweaker botaniaBrews", " Outputs a list of keys for botania brews" }, new BotaniaBrewLogger());
|
||||
registerMineTweakerCommand("lexiconKnowledgeTypes", new String[] { "/minetweaker lexiconKnowledgeTypes", " Outputs a list of keys for lexicon knowledge types" }, new LexiconKnowledgeTypesLogger());
|
||||
registerMineTweakerCommand("botaniaOrchid", new String[] { "/minetweaker botaniaOrechid", " Outputs a list of keys for botania orechid weights" }, new BotaniaOrechidLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("lexiconCategories", new String[] { "/minetweaker lexiconCategories", " Outputs a list of lexicon categories" }, new LexiconCategoryLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("lexiconPages", new String[] { "/minetweaker lexiconPages", "/minetweaker lexiconPages [ENTRY]", " Outputs a list of lexicon pages for the entry" }, new LexiconPageLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("botaniaBrews", new String[] { "/minetweaker botaniaBrews", " Outputs a list of keys for botania brews" }, new BotaniaBrewLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("lexiconKnowledgeTypes", new String[] { "/minetweaker lexiconKnowledgeTypes", " Outputs a list of keys for lexicon knowledge types" }, new LexiconKnowledgeTypesLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("botaniaOrchid", new String[] { "/minetweaker botaniaOrechid", " Outputs a list of keys for botania orechid weights" }, new BotaniaOrechidLogger());
|
||||
}
|
||||
|
||||
if (TweakerPlugin.isLoaded("chisel")) {
|
||||
registerMineTweakerCommand("chiselGroups", new String[] { "/minetweaker chiselGroups", " Outputs a list of chisel groups" }, new ChiselGroupLogger());
|
||||
registerMineTweakerCommand("chiselVariations", new String[] { "/minetweaker chiselVariations", "/minetweaker chiselVariations [GROUP]", " Outputs a list of chisel variations" }, new ChiselVariationLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("chiselGroups", new String[] { "/minetweaker chiselGroups", " Outputs a list of chisel groups" }, new ChiselGroupLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("chiselVariations", new String[] { "/minetweaker chiselVariations", "/minetweaker chiselVariations [GROUP]", " Outputs a list of chisel variations" }, new ChiselVariationLogger());
|
||||
}
|
||||
if(TweakerPlugin.isLoaded("aura")){
|
||||
registerMineTweakerCommand("auras", new String[]{"/minetweaker auras", "Outputs a list of Aura Types"}, new AuraLogger());
|
||||
if (TweakerPlugin.isLoaded("aura")) {
|
||||
MineTweakerAPI.server.addMineTweakerCommand("auras", new String[] { "/minetweaker auras", "Outputs a list of Aura Types" }, new AuraLogger());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void registerMineTweakerCommand(String commandName, String[] usages, ICommandFunction commandFunction) {
|
||||
public static void registerMineTweakerCommand(String commandName, String[] usages, ICommandFunction commandFunction) {
|
||||
MineTweakerAPI.server.addMineTweakerCommand(commandName, usages, commandFunction);
|
||||
ModTweaker2.logger.info("\nRegistering command " + commandName + ".");
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import modtweaker2.mods.railcraft.Railcraft;
|
||||
import modtweaker2.mods.tconstruct.TConstruct;
|
||||
import modtweaker2.mods.thaumcraft.Thaumcraft;
|
||||
import modtweaker2.mods.thermalexpansion.ThermalExpansion;
|
||||
import modtweaker2.util.TweakerPlugin;
|
||||
import modtweaker2.utils.TweakerPlugin;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -51,19 +51,11 @@ public class ModTweaker2 {
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
logger.info("Starting PreInitialization for " + ModProps.modid);
|
||||
File file = new File("scripts");
|
||||
|
||||
if (!file.exists()) {
|
||||
file.mkdir();
|
||||
}
|
||||
new Message(file.getPath());
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
logger.info("Starting Initialization for " + ModProps.modid);
|
||||
|
||||
TweakerPlugin.register("appliedenergistics2-core", AppliedEnergistics.class);
|
||||
TweakerPlugin.register("Botania", Botania.class);
|
||||
TweakerPlugin.register("exnihilo", ExNihilo.class);
|
||||
@@ -82,11 +74,17 @@ public class ModTweaker2 {
|
||||
TweakerPlugin.register("Forestry", Forestry.class);
|
||||
TweakerPlugin.register("chisel", Chisel.class);
|
||||
TweakerPlugin.register("aura", AuraCascade.class);
|
||||
|
||||
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||
MinecraftForge.EVENT_BUS.register(new ClientEvents());
|
||||
}
|
||||
|
||||
// MineTweakerImplementationAPI.onReloadEvent(new IEventHandler<MineTweakerImplementationAPI.ReloadEvent>() {
|
||||
//
|
||||
// @Override
|
||||
// public void handle(ReloadEvent event) {
|
||||
// Commands.registerCommands();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -99,12 +97,6 @@ public class ModTweaker2 {
|
||||
public void serverStart(FMLServerStartingEvent event) {
|
||||
logger.info("Starting ServerStart for " + ModProps.modid);
|
||||
Commands.registerCommands();
|
||||
MineTweakerImplementationAPI.onReloadEvent(new IEventHandler<MineTweakerImplementationAPI.ReloadEvent>() {
|
||||
|
||||
@Override
|
||||
public void handle(ReloadEvent arg0) {
|
||||
Commands.registerCommands();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,19 @@
|
||||
package modtweaker2.helpers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.entity.IEntity;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.IEntityLivingData;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class InputHelper {
|
||||
public static boolean isABlock(IItemStack block) {
|
||||
if (!(isABlock(toStack(block)))) {
|
||||
@@ -25,11 +23,25 @@ public class InputHelper {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static IItemStack[] toStacks(IIngredient[] iIngredient) {
|
||||
ArrayList<IItemStack> stacks = new ArrayList<IItemStack>();
|
||||
for (IIngredient ing : iIngredient) {
|
||||
for (IItemStack stack : ing.getItems()) {
|
||||
stacks.add(stack);
|
||||
}
|
||||
}
|
||||
IItemStack[] returnArray = new IItemStack[stacks.size()];
|
||||
for(int i = 0; i < returnArray.length;i++){
|
||||
returnArray[i] = stacks.get(i);
|
||||
}
|
||||
return returnArray;
|
||||
}
|
||||
|
||||
public static boolean isABlock(ItemStack block) {
|
||||
return block.getItem() instanceof ItemBlock;
|
||||
}
|
||||
|
||||
public static Entity toEntity(){
|
||||
|
||||
public static Entity toEntity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -96,7 +108,7 @@ public class InputHelper {
|
||||
prep.add("abc");
|
||||
prep.add("def");
|
||||
prep.add("ghi");
|
||||
char[][] map = new char[][] { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } };
|
||||
char[][] map = new char[][]{{'a', 'b', 'c'}, {'d', 'e', 'f'}, {'g', 'h', 'i'}};
|
||||
for (int x = 0; x < ingredients.length; x++) {
|
||||
if (ingredients[x] != null) {
|
||||
for (int y = 0; y < ingredients[x].length; y++) {
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package modtweaker2.helpers;
|
||||
|
||||
//import modtweaker2.mods.botania.Botania;
|
||||
import modtweaker2.mods.botania.Botania;
|
||||
import modtweaker2.util.TweakerPlugin;
|
||||
import modtweaker2.utils.TweakerPlugin;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class StackHelper {
|
||||
//Stack is the stack that is part of a recipe, stack2 is the one input trying to match
|
||||
public static boolean areEqual(ItemStack stack, ItemStack stack2) {
|
||||
if (stack == null || stack2 == null) return false;
|
||||
else if (TweakerPlugin.isLoaded("Botania") && Botania.isSubtile(stack) && Botania.isSubtile(stack2)) {
|
||||
return Botania.subtileMatches(stack, stack2);
|
||||
} else return stack.isItemEqual(stack2);
|
||||
}
|
||||
// Stack is the stack that is part of a recipe, stack2 is the one input
|
||||
// trying to match
|
||||
public static boolean areEqual(ItemStack stack, ItemStack stack2) {
|
||||
if (stack == null || stack2 == null)
|
||||
return false;
|
||||
else if (TweakerPlugin.isLoaded("Botania") && Botania.isSubtile(stack) && Botania.isSubtile(stack2)) {
|
||||
return Botania.subtileMatches(stack, stack2);
|
||||
} else
|
||||
return stack.isItemEqual(stack2);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,6 @@ public class AppliedEnergistics {
|
||||
|
||||
public AppliedEnergistics() {
|
||||
MineTweakerAPI.registerClass(Inscriber.class);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,8 +7,8 @@ import java.util.ArrayList;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -3,9 +3,6 @@ package modtweaker2.mods.auracascade;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import modtweaker2.mods.auracascade.aura.AuraBracketHandler;
|
||||
import modtweaker2.mods.auracascade.handlers.Pylon;
|
||||
import modtweaker2.mods.mekanism.gas.GasBracketHandler;
|
||||
import pixlepix.auracascade.block.tile.AngelSteelTile;
|
||||
import pixlepix.auracascade.data.recipe.PylonRecipeRegistry;
|
||||
|
||||
public class AuraCascade {
|
||||
public AuraCascade(){
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package modtweaker2.mods.auracascade;
|
||||
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import modtweaker2.mods.auracascade.aura.IAuraStack;
|
||||
import modtweaker2.mods.mekanism.gas.IGasStack;
|
||||
import pixlepix.auracascade.data.AuraQuantity;
|
||||
import pixlepix.auracascade.data.EnumAura;
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package modtweaker2.mods.auracascade.handlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import modtweaker2.mods.appeng.handlers.Inscriber.Add;
|
||||
import modtweaker2.mods.auracascade.AuraCascadeHelper;
|
||||
import modtweaker2.mods.auracascade.aura.IAuraStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import pixlepix.auracascade.data.recipe.PylonRecipe;
|
||||
import pixlepix.auracascade.data.recipe.PylonRecipeComponent;
|
||||
import pixlepix.auracascade.data.recipe.PylonRecipeRegistry;
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package modtweaker2.mods.botania.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toObjects;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.botania.Apothecary")
|
||||
public class Apothecary {
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package modtweaker2.mods.botania.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toObjects;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.botania.ElvenTrade")
|
||||
public class ElvenTrade {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package modtweaker2.mods.botania.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toObject;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
|
||||
@ZenClass("mods.botania.ManaInfusion")
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package modtweaker2.mods.botania.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toObjects;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipeRuneAltar;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.botania.RuneAltar")
|
||||
public class RuneAltar {
|
||||
|
||||
@@ -3,8 +3,8 @@ package modtweaker2.mods.exnihilo.handlers;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseMapAddition;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@@ -6,8 +6,8 @@ import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.util.BaseMapAddition;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@@ -7,8 +7,8 @@ import java.util.Iterator;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -5,9 +5,9 @@ import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseMultipleListRemoval;
|
||||
import modtweaker2.util.BaseMultipleListRemoval.Position;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseMultipleListRemoval;
|
||||
import modtweaker2.utils.BaseMultipleListRemoval.Position;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package modtweaker2.mods.extendedworkbench.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.InputHelper.toStacks;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import naruto1310.extendedWorkbench.crafting.ExtendedCraftingManager;
|
||||
import naruto1310.extendedWorkbench.crafting.ExtendedShapedRecipes;
|
||||
import naruto1310.extendedWorkbench.crafting.ExtendedShapelessRecipes;
|
||||
@@ -13,8 +17,6 @@ import naruto1310.extendedWorkbench.crafting.IExtendedRecipe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.extendedworkbench")
|
||||
public class ExtendedCrafting {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package modtweaker2.mods.factorization;
|
||||
|
||||
import static modtweaker2.helpers.ReflectionHelper.getStaticObject;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import static modtweaker2.helpers.ReflectionHelper.*;
|
||||
|
||||
public class FactorizationHelper {
|
||||
public static List lacerator = null;
|
||||
|
||||
@@ -6,8 +6,8 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
import modtweaker2.mods.factorization.FactorizationHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -6,8 +6,8 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
import modtweaker2.mods.factorization.FactorizationHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -6,9 +6,9 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
import modtweaker2.mods.factorization.FactorizationHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseMultipleListRemoval;
|
||||
import modtweaker2.util.BaseMultipleListRemoval.Position;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseMultipleListRemoval;
|
||||
import modtweaker2.utils.BaseMultipleListRemoval.Position;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package modtweaker2.mods.forestry.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.InputHelper.toStacks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,8 +11,8 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.mods.forestry.ForestryHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
@@ -17,8 +21,6 @@ import forestry.core.utils.ShapedRecipeCustom;
|
||||
import forestry.factory.gadgets.MachineCarpenter;
|
||||
import forestry.factory.gadgets.MachineCarpenter.Recipe;
|
||||
import forestry.factory.gadgets.MachineCarpenter.RecipeManager;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.forestry.Carpenter")
|
||||
public class Carpenter {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package modtweaker2.mods.forestry.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import forestry.factory.gadgets.MachineCentrifuge.Recipe;
|
||||
import forestry.factory.gadgets.MachineCentrifuge.RecipeManager;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
|
||||
@ZenClass("mods.forestry.Centrifuge")
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
package modtweaker2.mods.forestry.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.getFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import forestry.factory.gadgets.MachineFermenter;
|
||||
import forestry.factory.gadgets.MachineFermenter.Recipe;
|
||||
import forestry.factory.gadgets.MachineFermenter.RecipeManager;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.forestry.Fermenter")
|
||||
public class Fermenter {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package modtweaker2.mods.forestry.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import forestry.factory.gadgets.MachineMoistener;
|
||||
import forestry.factory.gadgets.MachineMoistener.Recipe;
|
||||
import forestry.factory.gadgets.MachineMoistener.RecipeManager;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.forestry.Moistener")
|
||||
public class Moistener {
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
package modtweaker2.mods.forestry.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.getFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.InputHelper.toStacks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import forestry.factory.gadgets.MachineSqueezer;
|
||||
import forestry.factory.gadgets.MachineSqueezer.Recipe;
|
||||
import forestry.factory.gadgets.MachineSqueezer.RecipeManager;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.forestry.Squeezer")
|
||||
public class Squeezer {
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
package modtweaker2.mods.forestry.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.getFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toFluid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import forestry.factory.gadgets.MachineStill;
|
||||
import forestry.factory.gadgets.MachineStill.Recipe;
|
||||
import forestry.factory.gadgets.MachineStill.RecipeManager;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.forestry.Still")
|
||||
public class Still {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package modtweaker2.mods.forestry.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
@@ -14,9 +16,6 @@ import forestry.factory.gadgets.MachineFabricator.Recipe;
|
||||
import forestry.factory.gadgets.MachineFabricator.RecipeManager;
|
||||
import forestry.factory.gadgets.MachineFabricator.Smelting;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.forestry.ThermionicFabricator")
|
||||
public class ThermionicFabricator {
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package modtweaker2.mods.fsp.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.mods.fsp.FSPHelper.getLiquid;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseMapAddition;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
@@ -16,8 +17,6 @@ import flaxbeard.steamcraft.api.CrucibleFormula;
|
||||
import flaxbeard.steamcraft.api.CrucibleLiquid;
|
||||
import flaxbeard.steamcraft.api.SteamcraftRegistry;
|
||||
import flaxbeard.steamcraft.api.Tuple3;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.fsp.Crucible")
|
||||
public class Crucible {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package modtweaker2.mods.fsp.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseMapAddition;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
@@ -11,8 +12,6 @@ import org.apache.commons.lang3.tuple.MutablePair;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import flaxbeard.steamcraft.api.SteamcraftRegistry;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.fsp.Furnace")
|
||||
public class Furnace {
|
||||
|
||||
@@ -8,8 +8,8 @@ import java.util.List;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -6,8 +6,8 @@ import mariculture.api.core.MaricultureHandlers;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.mariculture.MaricultureHelper;
|
||||
import modtweaker2.util.BaseMapAddition;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -12,8 +12,8 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.mods.mariculture.MaricultureHelper;
|
||||
import modtweaker2.util.BaseMapAddition;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -10,10 +10,10 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.mods.mariculture.MaricultureHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.util.BaseMapAddition;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@@ -14,8 +14,8 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
import modtweaker2.mods.mariculture.MaricultureHelper;
|
||||
import modtweaker2.util.BaseDescriptionAddition;
|
||||
import modtweaker2.util.BaseDescriptionRemoval;
|
||||
import modtweaker2.utils.BaseDescriptionAddition;
|
||||
import modtweaker2.utils.BaseDescriptionRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package modtweaker2.mods.mariculture.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import mariculture.api.core.MaricultureHandlers;
|
||||
import mariculture.api.core.RecipeVat;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.mariculture.Vat")
|
||||
public class Vat {
|
||||
|
||||
@@ -17,7 +17,7 @@ import modtweaker2.mods.mekanism.handlers.Purification;
|
||||
import modtweaker2.mods.mekanism.handlers.Reaction;
|
||||
import modtweaker2.mods.mekanism.handlers.Sawmill;
|
||||
import modtweaker2.mods.mekanism.handlers.Separator;
|
||||
import modtweaker2.util.TweakerPlugin;
|
||||
import modtweaker2.utils.TweakerPlugin;
|
||||
|
||||
public class Mekanism extends TweakerPlugin {
|
||||
public Mekanism() {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package modtweaker2.mods.mekanism.gas;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
|
||||
public class MCGasStack implements IGasStack {
|
||||
|
||||
@@ -3,6 +3,7 @@ package modtweaker2.mods.mekanism.handlers;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.mods.mekanism.MekanismHelper.toGas;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.mekanism.gas.IGasStack;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package modtweaker2.mods.mekanism.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import static modtweaker2.mods.mekanism.MekanismHelper.toGas;
|
||||
|
||||
import java.util.Iterator;
|
||||
@@ -19,8 +21,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.mekanism.chemical.Dissolution")
|
||||
public class ChemicalDissolution {
|
||||
|
||||
@@ -16,7 +16,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
public class ChemicalInjection {
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack input, IGasStack gas, IItemStack output) {
|
||||
AdvancedInput aInput = new AdvancedInput(toStack(input), toGas(gas).getGas());
|
||||
AdvancedInput aInput = new AdvancedInput(toStack(input), toGas(gas).getGas());
|
||||
MineTweakerAPI.apply(new AddMekanismRecipe("CHEMICAL_INJECTION_CHAMBER", Recipe.CHEMICAL_INJECTION_CHAMBER.get(), aInput, toStack(output)));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package modtweaker2.mods.mekanism.handlers;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -19,41 +20,44 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@ZenClass("mods.mekanism.Infuser")
|
||||
public class Infuser {
|
||||
@ZenMethod
|
||||
public static void addRecipe(String type, int infuse, IItemStack input, IItemStack output) {
|
||||
InfusionInput infuseIn = new InfusionInput(InfuseRegistry.get(type), infuse, toStack(input));
|
||||
InfusionOutput infuseOut = new InfusionOutput(infuseIn, toStack(output));
|
||||
MineTweakerAPI.apply(new AddMekanismRecipe("METALLURGIC_INFUSER", Recipe.METALLURGIC_INFUSER.get(), infuseIn, infuseOut));
|
||||
}
|
||||
@ZenMethod
|
||||
public static void addRecipe(String type, int infuse, IItemStack input, IItemStack output) {
|
||||
InfusionInput infuseIn = new InfusionInput(InfuseRegistry.get(type), infuse, toStack(input));
|
||||
InfusionOutput infuseOut = new InfusionOutput(infuseIn, toStack(output));
|
||||
MineTweakerAPI.apply(new AddMekanismRecipe("METALLURGIC_INFUSER", Recipe.METALLURGIC_INFUSER.get(), infuseIn, infuseOut));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove("METALLURGIC_INFUSER", Recipe.METALLURGIC_INFUSER.get(), new InfusionOutput(null, toStack(output))));
|
||||
}
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove("METALLURGIC_INFUSER", Recipe.METALLURGIC_INFUSER.get(), new InfusionOutput(null, toStack(output))));
|
||||
}
|
||||
|
||||
private static class Remove extends RemoveMekanismRecipe {
|
||||
public Remove(String string, Map map, Object key) {
|
||||
super(string, map, key);
|
||||
}
|
||||
private static class Remove extends RemoveMekanismRecipe {
|
||||
public Remove(String string, Map map, Object key) {
|
||||
super(string, map, key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
Iterator it = map.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry pairs = (Map.Entry) it.next();
|
||||
InfusionInput key = (InfusionInput) pairs.getKey();
|
||||
InfusionOutput value = (InfusionOutput) pairs.getValue();
|
||||
if (key != null) {
|
||||
if (this.key instanceof InfusionOutput && areEqual(value.resource, ((InfusionOutput) this.key).resource)) {
|
||||
this.key = key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void apply() {
|
||||
ArrayList<InfusionInput> recipesToRemove = new ArrayList<InfusionInput>();
|
||||
Iterator it = map.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry pairs = (Map.Entry) it.next();
|
||||
InfusionInput key = (InfusionInput) pairs.getKey();
|
||||
InfusionOutput value = (InfusionOutput) pairs.getValue();
|
||||
if (key != null) {
|
||||
if (this.key instanceof InfusionOutput && areEqual(value.resource, ((InfusionOutput) this.key).resource)) {
|
||||
this.key = key;
|
||||
recipesToRemove.add(key);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
recipe = map.get(key);
|
||||
map.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (InfusionInput r : recipesToRemove) {
|
||||
map.remove(r);
|
||||
}
|
||||
recipe = map.get(key);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.mekanism.util.AddMekanismRecipe;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -10,8 +10,7 @@ import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.mekanism.util.AddMekanismRecipe;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@@ -11,7 +11,7 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.mods.mekanism.gas.IGasStack;
|
||||
import modtweaker2.mods.mekanism.util.AddMekanismRecipe;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -7,7 +7,7 @@ import mekanism.api.ChemicalPair;
|
||||
import mekanism.api.PressurizedReactants;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.infuse.InfusionOutput;
|
||||
import modtweaker2.util.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import mekanism.api.PressurizedReactants;
|
||||
import mekanism.api.PressurizedRecipe;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.infuse.InfusionOutput;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.metallurgy.MetallurgyHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package modtweaker2.mods.metallurgy.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.metallurgy.MetallurgyHelper;
|
||||
import modtweaker2.util.BaseMapAddition;
|
||||
import modtweaker2.util.BaseMapRemoval;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.metallurgy.Crusher")
|
||||
public class Crusher {
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package modtweaker2.mods.pneumaticcraft.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import pneumaticCraft.api.recipe.AssemblyRecipe;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.pneumaticcraft.Assembly")
|
||||
public class Assembly {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package modtweaker2.mods.pneumaticcraft.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStacks;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import pneumaticCraft.api.recipe.PressureChamberRecipe;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.pneumaticcraft.Pressure")
|
||||
public class Pressure {
|
||||
|
||||
@@ -2,63 +2,63 @@ package modtweaker2.mods.railcraft.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import mods.railcraft.api.crafting.IBlastFurnaceRecipe;
|
||||
import mods.railcraft.api.crafting.RailcraftCraftingManager;
|
||||
import modtweaker2.mods.railcraft.RailcraftHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@ZenClass("mods.railcraft.BlastFurnace")
|
||||
public class BlastFurnace {
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack input, boolean matchDamage, boolean matchNBT, int cookTime, IItemStack output) {
|
||||
MineTweakerAPI.apply(new Add(RailcraftHelper.getBlastFurnaceRecipe(toStack(input), matchDamage, matchNBT, cookTime, toStack(output))));
|
||||
}
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack input, boolean matchDamage, boolean matchNBT, int cookTime, IItemStack output) {
|
||||
MineTweakerAPI.apply(new Add(RailcraftHelper.getBlastFurnaceRecipe(toStack(input), matchDamage, matchNBT, cookTime, toStack(output))));
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(IBlastFurnaceRecipe recipe) {
|
||||
super("Blast Furnace", RailcraftHelper.furnace, recipe);
|
||||
}
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(IBlastFurnaceRecipe recipe) {
|
||||
super("Blast Furnace", RailcraftHelper.furnace, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((IBlastFurnaceRecipe) recipe).getOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((IBlastFurnaceRecipe) recipe).getOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output)));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output)));
|
||||
}
|
||||
private static class Remove extends BaseListRemoval {
|
||||
public Remove(ItemStack stack) {
|
||||
super("Blast Furnace", RailcraftHelper.furnace, stack);
|
||||
}
|
||||
|
||||
private static class Remove extends BaseListRemoval {
|
||||
public Remove(ItemStack stack) {
|
||||
super("Blast Furnace", RailcraftHelper.furnace, stack);
|
||||
}
|
||||
@Override
|
||||
public void apply() {
|
||||
ArrayList<IBlastFurnaceRecipe> recipesToRemove = new ArrayList<IBlastFurnaceRecipe>();
|
||||
for (IBlastFurnaceRecipe r : RailcraftHelper.furnace) {
|
||||
if (r.getOutput() != null && stack.isItemEqual(r.getOutput())) {
|
||||
recipesToRemove.add(r);
|
||||
}
|
||||
}
|
||||
for (IBlastFurnaceRecipe r : recipesToRemove)
|
||||
RailcraftCraftingManager.blastFurnace.getRecipes().remove(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBlastFurnaceRecipe r : RailcraftHelper.furnace) {
|
||||
if (r != null) {
|
||||
if (r.getOutput() != null && areEqual(r.getOutput(), stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RailcraftHelper.furnace.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@ import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import mods.railcraft.api.crafting.ICokeOvenRecipe;
|
||||
import modtweaker2.mods.railcraft.RailcraftHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -6,8 +6,8 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import mods.railcraft.api.crafting.IRockCrusherRecipe;
|
||||
import modtweaker2.mods.railcraft.RailcraftHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
package modtweaker2.mods.railcraft.handlers;
|
||||
|
||||
import appeng.recipes.game.ShapedRecipe;
|
||||
import appeng.recipes.game.ShapelessRecipe;
|
||||
import static modtweaker2.helpers.InputHelper.toObjects;
|
||||
import static modtweaker2.helpers.InputHelper.toShapedObjects;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import mods.railcraft.api.crafting.RailcraftCraftingManager;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.mods.railcraft.RailcraftHelper;
|
||||
import modtweaker2.util.BaseCraftingAddition;
|
||||
import modtweaker2.util.BaseCraftingRemoval;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import modtweaker2.utils.BaseCraftingAddition;
|
||||
import modtweaker2.utils.BaseCraftingRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.railcraft.Rolling")
|
||||
public class RollingMachine {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package modtweaker2.mods.tconstruct;
|
||||
|
||||
import static modtweaker2.helpers.LogHelper.logPrinted;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -9,7 +11,6 @@ import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.api.server.ICommandFunction;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.tools.ToolMaterial;
|
||||
import static modtweaker2.helpers.LogHelper.*;
|
||||
|
||||
public class MaterialLogger implements ICommandFunction {
|
||||
private static ArrayList<String> materials = new ArrayList();
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
package modtweaker2.mods.tconstruct;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.crafting.PatternBuilder.MaterialSet;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import tconstruct.tools.logic.PartBuilderLogic;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import modtweaker2.mods.tconstruct.handlers.Casting;
|
||||
import modtweaker2.mods.tconstruct.handlers.Drying;
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
package modtweaker2.mods.tconstruct.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.tconstruct.Casting")
|
||||
public class Casting {
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
package modtweaker2.mods.tconstruct.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import tconstruct.library.crafting.DryingRackRecipes;
|
||||
import tconstruct.library.crafting.DryingRackRecipes.DryingRecipe;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.tconstruct.Drying")
|
||||
public class Drying {
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.List;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import tconstruct.library.modifier.ItemModifier;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package modtweaker2.mods.tconstruct.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
import static modtweaker2.helpers.InputHelper.isABlock;
|
||||
import static modtweaker2.helpers.InputHelper.toFluid;
|
||||
import static modtweaker2.helpers.InputHelper.toFluids;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -13,10 +15,10 @@ import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import modtweaker2.util.BaseDescriptionAddition;
|
||||
import modtweaker2.util.BaseDescriptionRemoval;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseDescriptionAddition;
|
||||
import modtweaker2.utils.BaseDescriptionRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
package modtweaker2.mods.tconstruct.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.util.BaseSetVar;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.crafting.PatternBuilder.ItemKey;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.tconstruct.Tweaks")
|
||||
public class TiCTweaks {
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package modtweaker2.mods.thaumcraft.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toObjects;
|
||||
import static modtweaker2.helpers.InputHelper.toShapedObjects;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -15,8 +19,6 @@ import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.crafting.IArcaneRecipe;
|
||||
import thaumcraft.api.crafting.ShapedArcaneRecipe;
|
||||
import thaumcraft.api.crafting.ShapelessArcaneRecipe;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.thaumcraft.Arcane")
|
||||
public class Arcane {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package modtweaker2.mods.thaumcraft.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
|
||||
import modtweaker2.util.BaseDescriptionAddition;
|
||||
import modtweaker2.util.BaseDescriptionRemoval;
|
||||
import modtweaker2.utils.BaseDescriptionAddition;
|
||||
import modtweaker2.utils.BaseDescriptionRemoval;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
@@ -14,8 +16,6 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.thaumcraft.Aspects")
|
||||
public class Aspects {
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package modtweaker2.mods.thaumcraft.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toObject;
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
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;
|
||||
import thaumcraft.api.crafting.CrucibleRecipe;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.thaumcraft.Crucible")
|
||||
public class Crucible {
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package modtweaker2.mods.thaumcraft.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import static modtweaker2.helpers.InputHelper.toStacks;
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
|
||||
import modtweaker2.mods.thaumcraft.recipe.MTInfusionRecipe;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.BaseListRemoval;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
@@ -14,8 +17,6 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.crafting.InfusionEnchantmentRecipe;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.thaumcraft.Infusion")
|
||||
public class Infusion {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package modtweaker2.mods.thaumcraft.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
@@ -28,8 +29,6 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.api.research.ResearchPage.PageType;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.thaumcraft.Research")
|
||||
public class Research {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package modtweaker2.mods.thaumcraft.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -12,8 +14,6 @@ import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
@ZenClass("mods.thaumcraft.Warp")
|
||||
public class Warp {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package modtweaker2.mods.thaumcraft.research;
|
||||
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.IUndoableAction;
|
||||
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
@@ -14,8 +15,6 @@ import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.research.ResearchCategories;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.api.research.ResearchPage.PageType;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
public class AddPage implements IUndoableAction {
|
||||
String key;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package modtweaker2.mods.thaumcraft.research;
|
||||
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
import minetweaker.IUndoableAction;
|
||||
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -12,8 +13,6 @@ import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.research.ResearchCategories;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
public class RefreshResearch implements IUndoableAction {
|
||||
String research;
|
||||
|
||||
@@ -9,8 +9,8 @@ import java.util.Map;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.mods.thermalexpansion.ThermalHelper;
|
||||
import modtweaker2.util.BaseDescriptionAddition;
|
||||
import modtweaker2.util.BaseDescriptionRemoval;
|
||||
import modtweaker2.utils.BaseDescriptionAddition;
|
||||
import modtweaker2.utils.BaseDescriptionRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -19,116 +19,119 @@ import cofh.thermalexpansion.util.crafting.SmelterManager.RecipeSmelter;
|
||||
|
||||
@ZenClass("mods.thermalexpansion.Smelter")
|
||||
public class Smelter {
|
||||
private static boolean removeValidated(ComparableItemStackSafe stack) {
|
||||
for (Map.Entry entry : ThermalHelper.getSmelterMap().entrySet()) {
|
||||
RecipeSmelter recipe = (RecipeSmelter) entry.getValue();
|
||||
if (stack.equals(new ComparableItemStackSafe(recipe.getPrimaryInput()))) {
|
||||
return false;
|
||||
} else if (stack.equals(new ComparableItemStackSafe(recipe.getSecondaryInput()))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private static boolean removeValidated(ComparableItemStackSafe stack) {
|
||||
for (Map.Entry entry : ThermalHelper.getSmelterMap().entrySet()) {
|
||||
if (entry != null && entry.getValue() != null) {
|
||||
RecipeSmelter recipe = (RecipeSmelter) entry.getValue();
|
||||
if (recipe != null) {
|
||||
if (stack.equals(new ComparableItemStackSafe(recipe.getPrimaryInput()))) {
|
||||
return false;
|
||||
} else if (stack.equals(new ComparableItemStackSafe(recipe.getSecondaryInput()))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ThermalHelper.smelterValid.remove(stack);
|
||||
}
|
||||
|
||||
return ThermalHelper.smelterValid.remove(stack);
|
||||
}
|
||||
@ZenMethod
|
||||
public static void addRecipe(int energy, IItemStack input, IItemStack input2, IItemStack output) {
|
||||
addRecipe(energy, input, input2, output, null, 0);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(int energy, IItemStack input, IItemStack input2, IItemStack output) {
|
||||
addRecipe(energy, input, input2, output, null, 0);
|
||||
}
|
||||
@ZenMethod
|
||||
public static void addRecipe(int energy, IItemStack input, IItemStack input2, IItemStack output, IItemStack output2, int chance) {
|
||||
ItemStack in1 = toStack(input);
|
||||
ItemStack in2 = toStack(input2);
|
||||
ItemStack out1 = toStack(output);
|
||||
ItemStack out2 = toStack(output2);
|
||||
RecipeSmelter recipe = (RecipeSmelter) ThermalHelper.getTERecipe(ThermalHelper.smelterRecipe, in1, in2, out1, out2, chance, energy);
|
||||
MineTweakerAPI.apply(new Add(in1, in2, recipe));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(int energy, IItemStack input, IItemStack input2, IItemStack output, IItemStack output2, int chance) {
|
||||
ItemStack in1 = toStack(input);
|
||||
ItemStack in2 = toStack(input2);
|
||||
ItemStack out1 = toStack(output);
|
||||
ItemStack out2 = toStack(output2);
|
||||
RecipeSmelter recipe = (RecipeSmelter) ThermalHelper.getTERecipe(ThermalHelper.smelterRecipe, in1, in2, out1, out2, chance, energy);
|
||||
MineTweakerAPI.apply(new Add(in1, in2, recipe));
|
||||
}
|
||||
private static class Add extends BaseDescriptionAddition {
|
||||
private final ComparableItemStackSafe input1;
|
||||
private final ComparableItemStackSafe input2;
|
||||
private final List key;
|
||||
private final RecipeSmelter recipe;
|
||||
|
||||
private static class Add extends BaseDescriptionAddition {
|
||||
private final ComparableItemStackSafe input1;
|
||||
private final ComparableItemStackSafe input2;
|
||||
private final List key;
|
||||
private final RecipeSmelter recipe;
|
||||
public Add(ItemStack input1, ItemStack input2, RecipeSmelter recipe) {
|
||||
super("Induction Smelter");
|
||||
this.input1 = new ComparableItemStackSafe(input1);
|
||||
this.input2 = new ComparableItemStackSafe(input2);
|
||||
this.key = (Arrays.asList(new ComparableItemStackSafe[] { this.input1, this.input2 }));
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
public Add(ItemStack input1, ItemStack input2, RecipeSmelter recipe) {
|
||||
super("Induction Smelter");
|
||||
this.input1 = new ComparableItemStackSafe(input1);
|
||||
this.input2 = new ComparableItemStackSafe(input2);
|
||||
this.key = (Arrays.asList(new ComparableItemStackSafe[] { this.input1, this.input2 }));
|
||||
this.recipe = recipe;
|
||||
}
|
||||
@Override
|
||||
public void apply() {
|
||||
ThermalHelper.getSmelterMap().put(key, recipe);
|
||||
ThermalHelper.smelterValid.add(input1);
|
||||
ThermalHelper.smelterValid.add(input2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
ThermalHelper.getSmelterMap().put(key, recipe);
|
||||
ThermalHelper.smelterValid.add(input1);
|
||||
ThermalHelper.smelterValid.add(input2);
|
||||
}
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return ThermalHelper.getSmelterMap() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return ThermalHelper.getSmelterMap() != null;
|
||||
}
|
||||
@Override
|
||||
public void undo() {
|
||||
ThermalHelper.getSmelterMap().remove(key);
|
||||
removeValidated(input1);
|
||||
removeValidated(input2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
ThermalHelper.getSmelterMap().remove(key);
|
||||
removeValidated(input1);
|
||||
removeValidated(input2);
|
||||
}
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((RecipeSmelter) recipe).getPrimaryOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((RecipeSmelter) recipe).getPrimaryOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack input, IItemStack input2) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(input), toStack(input2)));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack input, IItemStack input2) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(input), toStack(input2)));
|
||||
}
|
||||
private static class Remove extends BaseDescriptionRemoval {
|
||||
private final ComparableItemStackSafe input1;
|
||||
private final ComparableItemStackSafe input2;
|
||||
private final List key;
|
||||
private RecipeSmelter recipe;
|
||||
|
||||
private static class Remove extends BaseDescriptionRemoval {
|
||||
private final ComparableItemStackSafe input1;
|
||||
private final ComparableItemStackSafe input2;
|
||||
private final List key;
|
||||
private RecipeSmelter recipe;
|
||||
public Remove(ItemStack input1, ItemStack input2) {
|
||||
super("Induction Smelter");
|
||||
this.input1 = new ComparableItemStackSafe(input1);
|
||||
this.input2 = new ComparableItemStackSafe(input2);
|
||||
this.key = (Arrays.asList(new ComparableItemStackSafe[] { this.input1, this.input2 }));
|
||||
}
|
||||
|
||||
public Remove(ItemStack input1, ItemStack input2) {
|
||||
super("Induction Smelter");
|
||||
this.input1 = new ComparableItemStackSafe(input1);
|
||||
this.input2 = new ComparableItemStackSafe(input2);
|
||||
this.key = (Arrays.asList(new ComparableItemStackSafe[] { this.input1, this.input2 }));
|
||||
}
|
||||
@Override
|
||||
public void apply() {
|
||||
recipe = ThermalHelper.getSmelterMap().get(key);
|
||||
ThermalHelper.getSmelterMap().remove(key);
|
||||
removeValidated(input1);
|
||||
removeValidated(input2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
recipe = ThermalHelper.getSmelterMap().get(key);
|
||||
ThermalHelper.getSmelterMap().remove(key);
|
||||
removeValidated(input1);
|
||||
removeValidated(input2);
|
||||
}
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return ThermalHelper.getSmelterMap() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return ThermalHelper.getSmelterMap() != null;
|
||||
}
|
||||
@Override
|
||||
public void undo() {
|
||||
ThermalHelper.getSmelterMap().put(key, recipe);
|
||||
ThermalHelper.smelterValid.add(input1);
|
||||
ThermalHelper.smelterValid.add(input2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
ThermalHelper.getSmelterMap().put(key, recipe);
|
||||
ThermalHelper.smelterValid.add(input1);
|
||||
ThermalHelper.smelterValid.add(input2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return input1.toItemStack().getDisplayName() + " + " + input2.toItemStack().getDisplayName();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return input1.toItemStack().getDisplayName() + " + " + input2.toItemStack().getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.mods.thermalexpansion.ThermalHelper;
|
||||
import modtweaker2.util.BaseDescriptionAddition;
|
||||
import modtweaker2.util.BaseDescriptionRemoval;
|
||||
import modtweaker2.utils.BaseDescriptionAddition;
|
||||
import modtweaker2.utils.BaseDescriptionRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
public abstract class BaseCraftingAddition extends BaseDescriptionAddition {
|
||||
protected final List<IRecipe> list;
|
||||
protected final boolean shapeless;
|
||||
protected final ItemStack output;
|
||||
protected final Object[] recipe;
|
||||
|
||||
public BaseCraftingAddition(String name, boolean shapeless, List list, ItemStack output, Object... recipe) {
|
||||
super(name);
|
||||
this.shapeless = shapeless;
|
||||
this.output = output;
|
||||
this.recipe = recipe;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
if (shapeless) applyShapeless();
|
||||
else applyShaped();
|
||||
}
|
||||
|
||||
public abstract void applyShaped();
|
||||
|
||||
public abstract void applyShapeless();
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return list != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
IRecipe remove = null;
|
||||
for (IRecipe recipe : list) {
|
||||
if (recipe.getRecipeOutput() != null && areEqual(recipe.getRecipeOutput(), output)) {
|
||||
remove = recipe;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
list.remove(remove);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return output.getDisplayName();
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import static modtweaker2.helpers.InputHelper.*;
|
||||
import static modtweaker2.helpers.StackHelper.*;
|
||||
|
||||
public class BaseCraftingRemoval extends BaseListRemoval {
|
||||
public BaseCraftingRemoval(String name, List list, ItemStack stack) {
|
||||
super(name, list, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IRecipe r : (List<IRecipe>) list) {
|
||||
if (r.getRecipeOutput() != null && r.getRecipeOutput() instanceof ItemStack && areEqual(r.getRecipeOutput(), stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
list.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
|
||||
public abstract class BaseDescriptionAddition implements IUndoableAction {
|
||||
protected String description;
|
||||
|
||||
public BaseDescriptionAddition(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
|
||||
public abstract class BaseDescriptionRemoval implements IUndoableAction {
|
||||
protected String description;
|
||||
|
||||
public BaseDescriptionRemoval(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Restoring " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public abstract class BaseListAddition implements IUndoableAction {
|
||||
protected final List list;
|
||||
protected final Object recipe;
|
||||
protected String description;
|
||||
|
||||
public BaseListAddition(String description, List list, Object recipe) {
|
||||
this(list, recipe);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public BaseListAddition(List list, Object recipe) {
|
||||
this.list = list;
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
list.add(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return list != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
list.remove(recipe);
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
if (recipe instanceof ItemStack) return "Adding " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack) return "Adding " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Adding " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
if (recipe instanceof ItemStack) return "Removing " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack) return "Removing " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import minetweaker.IUndoableAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public abstract class BaseListRemoval implements IUndoableAction {
|
||||
protected final String description;
|
||||
protected final List list;
|
||||
|
||||
protected final FluidStack fluid;
|
||||
protected final ItemStack stack;
|
||||
protected Object recipe;
|
||||
|
||||
public BaseListRemoval(String description, List list, ItemStack stack, FluidStack fluid) {
|
||||
this.list = list;
|
||||
this.stack = stack;
|
||||
this.description = description;
|
||||
this.fluid = fluid;
|
||||
}
|
||||
|
||||
public BaseListRemoval(String description, List list, ItemStack stack) {
|
||||
this(description, list, stack, null);
|
||||
}
|
||||
|
||||
public BaseListRemoval(String description, List list, FluidStack fluid) {
|
||||
this(description, list, null, fluid);
|
||||
}
|
||||
|
||||
public BaseListRemoval(List list, ItemStack stack) {
|
||||
this(null, list, stack);
|
||||
}
|
||||
|
||||
public BaseListRemoval(List list, FluidStack stack) {
|
||||
this(null, list, stack);
|
||||
}
|
||||
|
||||
public BaseListRemoval(String description, List list) {
|
||||
this(description, list, null, null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return list != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
list.add(recipe);
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
if (recipe instanceof ItemStack) return "Removing " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack) return "Removing " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
if (recipe instanceof ItemStack) return "Restoring " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack) return "Restoring " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Restoring " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public abstract class BaseMapAddition implements IUndoableAction {
|
||||
protected String description;
|
||||
protected final Map map;
|
||||
protected Object key;
|
||||
protected Object recipe;
|
||||
|
||||
public BaseMapAddition(Map map, Object key, Object recipe) {
|
||||
this(null, map, key, recipe);
|
||||
}
|
||||
|
||||
public BaseMapAddition(String description, Map map, Object key, Object recipe) {
|
||||
this.map = map;
|
||||
this.key = key;
|
||||
this.recipe = recipe;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
map.put(key, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return map != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
map.remove(key);
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
if (recipe instanceof ItemStack) return "Adding " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack) return "Adding " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Adding " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
if (recipe instanceof ItemStack) return "Removing " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack) return "Removing " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public abstract class BaseMapRemoval implements IUndoableAction {
|
||||
protected Object stack;
|
||||
protected String description;
|
||||
protected final Map map;
|
||||
protected Object key;
|
||||
protected Object recipe;
|
||||
|
||||
public BaseMapRemoval(Object stack, Map map, Object key) {
|
||||
this(null, map, key, stack);
|
||||
}
|
||||
|
||||
public BaseMapRemoval(String description, Map map, Object stack) {
|
||||
this(description, map, null, stack);
|
||||
}
|
||||
|
||||
public BaseMapRemoval(String description, Map map, Object key, Object stack) {
|
||||
this.stack = stack;
|
||||
this.map = map;
|
||||
this.key = key;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
recipe = map.get(key);
|
||||
map.remove(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return map != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
map.put(key, recipe);
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
if (recipe instanceof ItemStack) return "Removing " + description + " Recipe for : " + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack) return "Removing " + description + " Recipe for : " + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
if (recipe instanceof ItemStack) return "Restoring " + description + " Recipe for : " + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack) return "Restoring " + description + " Recipe for : " + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Restoring " + description + " Recipe for : " + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
|
||||
public abstract class BaseMultipleListRemoval implements IUndoableAction {
|
||||
public static enum Position {
|
||||
ALL, FIRST, LAST;
|
||||
}
|
||||
|
||||
protected final Position pos;
|
||||
protected final String description;
|
||||
protected final List list;
|
||||
protected final Object search;
|
||||
protected ArrayList<Object> recipes;
|
||||
|
||||
public BaseMultipleListRemoval(String description, List list, Object search, Position pos) {
|
||||
this.pos = pos;
|
||||
this.description = description;
|
||||
this.list = list;
|
||||
this.search = search;
|
||||
}
|
||||
|
||||
//Return whether the items are equal or not
|
||||
protected abstract boolean isEqual(Object recipe, Object search);
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
//Create a new list
|
||||
recipes = new ArrayList();
|
||||
for (Object o : list) {
|
||||
if (isEqual(o, search)) {
|
||||
//If we want the last position, reset the array
|
||||
if (pos == Position.LAST) {
|
||||
recipes = new ArrayList();
|
||||
}
|
||||
|
||||
recipes.add(o);
|
||||
|
||||
//If we want the first position, exit the loop
|
||||
if (pos == Position.FIRST) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Remove all the recipes that were considered valid for removal
|
||||
for (Object o : recipes) {
|
||||
list.remove(o);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return recipes != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
for (Object o : recipes) {
|
||||
list.add(o);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract String getRecipeInfo();
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Restoring " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
|
||||
public abstract class BaseSetVar implements IUndoableAction {
|
||||
protected Object object;
|
||||
protected final String description;
|
||||
protected final Class clazz;
|
||||
protected final String field;
|
||||
protected final int original;
|
||||
protected final int newValue;
|
||||
|
||||
public BaseSetVar(String description, Class clazz, Object object, String field, int original, int newValue) {
|
||||
this(description, clazz, field, original, newValue);
|
||||
this.object = object;
|
||||
}
|
||||
|
||||
public BaseSetVar(String description, Class clazz, String field, int original, int newValue) {
|
||||
this.description = description;
|
||||
this.clazz = clazz;
|
||||
this.field = field;
|
||||
this.original = original;
|
||||
this.newValue = newValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
ReflectionHelper.setPrivateValue(clazz, object, field, newValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
ReflectionHelper.setPrivateValue(clazz, object, field, original);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Setting " + description + " to " + newValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Setting " + description + " to the default value of " + original;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package modtweaker2.util;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
|
||||
public abstract class BaseUndoable implements IUndoableAction {
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
package modtweaker2.util;
|
||||
package modtweaker2.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -12,4 +12,6 @@ public class ArrayUtils {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
|
||||
public abstract class BaseCraftingAddition extends BaseDescriptionAddition {
|
||||
protected final List<IRecipe> list;
|
||||
protected final boolean shapeless;
|
||||
protected final ItemStack output;
|
||||
protected final Object[] recipe;
|
||||
|
||||
public BaseCraftingAddition(String name, boolean shapeless, List list, ItemStack output, Object... recipe) {
|
||||
super(name);
|
||||
this.shapeless = shapeless;
|
||||
this.output = output;
|
||||
this.recipe = recipe;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
if (shapeless) applyShapeless();
|
||||
else applyShaped();
|
||||
}
|
||||
|
||||
public abstract void applyShaped();
|
||||
|
||||
public abstract void applyShapeless();
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return list != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
IRecipe remove = null;
|
||||
for (IRecipe recipe : list) {
|
||||
if (recipe.getRecipeOutput() != null && areEqual(recipe.getRecipeOutput(), output)) {
|
||||
remove = recipe;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
list.remove(remove);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return output.getDisplayName();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static modtweaker2.helpers.StackHelper.areEqual;
|
||||
|
||||
public class BaseCraftingRemoval extends BaseListRemoval {
|
||||
public BaseCraftingRemoval(String name, List list, ItemStack stack) {
|
||||
super(name, list, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IRecipe r : (List<IRecipe>) list) {
|
||||
if (r.getRecipeOutput() != null && r.getRecipeOutput() instanceof ItemStack && areEqual(r.getRecipeOutput(), stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
list.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
|
||||
public abstract class BaseDescriptionAddition implements IUndoableAction {
|
||||
protected String description;
|
||||
|
||||
public BaseDescriptionAddition(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
|
||||
public abstract class BaseDescriptionRemoval implements IUndoableAction {
|
||||
protected String description;
|
||||
|
||||
public BaseDescriptionRemoval(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Restoring " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BaseListAddition implements IUndoableAction {
|
||||
protected final List list;
|
||||
protected final Object recipe;
|
||||
protected String description;
|
||||
|
||||
public BaseListAddition(String description, List list, Object recipe) {
|
||||
this(list, recipe);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public BaseListAddition(List list, Object recipe) {
|
||||
this.list = list;
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
list.add(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return list != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
list.remove(recipe);
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
if (recipe instanceof ItemStack)
|
||||
return "Adding " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack)
|
||||
return "Adding " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Adding " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
if (recipe instanceof ItemStack)
|
||||
return "Removing " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack)
|
||||
return "Removing " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BaseListRemoval implements IUndoableAction {
|
||||
protected final String description;
|
||||
protected final List list;
|
||||
|
||||
protected final FluidStack fluid;
|
||||
protected final ItemStack stack;
|
||||
protected Object recipe;
|
||||
|
||||
public BaseListRemoval(String description, List list, ItemStack stack, FluidStack fluid) {
|
||||
this.list = list;
|
||||
this.stack = stack;
|
||||
this.description = description;
|
||||
this.fluid = fluid;
|
||||
}
|
||||
|
||||
public BaseListRemoval(String description, List list, ItemStack stack) {
|
||||
this(description, list, stack, null);
|
||||
}
|
||||
|
||||
public BaseListRemoval(String description, List list, FluidStack fluid) {
|
||||
this(description, list, null, fluid);
|
||||
}
|
||||
|
||||
public BaseListRemoval(List list, ItemStack stack) {
|
||||
this(null, list, stack);
|
||||
}
|
||||
|
||||
public BaseListRemoval(List list, FluidStack stack) {
|
||||
this(null, list, stack);
|
||||
}
|
||||
|
||||
public BaseListRemoval(String description, List list) {
|
||||
this(description, list, null, null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return list != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
list.add(recipe);
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
if (recipe instanceof ItemStack)
|
||||
return "Removing " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack)
|
||||
return "Removing " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
if (recipe instanceof ItemStack)
|
||||
return "Restoring " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack)
|
||||
return "Restoring " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Restoring " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class BaseMapAddition implements IUndoableAction {
|
||||
protected final Map map;
|
||||
protected String description;
|
||||
protected Object key;
|
||||
protected Object recipe;
|
||||
|
||||
public BaseMapAddition(Map map, Object key, Object recipe) {
|
||||
this(null, map, key, recipe);
|
||||
}
|
||||
|
||||
public BaseMapAddition(String description, Map map, Object key, Object recipe) {
|
||||
this.map = map;
|
||||
this.key = key;
|
||||
this.recipe = recipe;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
map.put(key, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return map != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
map.remove(key);
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
if (recipe instanceof ItemStack)
|
||||
return "Adding " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack)
|
||||
return "Adding " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Adding " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
if (recipe instanceof ItemStack)
|
||||
return "Removing " + description + " Recipe for :" + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack)
|
||||
return "Removing " + description + " Recipe for :" + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class BaseMapRemoval implements IUndoableAction {
|
||||
protected final Map map;
|
||||
protected Object stack;
|
||||
protected String description;
|
||||
protected Object key;
|
||||
protected Object recipe;
|
||||
|
||||
public BaseMapRemoval(Object stack, Map map, Object key) {
|
||||
this(null, map, key, stack);
|
||||
}
|
||||
|
||||
public BaseMapRemoval(String description, Map map, Object stack) {
|
||||
this(description, map, null, stack);
|
||||
}
|
||||
|
||||
public BaseMapRemoval(String description, Map map, Object key, Object stack) {
|
||||
this.stack = stack;
|
||||
this.map = map;
|
||||
this.key = key;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
recipe = map.get(key);
|
||||
map.remove(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return map != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
map.put(key, recipe);
|
||||
}
|
||||
|
||||
public String getRecipeInfo() {
|
||||
return "Unknown Item";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
if (recipe instanceof ItemStack)
|
||||
return "Removing " + description + " Recipe for : " + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack)
|
||||
return "Removing " + description + " Recipe for : " + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
if (recipe instanceof ItemStack)
|
||||
return "Restoring " + description + " Recipe for : " + ((ItemStack) recipe).getDisplayName();
|
||||
else if (recipe instanceof FluidStack)
|
||||
return "Restoring " + description + " Recipe for : " + ((FluidStack) recipe).getFluid().getLocalizedName();
|
||||
else return "Restoring " + description + " Recipe for : " + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BaseMultipleListRemoval implements IUndoableAction {
|
||||
protected final Position pos;
|
||||
protected final String description;
|
||||
protected final List list;
|
||||
protected final Object search;
|
||||
protected ArrayList<Object> recipes;
|
||||
|
||||
public BaseMultipleListRemoval(String description, List list, Object search, Position pos) {
|
||||
this.pos = pos;
|
||||
this.description = description;
|
||||
this.list = list;
|
||||
this.search = search;
|
||||
}
|
||||
|
||||
//Return whether the items are equal or not
|
||||
protected abstract boolean isEqual(Object recipe, Object search);
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
//Create a new list
|
||||
recipes = new ArrayList();
|
||||
for (Object o : list) {
|
||||
if (isEqual(o, search)) {
|
||||
//If we want the last position, reset the array
|
||||
if (pos == Position.LAST) {
|
||||
recipes = new ArrayList();
|
||||
}
|
||||
|
||||
recipes.add(o);
|
||||
|
||||
//If we want the first position, exit the loop
|
||||
if (pos == Position.FIRST) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Remove all the recipes that were considered valid for removal
|
||||
for (Object o : recipes) {
|
||||
list.remove(o);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return recipes != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
for (Object o : recipes) {
|
||||
list.add(o);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract String getRecipeInfo();
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Restoring " + description + " Recipe for :" + getRecipeInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static enum Position {
|
||||
ALL, FIRST, LAST;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
|
||||
public abstract class BaseSetVar implements IUndoableAction {
|
||||
protected final String description;
|
||||
protected final Class clazz;
|
||||
protected final String field;
|
||||
protected final int original;
|
||||
protected final int newValue;
|
||||
protected Object object;
|
||||
|
||||
public BaseSetVar(String description, Class clazz, Object object, String field, int original, int newValue) {
|
||||
this(description, clazz, field, original, newValue);
|
||||
this.object = object;
|
||||
}
|
||||
|
||||
public BaseSetVar(String description, Class clazz, String field, int original, int newValue) {
|
||||
this.description = description;
|
||||
this.clazz = clazz;
|
||||
this.field = field;
|
||||
this.original = original;
|
||||
this.newValue = newValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
ReflectionHelper.setPrivateValue(clazz, object, field, newValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
ReflectionHelper.setPrivateValue(clazz, object, field, original);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Setting " + description + " to " + newValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Setting " + description + " to the default value of " + original;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package modtweaker2.utils;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
|
||||
public abstract class BaseUndoable implements IUndoableAction {
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package modtweaker2.util;
|
||||
package modtweaker2.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
Reference in new issue
Block a user