Fixed Right Click drawer interaction
This commit is contained in:
parent
bbb196fef0
commit
c7283d2fd9
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue
Block a user