/* TODO crafttweaker package de.ellpeck.naturesaura.compat.crafttweaker; import com.blamejared.mtlib.helpers.InputHelper; import com.blamejared.mtlib.helpers.LogHelper; import com.blamejared.mtlib.utils.BaseMapAddition; import com.blamejared.mtlib.utils.BaseMapRemoval; import crafttweaker.annotations.ZenRegister; import crafttweaker.api.item.IIngredient; import crafttweaker.api.item.IItemStack; import crafttweaker.api.minecraft.CraftTweakerMC; import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.recipes.OfferingRecipe; import de.ellpeck.naturesaura.api.recipes.ing.AmountIngredient; import de.ellpeck.naturesaura.compat.Compat; import net.minecraft.util.ResourceLocation; import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenMethod; import java.util.Collections; import java.util.HashMap; import java.util.Map; @ZenRegister @ZenClass("mods." + NaturesAura.MOD_ID + ".Offering") public final class OfferingTweaker { @ZenMethod public static void addRecipe(String name, IIngredient input, int inputAmount, IIngredient startItem, IItemStack output) { CraftTweakerCompat.SCHEDULED_ACTIONS.add(() -> { ResourceLocation res = new ResourceLocation(Compat.CRAFT_TWEAKER, name); return new Add(Collections.singletonMap(res, new OfferingRecipe(res, new AmountIngredient(CraftTweakerMC.getIngredient(input), inputAmount), CraftTweakerMC.getIngredient(startItem), InputHelper.toStack(output)))); }); } @ZenMethod public static void removeRecipe(IItemStack output) { CraftTweakerCompat.SCHEDULED_ACTIONS.add(() -> { Map recipes = new HashMap<>(); for (OfferingRecipe recipe : NaturesAuraAPI.OFFERING_RECIPES.values()) if (Helper.areItemsEqual(recipe.output, InputHelper.toStack(output), true)) recipes.put(recipe.name, recipe); return new Remove(recipes); }); } private static class Add extends BaseMapAddition { protected Add(Map map) { super("Offering", NaturesAuraAPI.OFFERING_RECIPES, map); } @Override protected String getRecipeInfo(Map.Entry recipe) { return LogHelper.getStackDescription(recipe.getValue().output); } } private static class Remove extends BaseMapRemoval { protected Remove(Map map) { super("Offering", NaturesAuraAPI.OFFERING_RECIPES, map); } @Override protected String getRecipeInfo(Map.Entry recipe) { return LogHelper.getStackDescription(recipe.getValue().output); } } } */