mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 18:54:45 +00:00
Use buffered streams when managing NBT files
This commit is contained in:
1 parent
8d1619589d
commit
f2180dfab5
7 files changed
+51
-47
No files matched your search
@@ -5,12 +5,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemStackSet implements ItemFilter
|
||||
public class ItemStackSet extends ItemStackMap<ItemStack> implements ItemFilter
|
||||
{
|
||||
ItemStackMap<Object> underlying = new ItemStackMap<Object>();
|
||||
|
||||
public ItemStackSet with(ItemStack... items) {
|
||||
for(ItemStack item : items)
|
||||
add(item);
|
||||
@@ -30,27 +26,15 @@ public class ItemStackSet implements ItemFilter
|
||||
}
|
||||
|
||||
public void add(ItemStack item) {
|
||||
underlying.put(item, new Object());
|
||||
}
|
||||
|
||||
public boolean remove(ItemStack item) {
|
||||
return underlying.remove(item) != null;
|
||||
put(item, item);
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack item) {
|
||||
return underlying.get(item) != null;
|
||||
return get(item) != null;
|
||||
}
|
||||
|
||||
public boolean containsAll(Item item) {
|
||||
return underlying.get(ItemStackMap.wildcard(item)) != null;
|
||||
}
|
||||
|
||||
public List<ItemStack> values() {
|
||||
return underlying.keys();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
underlying.clear();
|
||||
return get(ItemStackMap.wildcard(item)) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,14 +42,6 @@ public class ItemStackSet implements ItemFilter
|
||||
return contains(item);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return underlying.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return underlying.isEmpty();
|
||||
}
|
||||
|
||||
public static ItemStackSet of(Block... blocks) {
|
||||
return new ItemStackSet().with(blocks);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user