Force adding ItemStack to Scrapbox List

This commit is contained in:
MrBretzel 2016-03-28 16:45:22 +02:00
parent a1335f118a
commit b503feed8a
2 changed files with 18 additions and 2 deletions

View file

@ -4,23 +4,26 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import techreborn.Core;
public class ScrapboxList
{
public static List<ItemStack> stacks = new ArrayList<ItemStack>();
public static List<ItemStack> stacks = new ArrayList<>();
public static void addItemStackToList(ItemStack stack)
{
if (!hasItems(stack))
{
stacks.add(stack);
}
}
private static boolean hasItems(ItemStack stack)
{
for (ItemStack s : stacks)
{
if (stack.getItem().getItemStackDisplayName(stack).equals(s.getItem().getItemStackDisplayName(stack)))
if (stack.getDisplayName().equals(s.getDisplayName()))
return true;
}
return false;