Force adding ItemStack to Scrapbox List
This commit is contained in:
parent
a1335f118a
commit
b503feed8a
2 changed files with 18 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue