@@ -1,5 +1,8 @@
|
||||
# Refined Storage Changelog
|
||||
|
||||
### 1.0.3
|
||||
- Fixed item loading issue (raoulvdberge)
|
||||
|
||||
### 1.0.2
|
||||
- Fixed processing patterns not handling item insertion sometimes (raoulvdberge)
|
||||
- Removed crafting task limit in crafting start GUI (raoulvdberge)
|
||||
|
||||
@@ -74,6 +74,13 @@ public abstract class ItemStorageNBT implements IItemStorage {
|
||||
}
|
||||
}
|
||||
|
||||
// ItemHandlerHelper#copyStackWithSize is not null-safe!
|
||||
private ItemStack safeCopy(ItemStack stack, int size) {
|
||||
ItemStack newStack = stack.copy();
|
||||
newStack.stackSize = size;
|
||||
return newStack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the items to the NBT tag.
|
||||
*/
|
||||
@@ -158,7 +165,7 @@ public abstract class ItemStorageNBT implements IItemStorage {
|
||||
if (!simulate) {
|
||||
tag.setInteger(NBT_STORED, getStored() + remainingSpace);
|
||||
|
||||
stacks.add(ItemHandlerHelper.copyStackWithSize(stack, remainingSpace));
|
||||
stacks.add(safeCopy(stack, remainingSpace));
|
||||
|
||||
onStorageChanged();
|
||||
}
|
||||
@@ -168,7 +175,7 @@ public abstract class ItemStorageNBT implements IItemStorage {
|
||||
if (!simulate) {
|
||||
tag.setInteger(NBT_STORED, getStored() + size);
|
||||
|
||||
stacks.add(ItemHandlerHelper.copyStackWithSize(stack, size));
|
||||
stacks.add(safeCopy(stack, size));
|
||||
|
||||
onStorageChanged();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user