applied energistics tests, not working please hep
This commit is contained in:
parent
67a1cccaef
commit
4fd2551072
BIN
libs/appliedenergistics2-rv2-beta-4-dev.jar
Normal file
BIN
libs/appliedenergistics2-rv2-beta-4-dev.jar
Normal file
Binary file not shown.
|
@ -2,21 +2,9 @@ package modtweaker;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.api.server.ICommandFunction;
|
||||
import minetweaker.mc1710.MineTweakerMod;
|
||||
import modtweaker.commands.EntityMappingLogger;
|
||||
import modtweaker.mods.appeng.AppliedEnergistics;
|
||||
import modtweaker.mods.botania.Botania;
|
||||
import modtweaker.mods.botania.commands.BotaniaBrewLogger;
|
||||
import modtweaker.mods.botania.lexicon.commands.LexiconCategoryLogger;
|
||||
import modtweaker.mods.botania.lexicon.commands.LexiconEntryLogger;
|
||||
import modtweaker.mods.botania.lexicon.commands.LexiconKnowledgeTypesLogger;
|
||||
import modtweaker.mods.botania.lexicon.commands.LexiconPageLogger;
|
||||
import modtweaker.mods.chisel.Chisel;
|
||||
import modtweaker.mods.chisel.commands.ChiselGroupLogger;
|
||||
import modtweaker.mods.chisel.commands.ChiselVariationLogger;
|
||||
import modtweaker.mods.exnihilo.ExNihilo;
|
||||
import modtweaker.mods.extendedworkbench.ExtendedWorkbench;
|
||||
import modtweaker.mods.factorization.Factorization;
|
||||
|
@ -26,15 +14,11 @@ import modtweaker.mods.hee.HardcoreEnderExpansion;
|
|||
import modtweaker.mods.imc.handler.Message;
|
||||
import modtweaker.mods.mariculture.Mariculture;
|
||||
import modtweaker.mods.mekanism.Mekanism;
|
||||
import modtweaker.mods.mekanism.gas.GasLogger;
|
||||
import modtweaker.mods.metallurgy.Metallurgy;
|
||||
import modtweaker.mods.pneumaticcraft.PneumaticCraft;
|
||||
import modtweaker.mods.railcraft.Railcraft;
|
||||
import modtweaker.mods.tconstruct.MaterialLogger;
|
||||
import modtweaker.mods.tconstruct.TConstruct;
|
||||
import modtweaker.mods.thaumcraft.Thaumcraft;
|
||||
import modtweaker.mods.thaumcraft.commands.AspectLogger;
|
||||
import modtweaker.mods.thaumcraft.research.commands.ResearchLogger;
|
||||
import modtweaker.mods.thermalexpansion.ThermalExpansion;
|
||||
import modtweaker.util.TweakerPlugin;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
@ -43,8 +27,6 @@ import cpw.mods.fml.common.Mod;
|
|||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
|
@ -79,6 +61,8 @@ public class ModTweaker {
|
|||
TweakerPlugin.register("ThermalExpansion", ThermalExpansion.class);
|
||||
TweakerPlugin.register("Forestry", Forestry.class);
|
||||
TweakerPlugin.register("chisel", Chisel.class);
|
||||
TweakerPlugin.register("appliedenergistics2-core", AppliedEnergistics.class);
|
||||
|
||||
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||
MinecraftForge.EVENT_BUS.register(new ClientEvents());
|
||||
|
|
10
src/main/java/modtweaker/mods/appeng/AppliedEnergistics.java
Normal file
10
src/main/java/modtweaker/mods/appeng/AppliedEnergistics.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package modtweaker.mods.appeng;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import modtweaker.mods.appeng.handlers.Inscriber;
|
||||
|
||||
public class AppliedEnergistics {
|
||||
public AppliedEnergistics() {
|
||||
MineTweakerAPI.registerClass(Inscriber.class);
|
||||
}
|
||||
}
|
41
src/main/java/modtweaker/mods/appeng/handlers/Inscriber.java
Normal file
41
src/main/java/modtweaker/mods/appeng/handlers/Inscriber.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
package modtweaker.mods.appeng.handlers;
|
||||
|
||||
import static modtweaker.helpers.InputHelper.*;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker.util.BaseListAddition;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import stanhebben.zenscript.annotations.ZenMethodStatic;
|
||||
import appeng.recipes.handlers.Inscribe;
|
||||
import appeng.recipes.handlers.Inscribe.InscriberRecipe;
|
||||
|
||||
@ZenClass("mods.appeng.inscriber")
|
||||
public class Inscriber {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack[] imprintable, IItemStack plateA, IItemStack plateB, IItemStack out, boolean usePlates) {
|
||||
MineTweakerAPI.apply(new Add(new InscriberRecipe(toStacks(imprintable), toStack(plateA), toStack(plateB), toStack(out), usePlates)));
|
||||
Inscribe.inputs.add(toStack(imprintable[0]));
|
||||
Inscribe.inputs.add(toStack(imprintable[1]));
|
||||
Inscribe.inputs.add(toStack(plateA));
|
||||
Inscribe.inputs.add(toStack(plateB));
|
||||
Inscribe.plates.add(toStack(plateA));
|
||||
Inscribe.plates.add(toStack(plateB));
|
||||
|
||||
}
|
||||
|
||||
public static class Add extends BaseListAddition {
|
||||
|
||||
public Add(InscriberRecipe recipe) {
|
||||
super(recipe.toString(), Inscribe.recipes, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
Inscribe.recipes.add((InscriberRecipe) recipe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package modtweaker.mods.botania;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import modtweaker.mods.appeng.handlers.Inscriber;
|
||||
import modtweaker.mods.botania.handlers.Apothecary;
|
||||
import modtweaker.mods.botania.handlers.ElvenTrade;
|
||||
import modtweaker.mods.botania.handlers.Lexicon;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package modtweaker.mods.tconstruct.handlers;
|
||||
|
||||
import static modtweaker.helpers.InputHelper.toStack;
|
||||
import cofh.api.energy.EnergyStorage;
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker.helpers.ReflectionHelper;
|
||||
|
@ -12,6 +14,7 @@ import net.minecraft.item.ItemStack;
|
|||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.crafting.PatternBuilder.ItemKey;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
|
@ -19,133 +22,112 @@ import tconstruct.tools.TinkerTools;
|
|||
|
||||
@ZenClass("mods.tconstruct.Tweaks")
|
||||
public class TiCTweaks {
|
||||
//Set the maximum RF
|
||||
@ZenMethod
|
||||
public static void setRFCapacity(String tool, int capacity) {
|
||||
MineTweakerAPI.apply(new AdjustRF(tool, capacity));
|
||||
}
|
||||
// Set the maximum RF
|
||||
@ZenMethod
|
||||
public static void setRFCapacity(String tool, int capacity) {
|
||||
MineTweakerAPI.apply(new AdjustRF(tool, capacity));
|
||||
}
|
||||
|
||||
private static class AdjustRF extends BaseSetVar {
|
||||
public AdjustRF(String tool, int newValue) {
|
||||
super("RF Maximum for Tinkers Tools", ToolCore.class, ReflectionHelper.getStaticObject(TinkerTools.class, tool), "capacity", 400000, newValue);
|
||||
}
|
||||
}
|
||||
private static class AdjustRF extends BaseSetVar {
|
||||
public AdjustRF(String tool, int newValue) {
|
||||
super("RF Maximum for Tinkers Tools", ToolCore.class, ReflectionHelper.getStaticObject(TinkerTools.class, tool), "capacity", 400000, newValue);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/** Disabling for 0.5, will do this properly for 0.6 **/
|
||||
//Tweaks for enabling / disabling Patterns
|
||||
/* @ZenMethod
|
||||
public static void removePattern(IItemStack stack) {
|
||||
MineTweakerAPI.apply(new DisablePattern(toStack(stack)));
|
||||
}
|
||||
/** Disabling for 0.5, will do this properly for 0.6 **/
|
||||
// Tweaks for enabling / disabling Patterns
|
||||
/*
|
||||
* @ZenMethod public static void removePattern(IItemStack stack) {
|
||||
* MineTweakerAPI.apply(new DisablePattern(toStack(stack))); }
|
||||
*
|
||||
* private static class DisablePattern implements IUndoableAction { private
|
||||
* String key; private MaterialSet set; private List list; private ItemStack
|
||||
* stack; private final ItemStack disable;
|
||||
*
|
||||
* public DisablePattern(ItemStack disable) { this.disable = disable; }
|
||||
*
|
||||
* //Loops through the pattern mappings to find an entry with the same
|
||||
* material name
|
||||
*
|
||||
* @Override public void apply() { for (Entry<List, ItemStack> entry :
|
||||
* TConstructRegistry.patternPartMapping.entrySet()) { ItemStack check =
|
||||
* entry.getValue(); if (check.isItemEqual(disable)) { list =
|
||||
* entry.getKey(); stack = entry.getValue(); break; } }
|
||||
*
|
||||
* TConstructRegistry.patternPartMapping.remove(list); }
|
||||
*
|
||||
* @Override public boolean canUndo() { return true; }
|
||||
*
|
||||
* @Override public void undo() {
|
||||
* TConstructRegistry.patternPartMapping.put(list, stack); }
|
||||
*
|
||||
* @Override public String describe() { return
|
||||
* "Disabling creation of the pattern for: " + disable.getDisplayName(); }
|
||||
*
|
||||
* @Override public String describeUndo() { return
|
||||
* "Enabling creation of the pattern for: " + disable.getDisplayName(); }
|
||||
*
|
||||
* @Override public Object getOverrideKey() { return null; } }
|
||||
*/
|
||||
|
||||
private static class DisablePattern implements IUndoableAction {
|
||||
private String key;
|
||||
private MaterialSet set;
|
||||
private List list;
|
||||
private ItemStack stack;
|
||||
private final ItemStack disable;
|
||||
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public DisablePattern(ItemStack disable) {
|
||||
this.disable = disable;
|
||||
}
|
||||
@ZenMethod
|
||||
public static void addRepairMaterial(IItemStack stack, String material, int value) {
|
||||
ItemStack input = toStack(stack);
|
||||
MineTweakerAPI.apply(new Add(TConstructHelper.getItemKey(input.getItem(), input.getItemDamage(), value, material)));
|
||||
}
|
||||
|
||||
//Loops through the pattern mappings to find an entry with the same material name
|
||||
@Override
|
||||
public void apply() {
|
||||
for (Entry<List, ItemStack> entry : TConstructRegistry.patternPartMapping.entrySet()) {
|
||||
ItemStack check = entry.getValue();
|
||||
if (check.isItemEqual(disable)) {
|
||||
list = entry.getKey();
|
||||
stack = entry.getValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Tweaks for setting repair materials
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(ItemKey recipe) {
|
||||
super("Repair Material", PatternBuilder.instance.materials, recipe);
|
||||
}
|
||||
|
||||
TConstructRegistry.patternPartMapping.remove(list);
|
||||
}
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return new ItemStack(((ItemKey) recipe).item, 1, ((ItemKey) recipe).damage).getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ZenMethod
|
||||
public static void removeRepairMaterial(IItemStack output, @Optional String material) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output), material));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
TConstructRegistry.patternPartMapping.put(list, stack);
|
||||
}
|
||||
// Removes a recipe, apply is never the same for anything, so will always
|
||||
// need to override it
|
||||
private static class Remove extends BaseListRemoval {
|
||||
private final String material;
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Disabling creation of the pattern for: " + disable.getDisplayName();
|
||||
}
|
||||
public Remove(ItemStack stack, String material) {
|
||||
super("Repair Material", PatternBuilder.instance.materials, stack);
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Enabling creation of the pattern for: " + disable.getDisplayName();
|
||||
}
|
||||
// Loops through the registry, to find the item that matches, saves that
|
||||
// recipe then removes it
|
||||
@Override
|
||||
public void apply() {
|
||||
for (ItemKey r : PatternBuilder.instance.materials) {
|
||||
ItemStack clone = new ItemStack(r.item, 1, r.damage);
|
||||
if ((material != null && material.equalsIgnoreCase(r.key)) || (material == null)) {
|
||||
if (clone.isItemEqual(stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
} */
|
||||
PatternBuilder.instance.materials.remove(recipe);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ZenMethod
|
||||
public static void addRepairMaterial(IItemStack stack, String material, int value) {
|
||||
ItemStack input = toStack(stack);
|
||||
MineTweakerAPI.apply(new Add(TConstructHelper.getItemKey(input.getItem(), input.getItemDamage(), value, material)));
|
||||
}
|
||||
|
||||
//Tweaks for setting repair materials
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(ItemKey recipe) {
|
||||
super("Repair Material", PatternBuilder.instance.materials, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return new ItemStack(((ItemKey) recipe).item, 1, ((ItemKey) recipe).damage).getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ZenMethod
|
||||
public static void removeRepairMaterial(IItemStack output, @Optional String material) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output), material));
|
||||
}
|
||||
|
||||
//Removes a recipe, apply is never the same for anything, so will always need to override it
|
||||
private static class Remove extends BaseListRemoval {
|
||||
private final String material;
|
||||
|
||||
public Remove(ItemStack stack, String material) {
|
||||
super("Repair Material", PatternBuilder.instance.materials, stack);
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
//Loops through the registry, to find the item that matches, saves that recipe then removes it
|
||||
@Override
|
||||
public void apply() {
|
||||
for (ItemKey r : PatternBuilder.instance.materials) {
|
||||
ItemStack clone = new ItemStack(r.item, 1, r.damage);
|
||||
if ((material != null && material.equalsIgnoreCase(r.key)) || (material == null)) {
|
||||
if (clone.isItemEqual(stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PatternBuilder.instance.materials.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,11 +30,11 @@ public class Furnace {
|
|||
}
|
||||
|
||||
public void apply() {
|
||||
applied = FurnaceManager.addRecipe(energy, input, output, false);
|
||||
FurnaceManager.addRecipe(energy, input, output, false);
|
||||
}
|
||||
|
||||
public boolean canUndo() {
|
||||
return input != null && applied;
|
||||
return input != null;
|
||||
}
|
||||
|
||||
public String describe() {
|
||||
|
@ -69,7 +69,6 @@ public class Furnace {
|
|||
public Remove(ItemStack inp) {
|
||||
input = inp;
|
||||
}
|
||||
|
||||
public void apply() {
|
||||
removed = FurnaceManager.getRecipe(input);
|
||||
FurnaceManager.removeRecipe(input);
|
||||
|
|
Loading…
Reference in a new issue