IC2Classic Macerator
This commit is contained in:
parent
05b7da8a7b
commit
afc9d8ac7f
52
.gitignore
vendored
52
.gitignore
vendored
|
@ -46,3 +46,55 @@
|
|||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
/bin/
|
||||
|
|
BIN
libs/IC2 Classic Version 1.1.0.16.1 (Dev) (1).jar
Normal file
BIN
libs/IC2 Classic Version 1.1.0.16.1 (Dev) (1).jar
Normal file
Binary file not shown.
|
@ -16,6 +16,7 @@ import modtweaker2.mods.extraUtils.ExtraUtils;
|
|||
import modtweaker2.mods.factorization.Factorization;
|
||||
import modtweaker2.mods.forestry.Forestry;
|
||||
import modtweaker2.mods.fsp.Steamcraft;
|
||||
import modtweaker2.mods.ic2c.IC2C;
|
||||
import modtweaker2.mods.mariculture.Mariculture;
|
||||
import modtweaker2.mods.mekanism.Mekanism;
|
||||
import modtweaker2.mods.metallurgy.Metallurgy;
|
||||
|
@ -84,6 +85,7 @@ public class ModTweaker2 {
|
|||
TweakerPlugin.register("chisel", Chisel.class);
|
||||
TweakerPlugin.register("aura", AuraCascade.class);
|
||||
TweakerPlugin.register("ExtraUtilities", ExtraUtils.class);
|
||||
TweakerPlugin.register("IC2", IC2C.class);
|
||||
|
||||
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||
|
|
11
src/main/java/modtweaker2/mods/ic2c/IC2C.java
Normal file
11
src/main/java/modtweaker2/mods/ic2c/IC2C.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package modtweaker2.mods.ic2c;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import modtweaker2.mods.ic2c.mods.Macerator;
|
||||
|
||||
public class IC2C {
|
||||
|
||||
public IC2C() {
|
||||
MineTweakerAPI.registerClass(Macerator.class);
|
||||
}
|
||||
}
|
70
src/main/java/modtweaker2/mods/ic2c/mods/Macerator.java
Normal file
70
src/main/java/modtweaker2/mods/ic2c/mods/Macerator.java
Normal file
|
@ -0,0 +1,70 @@
|
|||
package modtweaker2.mods.ic2c.mods;
|
||||
|
||||
import ic2.api.recipe.IRecipeInput;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
import ic2.api.recipe.RecipeOutput;
|
||||
import ic2.api.recipe.Recipes;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@ZenClass("mods.ic2classic.Macerator")
|
||||
public class Macerator {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IItemStack input) {
|
||||
MineTweakerAPI.apply(new Add(InputHelper.toStack(output), InputHelper.toStack(input)));
|
||||
}
|
||||
|
||||
private static class Add extends BaseMapAddition<IRecipeInput, RecipeOutput> {
|
||||
|
||||
protected Add(ItemStack output, ItemStack input) {
|
||||
super("Macerator", Recipes.macerator.getRecipes());
|
||||
recipes.put(new RecipeInputItemStack(input), new RecipeOutput(null, output));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(Entry<IRecipeInput, RecipeOutput> recipe) {
|
||||
return recipe.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
LinkedHashMap<IRecipeInput, RecipeOutput> recipes = new LinkedHashMap<IRecipeInput, RecipeOutput>();
|
||||
for (Entry<IRecipeInput, RecipeOutput> set : Recipes.macerator.getRecipes().entrySet()) {
|
||||
for (ItemStack stack : set.getValue().items) {
|
||||
if (stack.isItemEqual(InputHelper.toStack(output))) {
|
||||
recipes.put(set.getKey(), set.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(recipes));
|
||||
}
|
||||
|
||||
private static class Remove extends BaseMapRemoval<IRecipeInput, RecipeOutput> {
|
||||
|
||||
protected Remove(Map<IRecipeInput, RecipeOutput> recipes) {
|
||||
super("Macerator", Recipes.macerator.getRecipes(), recipes);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(Entry<IRecipeInput, RecipeOutput> recipe) {
|
||||
return recipe.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue