Fixed slot validity check when inserting into a drawer controller

This commit is contained in:
Buuz135 2021-12-29 12:13:51 +01:00
parent bc01ad7098
commit bd811b861c

View File

@ -78,7 +78,7 @@ public class DrawerControllerTile extends ControllableDrawerTile<DrawerControlle
if (stack.getItem().equals(FunctionalStorage.CONFIGURATION_TOOL.get()) || stack.getItem().equals(FunctionalStorage.LINKING_TOOL.get())) return InteractionResult.PASS;
if (isServer()){
for (int slot = 0; slot < getStorage().getSlots(); slot++) {
if (!stack.isEmpty() && getStorage().isItemValid(slot, stack)) {
if (!stack.isEmpty() && getStorage().insertItem(slot, stack, true).getCount() != stack.getCount()){
playerIn.setItemInHand(hand, getStorage().insertItem(slot, stack, false));
return InteractionResult.SUCCESS;
} else if (System.currentTimeMillis() - INTERACTION_LOGGER.getOrDefault(playerIn.getUUID(), System.currentTimeMillis()) < 300) {