diff --git a/enderio-base/src/main/java/com/enderio/base/common/menu/FluidFilterMenu.java b/enderio-base/src/main/java/com/enderio/base/common/menu/FluidFilterMenu.java index fd8c7b6f4..35c3c20e2 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/menu/FluidFilterMenu.java +++ b/enderio-base/src/main/java/com/enderio/base/common/menu/FluidFilterMenu.java @@ -93,13 +93,14 @@ public void setInverted(Boolean inverted) { @Override public void doClick(int slotId, int button, ClickType clickType, Player player) { if (slotId >= 0 && slotId < capability.size()) { - if (clickType == ClickType.PICKUP) { - if (!capability.getEntry(slotId).isEmpty()) { - capability.setEntry(slotId, FluidStack.EMPTY); - } - } else if (clickType == ClickType.SWAP) { + // Only allow PICKUP (click) or QUICK_MOVE (shift + click) events. + if (clickType != ClickType.PICKUP && clickType != ClickType.QUICK_MOVE) { return; } + + if (!capability.getEntry(slotId).isEmpty()) { + capability.setEntry(slotId, FluidStack.EMPTY); + } } super.doClick(slotId, button, clickType, player); diff --git a/enderio-base/src/main/java/com/enderio/base/common/menu/ItemFilterMenu.java b/enderio-base/src/main/java/com/enderio/base/common/menu/ItemFilterMenu.java index 60bbeaac2..5ce3d0af2 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/menu/ItemFilterMenu.java +++ b/enderio-base/src/main/java/com/enderio/base/common/menu/ItemFilterMenu.java @@ -45,7 +45,7 @@ public ItemFilterMenu(int pContainerId, Inventory inventory, ItemStack stack) { this(EIOMenus.ITEM_FILTER.get(), pContainerId, inventory, stack); } - public static ItemFilterMenu factory(int pContainerId, Inventory inventory, FriendlyByteBuf buf) { + public static ItemFilterMenu factory(int pContainerId, Inventory inventory, FriendlyByteBuf buf) { return new ItemFilterMenu(EIOMenus.ITEM_FILTER.get(), pContainerId, inventory, inventory.player.getMainHandItem()); } @@ -94,13 +94,14 @@ public void setInverted(Boolean inverted) { @Override public void doClick(int slotId, int button, ClickType clickType, Player player) { if (slotId >= 0 && slotId < capability.size()) { - if (clickType == ClickType.PICKUP) { - if (!capability.getEntry(slotId).isEmpty()) { - capability.setEntry(slotId, ItemStack.EMPTY); - } - } else if (clickType == ClickType.SWAP) { + // Only allow PICKUP (click) or QUICK_MOVE (shift + click) events. + if (clickType != ClickType.PICKUP && clickType != ClickType.QUICK_MOVE) { return; } + + if (!capability.getEntry(slotId).isEmpty()) { + capability.setEntry(slotId, ItemStack.EMPTY); + } } super.doClick(slotId, button, clickType, player); diff --git a/enderio-base/src/main/java/com/enderio/base/common/menu/ItemFilterSlot.java b/enderio-base/src/main/java/com/enderio/base/common/menu/ItemFilterSlot.java index 5f58f0158..2de901aa3 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/menu/ItemFilterSlot.java +++ b/enderio-base/src/main/java/com/enderio/base/common/menu/ItemFilterSlot.java @@ -27,7 +27,7 @@ public ItemStack getItem() { @Override public void set(ItemStack pStack) { - consumer.accept(pStack); + consumer.accept(pStack.copyWithCount(1)); setChanged(); } diff --git a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/ChemicalFilterMenu.java b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/ChemicalFilterMenu.java index 1ae170014..9292cca57 100644 --- a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/ChemicalFilterMenu.java +++ b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/ChemicalFilterMenu.java @@ -84,13 +84,14 @@ public void setInverted(Boolean inverted) { @Override public void doClick(int slotId, int button, ClickType clickType, Player player) { if (slotId >= 0 && slotId < capability.size()) { - if (clickType == ClickType.PICKUP) { - if (!capability.getEntry(slotId).isEmpty()) { - capability.setEntry(slotId, ChemicalStack.EMPTY); - } - } else if (clickType == ClickType.SWAP) { + // Only allow PICKUP (click) or QUICK_MOVE (shift + click) events. + if (clickType != ClickType.PICKUP && clickType != ClickType.QUICK_MOVE) { return; } + + if (!capability.getEntry(slotId).isEmpty()) { + capability.setEntry(slotId, ChemicalStack.EMPTY); + } } super.doClick(slotId, button, clickType, player);