// Path: src/main/java/mods/belgabor/amtweaker/util/CommandLoggerBase.java
// public class CommandLoggerBase {
//     private static String deduceOre(ArrayList stack) {
//         int count = 1;
//         ArrayList<Integer> oreRefBase = new ArrayList<>();
//         for (Object xItem : stack) {
//             if (!(xItem instanceof ItemStack))
//                 return "?????";
//             ItemStack item = (ItemStack) xItem;
//             count = item.stackSize;
//             int[] oreIds = OreDictionary.getOreIDs(item);
//             ArrayList<Integer> oreRef = new ArrayList<>();
//             for (int i : oreIds)
//                 oreRef.add(i);
//             if (oreIds.length == 0) {
//                 return "?????";
//             } else if (oreIds.length == 1) {
//                 return getObjectDeclaration(OreDictionary.getOreName(oreIds[0])) + ((count>1)?String.format(" * %d", count):"");
//             } else {
//                 if (oreRefBase.size() == 0) {
//                     oreRefBase = oreRef;
//                 } else {
//                     ArrayList<Integer> toRemove = new ArrayList<>();
//                     for (Integer i : oreRefBase) {
//                         if (!oreRef.contains(i))
//                             toRemove.add(i);
//                     }
//                     oreRefBase.removeAll(toRemove);
//                     if (oreRefBase.size() == 1)
//                         return getObjectDeclaration(OreDictionary.getOreName(oreRefBase.get(0))) + ((count>1)?String.format(" * %d", count):"");
//                 }
//             }
//         }
//         
//         // Damn
//         ArrayList<String> theOres = oreRefBase.stream().map(OreDictionary::getOreName).collect(Collectors.toCollection(ArrayList::new));
//         return getObjectDeclaration("UNKNOWN[" + Joiner.on(",").join(theOres) + "]") + ((count>1)?String.format(" * %d", count):"");
//     }
//     
//     protected void logBoth(IPlayer player, String s) {
//         MineTweakerAPI.logCommand(s);
//         if (player != null)
//             player.sendChat(s);
//     }
// 
//     protected static String getItemDeclaration(ItemStack stack) {
//         if (stack == null) {
//             return "null";
//         }
//         return MineTweakerMC.getIItemStack(stack).toString();
//     }
//     protected static String getItemDeclaration(Fluid stack) {
//         return "<liquid:" + stack.getName() + ">";
//     }
//     protected static String getItemDeclaration(FluidStack stack) {
//         return "<liquid:" + stack.getFluid().getName() + "> * " + stack.amount;
//     }
//     public static String getObjectDeclaration(Object stack) {
//         if (stack instanceof String) {
//             return "<ore:" + stack + ">";
//         } else if (stack instanceof ItemStack) {
//             return getItemDeclaration((ItemStack) stack);
//         } else if (stack instanceof Item) {
//             return getItemDeclaration(new ItemStack((Item) stack, 1));
//         } else if (stack instanceof Block) {
//             return getItemDeclaration(new ItemStack((Block) stack, 1));
//         } else if (stack instanceof Fluid) {
//             return getItemDeclaration((Fluid) stack);
//         } else if (stack instanceof FluidStack) {
//             return getItemDeclaration((FluidStack) stack);
//         } else if (stack instanceof ArrayList) {
//             return deduceOre((ArrayList) stack);
//         } else if (stack == null) {
//             return "null";
//         } else {
//             return "?????";
//         }
//     }
//     public static String getFullObjectDeclaration(Object stack) {
//         if (stack instanceof ItemStack) {
//             ItemStack r = (ItemStack) stack;
//             return getItemDeclaration(r) + ((r.stackSize>1)?String.format(" * %d", r.stackSize):"");
//         } else if (stack instanceof FluidStack) {
//             return getItemDeclaration((FluidStack) stack);
//         } else if (stack == null) {
//             return "null";
//         } else {
//             return "?????";
//         }
//     }
// 
//     protected static String getBoolean(boolean b) {
//         return b?"true":"false";
//     }
// }
// 
// Path: src/main/java/mods/belgabor/amtweaker/helpers/InputHelper.java
// public static Object toObject(IIngredient iStack) {
//     return toObject(iStack, false);
// }


import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import mods.belgabor.amtweaker.util.CommandLoggerBase;
import net.minecraft.item.ItemStack;
import shift.sextiarysector.SSRecipes;
import shift.sextiarysector.recipe.RecipeSimpleFuel;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import static mods.belgabor.amtweaker.helpers.InputHelper.toObject;
        }
        Object iInput = toObject(input, true);
        if (iInput == null) {
            MineTweakerAPI.getLogger().logError(String.format("%s: Fuel item invalid!", name));
            return;
        }
        if (iInput instanceof String) {
            if (handler.getOreList().containsKey(iInput)) {
                MineTweakerAPI.getLogger().logError(String.format("%s: Fuel item %s already set", name, input.toString()));
                return;
            }
        } else if (iInput instanceof ItemStack) {
            if (getActualItemStack(handler, (ItemStack) iInput) != null) {
                MineTweakerAPI.getLogger().logError(String.format("%s: Fuel item %s already set", name, input.toString()));
                return;
            }
        }
        if (amount <= 0) {
            MineTweakerAPI.getLogger().logError(String.format("%s: Amount must be positive!", name));
            return;
        }

        MineTweakerAPI.apply(new FuelAdd(handler, name, iInput, amount));
    }
    
    protected static void doRemove(RecipeSimpleFuel handler, String name, IIngredient fuel) {
        if (fuel == null) {
            MineTweakerAPI.getLogger().logError(String.format("%s: Fuel item must not be null!", name));
            return;
        }
// Path: src/main/java/mods/belgabor/amtweaker/util/CommandLoggerBase.java
// public class CommandLoggerBase {
//     private static String deduceOre(ArrayList stack) {
//         int count = 1;
//         ArrayList<Integer> oreRefBase = new ArrayList<>();
//         for (Object xItem : stack) {
//             if (!(xItem instanceof ItemStack))
//                 return "?????";
//             ItemStack item = (ItemStack) xItem;
//             count = item.stackSize;
//             int[] oreIds = OreDictionary.getOreIDs(item);
//             ArrayList<Integer> oreRef = new ArrayList<>();
//             for (int i : oreIds)
//                 oreRef.add(i);
//             if (oreIds.length == 0) {
//                 return "?????";
//             } else if (oreIds.length == 1) {
//                 return getObjectDeclaration(OreDictionary.getOreName(oreIds[0])) + ((count>1)?String.format(" * %d", count):"");
//             } else {
//                 if (oreRefBase.size() == 0) {
//                     oreRefBase = oreRef;
//                 } else {
//                     ArrayList<Integer> toRemove = new ArrayList<>();
//                     for (Integer i : oreRefBase) {
//                         if (!oreRef.contains(i))
//                             toRemove.add(i);
//                     }
//                     oreRefBase.removeAll(toRemove);
//                     if (oreRefBase.size() == 1)
//                         return getObjectDeclaration(OreDictionary.getOreName(oreRefBase.get(0))) + ((count>1)?String.format(" * %d", count):"");
//                 }
//             }
//         }
//         
//         // Damn
//         ArrayList<String> theOres = oreRefBase.stream().map(OreDictionary::getOreName).collect(Collectors.toCollection(ArrayList::new));
//         return getObjectDeclaration("UNKNOWN[" + Joiner.on(",").join(theOres) + "]") + ((count>1)?String.format(" * %d", count):"");
//     }
//     
//     protected void logBoth(IPlayer player, String s) {
//         MineTweakerAPI.logCommand(s);
//         if (player != null)
//             player.sendChat(s);
//     }
// 
//     protected static String getItemDeclaration(ItemStack stack) {
//         if (stack == null) {
//             return "null";
//         }
//         return MineTweakerMC.getIItemStack(stack).toString();
//     }
//     protected static String getItemDeclaration(Fluid stack) {
//         return "<liquid:" + stack.getName() + ">";
//     }
//     protected static String getItemDeclaration(FluidStack stack) {
//         return "<liquid:" + stack.getFluid().getName() + "> * " + stack.amount;
//     }
//     public static String getObjectDeclaration(Object stack) {
//         if (stack instanceof String) {
//             return "<ore:" + stack + ">";
//         } else if (stack instanceof ItemStack) {
//             return getItemDeclaration((ItemStack) stack);
//         } else if (stack instanceof Item) {
//             return getItemDeclaration(new ItemStack((Item) stack, 1));
//         } else if (stack instanceof Block) {
//             return getItemDeclaration(new ItemStack((Block) stack, 1));
//         } else if (stack instanceof Fluid) {
//             return getItemDeclaration((Fluid) stack);
//         } else if (stack instanceof FluidStack) {
//             return getItemDeclaration((FluidStack) stack);
//         } else if (stack instanceof ArrayList) {
//             return deduceOre((ArrayList) stack);
//         } else if (stack == null) {
//             return "null";
//         } else {
//             return "?????";
//         }
//     }
//     public static String getFullObjectDeclaration(Object stack) {
//         if (stack instanceof ItemStack) {
//             ItemStack r = (ItemStack) stack;
//             return getItemDeclaration(r) + ((r.stackSize>1)?String.format(" * %d", r.stackSize):"");
//         } else if (stack instanceof FluidStack) {
//             return getItemDeclaration((FluidStack) stack);
//         } else if (stack == null) {
//             return "null";
//         } else {
//             return "?????";
//         }
//     }
// 
//     protected static String getBoolean(boolean b) {
//         return b?"true":"false";
//     }
// }
// 
// Path: src/main/java/mods/belgabor/amtweaker/helpers/InputHelper.java
// public static Object toObject(IIngredient iStack) {
//     return toObject(iStack, false);
// }


// Path: src/main/java/mods/belgabor/amtweaker/mods/ss2/handlers/Fuel.java
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import mods.belgabor.amtweaker.util.CommandLoggerBase;
import net.minecraft.item.ItemStack;
import shift.sextiarysector.SSRecipes;
import shift.sextiarysector.recipe.RecipeSimpleFuel;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import static mods.belgabor.amtweaker.helpers.InputHelper.toObject;

        }
        Object iInput = toObject(input, true);
        if (iInput == null) {
            MineTweakerAPI.getLogger().logError(String.format("%s: Fuel item invalid!", name));
            return;
        }
        if (iInput instanceof String) {
            if (handler.getOreList().containsKey(iInput)) {
                MineTweakerAPI.getLogger().logError(String.format("%s: Fuel item %s already set", name, input.toString()));
                return;
            }
        } else if (iInput instanceof ItemStack) {
            if (getActualItemStack(handler, (ItemStack) iInput) != null) {
                MineTweakerAPI.getLogger().logError(String.format("%s: Fuel item %s already set", name, input.toString()));
                return;
            }
        }
        if (amount <= 0) {
            MineTweakerAPI.getLogger().logError(String.format("%s: Amount must be positive!", name));
            return;
        }

        MineTweakerAPI.apply(new FuelAdd(handler, name, iInput, amount));
    }
    
    protected static void doRemove(RecipeSimpleFuel handler, String name, IIngredient fuel) {
        if (fuel == null) {
            MineTweakerAPI.getLogger().logError(String.format("%s: Fuel item must not be null!", name));
            return;
        }
        Object iInput = toObject(fuel, true);