From 621d7514bb0e0a21cf01a8978739dc795b4189ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sat, 25 May 2024 15:00:08 +0200 Subject: [PATCH] Allow shift clicking to get as much as possible --- .../java/systems/brn/server_storage/screens/StorageScreen.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/systems/brn/server_storage/screens/StorageScreen.java b/src/main/java/systems/brn/server_storage/screens/StorageScreen.java index 526c8f0..bebf213 100644 --- a/src/main/java/systems/brn/server_storage/screens/StorageScreen.java +++ b/src/main/java/systems/brn/server_storage/screens/StorageScreen.java @@ -84,7 +84,7 @@ public class StorageScreen extends PagedGui { if (clickedElement != null) { ItemStack clickedItem = clickedElement.getItemStack(); ItemStack noLoreStack = removeCountFromLore(clickedItem); - if (noLoreStack.getCount() > noLoreStack.getMaxCount()) { + if (noLoreStack.getCount() > noLoreStack.getMaxCount() && !type.shift) { noLoreStack.setCount(noLoreStack.getMaxCount()); } int maxToInsert = canInsertItemIntoPlayerInventory(player, noLoreStack); @@ -141,6 +141,7 @@ public class StorageScreen extends PagedGui { public void doSearch(String query) { this.query = query; + this.page = 0; this.updateDisplay(); } }