Fix
This commit is contained in:
@@ -20,6 +20,7 @@ public class NBTStorage implements IStorage {
|
|||||||
private NBTTagCompound tag;
|
private NBTTagCompound tag;
|
||||||
private int capacity;
|
private int capacity;
|
||||||
private int priority;
|
private int priority;
|
||||||
|
|
||||||
private boolean dirty;
|
private boolean dirty;
|
||||||
|
|
||||||
private List<ItemGroup> groups = new ArrayList<ItemGroup>();
|
private List<ItemGroup> groups = new ArrayList<ItemGroup>();
|
||||||
@@ -76,19 +77,21 @@ public class NBTStorage implements IStorage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void push(ItemStack stack) {
|
public void push(ItemStack stack) {
|
||||||
markDirty();
|
|
||||||
|
|
||||||
tag.setInteger(NBT_STORED, getStored(tag) + stack.stackSize);
|
tag.setInteger(NBT_STORED, getStored(tag) + stack.stackSize);
|
||||||
|
|
||||||
for (ItemGroup group : groups) {
|
for (ItemGroup group : groups) {
|
||||||
if (group.compareNoQuantity(stack)) {
|
if (group.compareNoQuantity(stack)) {
|
||||||
group.setQuantity(group.getQuantity() + stack.stackSize);
|
group.setQuantity(group.getQuantity() + stack.stackSize);
|
||||||
|
|
||||||
|
markDirty();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
groups.add(new ItemGroup(stack));
|
groups.add(new ItemGroup(stack));
|
||||||
|
|
||||||
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -167,6 +170,7 @@ public class NBTStorage implements IStorage {
|
|||||||
|
|
||||||
public static ItemStack createStackWithNBT(ItemStack stack) {
|
public static ItemStack createStackWithNBT(ItemStack stack) {
|
||||||
stack.setTagCompound(createNBT());
|
stack.setTagCompound(createNBT());
|
||||||
|
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user