Made automatic insertion of drawers more responsive, closes #9
This commit is contained in:
parent
e4ee831933
commit
bbb196fef0
|
@ -256,9 +256,8 @@ public abstract class ControllableDrawerTile<T extends ControllableDrawerTile<T>
|
|||
playerIn.setItemInHand(hand, getStorage().insertItem(slot, stack, false));
|
||||
} else if (System.currentTimeMillis() - INTERACTION_LOGGER.getOrDefault(playerIn.getUUID(), System.currentTimeMillis()) < 300) {
|
||||
for (ItemStack itemStack : playerIn.getInventory().items) {
|
||||
if (!itemStack.isEmpty() && getStorage().insertItem(slot, itemStack, true).isEmpty()) {
|
||||
getStorage().insertItem(slot, itemStack.copy(), false);
|
||||
itemStack.setCount(0);
|
||||
if (!itemStack.isEmpty() && !getStorage().getStackInSlot(slot).isEmpty() && getStorage().insertItem(slot, itemStack, true).getCount() != stack.getCount()) {
|
||||
itemStack.setCount(getStorage().insertItem(slot, itemStack.copy(), false).getCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,9 +81,8 @@ public class DrawerControllerTile extends ControllableDrawerTile<DrawerControlle
|
|||
} else if (System.currentTimeMillis() - INTERACTION_LOGGER.getOrDefault(playerIn.getUUID(), System.currentTimeMillis()) < 300) {
|
||||
boolean worked = false;
|
||||
for (ItemStack itemStack : playerIn.getInventory().items) {
|
||||
if (!itemStack.isEmpty() && getStorage().insertItem(slot, itemStack, true).isEmpty()) {
|
||||
getStorage().insertItem(slot, itemStack.copy(), false);
|
||||
itemStack.setCount(0);
|
||||
if (!itemStack.isEmpty() && !getStorage().getStackInSlot(slot).isEmpty() && getStorage().insertItem(slot, itemStack, true).getCount() != stack.getCount()) {
|
||||
itemStack.setCount(getStorage().insertItem(slot, itemStack.copy(), false).getCount());
|
||||
worked = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user