mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-26 07:03:05 +00:00
Initial Comment
This commit is contained in:
commit
419ac849d0
276 files changed
+17939
No files matched your search
@@ -0,0 +1,52 @@
|
||||
package modtweaker.mods.mariculture.handlers;
|
||||
|
||||
import static modtweaker.helpers.InputHelper.toStack;
|
||||
import mariculture.api.core.IAnvilHandler.RecipeAnvil;
|
||||
import mariculture.api.core.MaricultureHandlers;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker.mods.mariculture.MaricultureHelper;
|
||||
import modtweaker.util.BaseMapAddition;
|
||||
import modtweaker.util.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@ZenClass("mods.mariculture.Anvil")
|
||||
public class Anvil {
|
||||
//Adding a Mariculture Anvil recipe
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack input, IItemStack output, int hits) {
|
||||
MineTweakerAPI.apply(new Add(new RecipeAnvil(toStack(input), toStack(output), hits)));
|
||||
}
|
||||
|
||||
private static class Add extends BaseMapAddition {
|
||||
public Add(RecipeAnvil recipe) {
|
||||
super("Mariculture Anvil", MaricultureHandlers.anvil.getRecipes(), MaricultureHelper.getKey(recipe.input), recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((RecipeAnvil) recipe).output.getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//Removing a Mariculture Anvil recipe
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack input) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(input)));
|
||||
}
|
||||
|
||||
private static class Remove extends BaseMapRemoval {
|
||||
public Remove(ItemStack stack) {
|
||||
super("Mariculture Anvil", MaricultureHandlers.anvil.getRecipes(), MaricultureHelper.getKey(stack), stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((ItemStack) stack).getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user