Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.nathan72419.SingularityUtil.misc;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Map.Entry;
- import com.nathan72419.SingularityUtil.core.CommonProxy;
- import net.minecraft.block.Block;
- import net.minecraft.item.Item;
- 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 RecipeRemover {
- public static void removeRecipe (Item item) {
- List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
- Iterator<IRecipe> remover = recipes.iterator();
- while(remover.hasNext()) {
- ItemStack itemstack = remover.next().getRecipeOutput();
- if(itemstack != null && itemstack.getItem() == item)
- remover.remove();
- }}
- public static void removeRecipe (Block block) {
- List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
- Iterator<IRecipe> remover = recipes.iterator();
- while(remover.hasNext()) {
- ItemStack itemstack = remover.next().getRecipeOutput();
- if(itemstack != null && itemstack.getItem() == Item.getItemFromBlock(block));{
- remover.remove();
- }}
- }
- public static void removeSmeltingInput (ItemStack stack) {
- Map recipes = FurnaceRecipes.smelting().getSmeltingList();
- Iterator remover = recipes.entrySet().iterator();
- while(remover.hasNext()) {
- Map.Entry delEntry = (Map.Entry) remover.next();
- CommonProxy.logger.info(delEntry.getKey() + "=" + delEntry.getValue());
- boolean run = false;
- if(ItemStack.areItemStacksEqual(stack, (ItemStack) delEntry.getKey())){
- remover.remove();
- run = true;
- }
- if(run=true){CommonProxy.logger.info("run = " + run);}
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement