add search to grid!

This commit is contained in:
Raoul Van den Berge
2015-12-20 15:15:53 +01:00
parent 12885c24a1
commit d57618f990
7 changed files with 122 additions and 43 deletions

View File

@@ -1,5 +1,7 @@
package storagecraft.storage;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -10,6 +12,8 @@ public class StorageItem {
private int quantity;
private int damage;
private NBTTagCompound tag;
@SideOnly(Side.CLIENT)
private int id;
public StorageItem(Item type, int quantity, int damage, NBTTagCompound tag) {
this.type = type;
@@ -18,6 +22,12 @@ public class StorageItem {
this.tag = tag;
}
public StorageItem(Item type, int quantity, int damage, NBTTagCompound tag, int id) {
this(type, quantity, damage, tag);
this.id = id;
}
public StorageItem(ItemStack stack) {
this(stack.getItem(), stack.stackSize, stack.getItemDamage(), stack.stackTagCompound);
}
@@ -50,6 +60,11 @@ public class StorageItem {
this.tag = tag;
}
@SideOnly(Side.CLIENT)
public int getId() {
return id;
}
public StorageItem copy() {
return copy(quantity);
}