mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 02:04:59 +00:00
Unified build script (#175)
* Update build script * Update build script to import fix for shadow in dev and sources artifacts * Update fixed build script to shadow csv dependency in dev jar as well * Moved jitpack * Move new files
This commit is contained in:
1 parent
43b71b1de6
commit
a7ca6c8527
188 files changed
+646
-968
No files matched your search
@@ -0,0 +1,56 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemStackSet extends ItemStackMap<ItemStack> implements ItemFilter
|
||||
{
|
||||
public ItemStackSet with(ItemStack... items) {
|
||||
for(ItemStack item : items)
|
||||
add(item);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStackSet with(Item... items) {
|
||||
for(Item item : items)
|
||||
add(ItemStackMap.wildcard(item));
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStackSet with(Block... blocks) {
|
||||
for(Block block : blocks)
|
||||
add(ItemStackMap.wildcard(Item.getItemFromBlock(block)));
|
||||
return this;
|
||||
}
|
||||
|
||||
public void add(ItemStack item) {
|
||||
put(item, item);
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack item) {
|
||||
return get(item) != null;
|
||||
}
|
||||
|
||||
public boolean containsAll(Item item) {
|
||||
return get(ItemStackMap.wildcard(item)) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(ItemStack item) {
|
||||
return contains(item);
|
||||
}
|
||||
|
||||
public static ItemStackSet of(Block... blocks) {
|
||||
return new ItemStackSet().with(blocks);
|
||||
}
|
||||
|
||||
public static ItemStackSet of(Item... items) {
|
||||
return new ItemStackSet().with(items);
|
||||
}
|
||||
|
||||
public static ItemStackSet of(ItemStack... items) {
|
||||
return new ItemStackSet().with(items);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user