1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package me.km.utils;
- /*import java.util.ArrayList;
- import java.util.List;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.crafting.CraftingManager;
- import net.minecraft.item.crafting.FurnaceRecipes;
- import net.minecraft.item.crafting.IRecipe;*/
- public class RecipeUtils
- {
- /*private static final ArrayList<IRecipe> RECIPES = new ArrayList<>();
-
- private static void pushLastRecipe()
- {
- List<IRecipe> list = CraftingManager.getInstance().getRecipeList();
- RECIPES.add(list.get(list.size() - 1));
- }
-
- public static void registerShapelessRecipe(ItemStack result, ItemStack[] stacks)
- {
- CraftingManager.getInstance().addShapelessRecipe(result, (Object[]) stacks);
- pushLastRecipe();
- }
-
- public static void registerShapedRecipe(ItemStack result, String[] s, ItemStack[] stacks)
- {
- int length = s.length;
- Object[] o = new Object[length + (stacks.length * 2)];
- System.arraycopy(s, 0, o, 0, length);
- for(int i = length; i < o.length; i += 2)
- {
- o[i] = Character.forDigit(i + 1 - length, 10);
- o[i + 1] = stacks[i - length];
- }
- CraftingManager.getInstance().addRecipe(result, o);
- pushLastRecipe();
- }
-
- public static void registerFurnaceRecipe(ItemStack result, ItemStack input)
- {
- FurnaceRecipes.instance().addSmeltingRecipe(input, result, 0.1F);
- }
-
- public static void clearRecipes()
- {
- CraftingManager.getInstance().getRecipeList().removeAll(RECIPES);
- RECIPES.clear();
- }*/
- }
|