// Add a heat source @ZenMethod public static void registerHeatSource(IItemStack block) { if (block == null) { MineTweakerAPI.getLogger().logError("Iron Plate: Heat source block must not be null!"); return; } if (!isABlock(toStack(block))) { MineTweakerAPI.getLogger() .logError( "Heat source for Cooking Iron Plate must be a block: " + toStack(block).getDisplayName()); return; } MineTweakerAPI.apply(new PlateBlockAddition(block)); }
// Adding a new cooking recipe for the iron plate @ZenMethod public static void addRecipe( IItemStack output, IItemStack input, int cookingTime, boolean isOvenRecipe) { if ((output == null) || (input == null)) { MineTweakerAPI.getLogger().logError("Iron Plate: Neither input nor output may be null!"); return; } MineTweakerAPI.apply(new Add(new PlateRecipeWrapper(output, input, cookingTime, isOvenRecipe))); }
// Loops through the registry, to find the item that matches, saves that recipe then removes it @Override public void apply() { for (IPlateRecipe r : RecipeRegisterManager.plateRecipe.getRecipeList()) { if (r.getOutput() != null && areEqual(r.getOutput(), stack)) { recipe = r; break; } } if (recipe == null) { MineTweakerAPI.getLogger() .logWarning("No Cooking Iron Plate recipe for " + getRecipeInfo() + " found."); } else { list.remove(recipe); } }