mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-18 11:39:07 +00:00
QED support, updated some mods
This commit is contained in:
1 parent
28b835e733
commit
91498597cc
12 files changed
+89
-1
No files matched your search
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user