Nei Handlers now show all ores

This commit is contained in:
modmuss50 2015-05-10 21:03:44 +01:00
parent 07be177c6c
commit 03cd665add
6 changed files with 27 additions and 8 deletions

View file

@ -1,11 +1,13 @@
package techreborn.util;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.List;
/**
@ -110,4 +112,17 @@ public class ItemUtils {
{
return ItemStack.loadItemStackFromNBT(data);
}
public static List<ItemStack> getStackWithAllOre(ItemStack stack){
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
for (int oreID : OreDictionary.getOreIDs(stack)){
for(ItemStack ore : OreDictionary.getOres(OreDictionary.getOreName(oreID))){
list.add(ore);
}
}
if(list.isEmpty()){
list.add(stack);
}
return list;
}
}