QED support, updated some mods

This commit is contained in:
jaredlll08 2015-08-16 21:41:14 +02:00
parent 28b835e733
commit 91498597cc
12 changed files with 89 additions and 1 deletions

View file

@ -1,3 +1,3 @@
mc_version=1.7.10
forge_version=10.13.2.1291
forge_version=10.13.4.1492-1.7.10
mod_version=0.3.0

Binary file not shown.

Binary file not shown.

View file

@ -12,6 +12,7 @@ import modtweaker2.mods.botania.Botania;
import modtweaker2.mods.chisel.Chisel;
import modtweaker2.mods.exnihilo.ExNihilo;
import modtweaker2.mods.extendedworkbench.ExtendedWorkbench;
import modtweaker2.mods.extraUtils.ExtraUtils;
import modtweaker2.mods.factorization.Factorization;
import modtweaker2.mods.forestry.Forestry;
import modtweaker2.mods.fsp.Steamcraft;
@ -84,6 +85,8 @@ public class ModTweaker2 {
TweakerPlugin.register("Forestry", Forestry.class);
TweakerPlugin.register("chisel", Chisel.class);
TweakerPlugin.register("aura", AuraCascade.class);
TweakerPlugin.register("ExtraUtilities", ExtraUtils.class);
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
MinecraftForge.EVENT_BUS.register(new ClientEvents());

View file

@ -0,0 +1,12 @@
package modtweaker2.mods.extraUtils;
import minetweaker.MineTweakerAPI;
import modtweaker2.mods.appeng.handlers.Grind;
import modtweaker2.mods.extraUtils.handlers.QED;
public class ExtraUtils {
public ExtraUtils() {
MineTweakerAPI.registerClass(QED.class);
}
}

View file

@ -0,0 +1,73 @@
package modtweaker2.mods.extraUtils.handlers;
import java.util.LinkedList;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import modtweaker2.helpers.InputHelper;
import modtweaker2.helpers.LogHelper;
import modtweaker2.utils.BaseListAddition;
import modtweaker2.utils.BaseListRemoval;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import com.rwtema.extrautils.tileentity.enderconstructor.EnderConstructorRecipesHandler;
@ZenClass("mods.extraUtils.QED")
public class QED {
@ZenMethod
public static void addShapedRecipe(IItemStack output, IItemStack[][] recipe) {
MineTweakerAPI.apply(new Add(new ShapedOreRecipe(InputHelper.toStack(output), InputHelper.toShapedObjects(recipe))));
}
private static class Add extends BaseListAddition<IRecipe> {
public Add(IRecipe recipe) {
super("QED", EnderConstructorRecipesHandler.recipes);
recipes.add(recipe);
}
@Override
protected String getRecipeInfo(IRecipe recipe) {
return recipe.toString();
}
}
@ZenMethod
public static void removeRecipe(IItemStack toRemove) {
if (toRemove == null) {
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", "QED"));
return;
}
LinkedList<IRecipe> recipes = new LinkedList<IRecipe>();
for (IRecipe recipe : EnderConstructorRecipesHandler.recipes) {
if (recipe != null && recipe.getRecipeOutput() != null && recipe.getRecipeOutput().isItemEqual(InputHelper.toStack(toRemove))) {
recipes.add(recipe);
}
}
MineTweakerAPI.apply(new Remove(recipes));
}
public static class Remove extends BaseListRemoval<IRecipe> {
protected Remove(LinkedList<IRecipe> stacks) {
super("QED", EnderConstructorRecipesHandler.recipes, stacks);
}
@Override
protected String getRecipeInfo(IRecipe recipe) {
return recipe.toString();
}
}
}