mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-26 15:13:05 +00:00
Also changes like all packages inb4 "jared changes a package name in ModTweaker2 breaking compatability with everything" drama tweet.
This commit is contained in:
1 parent
4fd2551072
commit
ec562b62ea
187 files changed
+977
-991
No files matched your search
@@ -0,0 +1,83 @@
|
||||
package modtweaker2.mods.pneumaticcraft.handlers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.util.BaseListAddition;
|
||||
import modtweaker2.util.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 {
|
||||
@ZenMethod
|
||||
public static void addDrillRecipe(IItemStack input, IItemStack output) {
|
||||
MineTweakerAPI.apply(new Add(new AssemblyRecipe(toStack(input), toStack(output)), AssemblyRecipe.drillRecipes));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addLaserRecipe(IItemStack input, IItemStack output) {
|
||||
MineTweakerAPI.apply(new Add(new AssemblyRecipe(toStack(input), toStack(output)), AssemblyRecipe.laserRecipes));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addLaserDrillRecipe(IItemStack input, IItemStack output) {
|
||||
MineTweakerAPI.apply(new Add(new AssemblyRecipe(toStack(input), toStack(output)), AssemblyRecipe.drillLaserRecipes));
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(AssemblyRecipe recipe, List list) {
|
||||
super("Pneumaticraft Assembly", list, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((AssemblyRecipe) recipe).getOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ZenMethod
|
||||
public static void removeDrillRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output), AssemblyRecipe.drillRecipes));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeLaserRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output), AssemblyRecipe.laserRecipes));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeLaserDrillRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output), AssemblyRecipe.drillLaserRecipes));
|
||||
}
|
||||
|
||||
private static class Remove extends BaseListRemoval {
|
||||
public Remove(ItemStack stack, List list) {
|
||||
super("Pneumaticraft Assembly", list, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (AssemblyRecipe r : (List<AssemblyRecipe>) list) {
|
||||
if (r.getOutput() != null && areEqual(r.getOutput(), stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
list.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user