Add additional checks to the farmers inventory adding method

Hopefully closes #521
This commit is contained in:
Ellpeck 2016-12-27 10:33:13 +01:00
parent 37f70cde33
commit ca2468fda6

View file

@ -235,6 +235,7 @@ public final class WorldUtil{
int working = 0; int working = 0;
for(ItemStack stack : stacks){ for(ItemStack stack : stacks){
if(StackUtil.isValid(stack)){
for(int i = start; i < end; i++){ for(int i = start; i < end; i++){
stack = inventory.insertItemInternal(i, stack, false); stack = inventory.insertItemInternal(i, stack, false);
@ -244,11 +245,15 @@ public final class WorldUtil{
} }
} }
} }
else{
working++;
}
}
//Load the slots again //Load the slots again
if(!actuallyDo){ if(!actuallyDo){
for(int i = 0; i < backupSlots.length; i++){ for(int i = 0; i < backupSlots.length; i++){
inventory.setStackInSlot(i, backupSlots[i]); inventory.setStackInSlot(i, StackUtil.validateCheck(backupSlots[i]));
} }
} }