Fixed Right Click drawer interaction

This commit is contained in:
Buuz135 2022-01-20 22:48:43 +01:00
parent bbb196fef0
commit c7283d2fd9
2 changed files with 2 additions and 3 deletions

View File

@ -256,7 +256,7 @@ 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().getStackInSlot(slot).isEmpty() && getStorage().insertItem(slot, itemStack, true).getCount() != stack.getCount()) {
if (!itemStack.isEmpty() && !getStorage().getStackInSlot(slot).isEmpty() && getStorage().insertItem(slot, itemStack, true).getCount() != itemStack.getCount()) {
itemStack.setCount(getStorage().insertItem(slot, itemStack.copy(), false).getCount());
}
}

View File

@ -81,12 +81,11 @@ 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().getStackInSlot(slot).isEmpty() && getStorage().insertItem(slot, itemStack, true).getCount() != stack.getCount()) {
if (!itemStack.isEmpty() && !getStorage().getStackInSlot(slot).isEmpty() && getStorage().insertItem(slot, itemStack, true).getCount() != itemStack.getCount()) {
itemStack.setCount(getStorage().insertItem(slot, itemStack.copy(), false).getCount());
worked = true;
}
}
if (worked) return InteractionResult.SUCCESS;
}
}
INTERACTION_LOGGER.put(playerIn.getUUID(), System.currentTimeMillis());