From 82e2dc48f1c700efb3999c51d37ca76105986410 Mon Sep 17 00:00:00 2001 From: P3pp3rF1y Date: Wed, 6 Nov 2024 23:42:43 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Fixed=20sorting=20to=20tr?= =?UTF-8?q?igger=20when=20cursor=20is=20anywhere=20outside=20of=20storage?= =?UTF-8?q?=20slots.=20Fixes=20the=20behavior=20where=20sorting=20mods=20w?= =?UTF-8?q?ould=20sort=20sophisticated=20inventories=20when=20middle=20cli?= =?UTF-8?q?ck=20is=20used=20with=20cursor=20outside=20of=20any=20slot=20wh?= =?UTF-8?q?ich=20caused=20item=20loss=20for=20example=20when=20stack=20upg?= =?UTF-8?q?rades=20were=20used.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../p3pp3rf1y/sophisticatedbackpacks/client/KeybindHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 15ef52b7..369de842 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.daemon=false mod_id=sophisticatedbackpacks mod_group_id=sophisticatedbackpacks -mod_version=3.20.11 +mod_version=3.20.12 sonar_project_key=sophisticatedbackpacks:SophisticatedBackpacks github_package_url=https://maven.pkg.github.com/P3pp3rF1y/SophisticatedBackpacks diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/KeybindHandler.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/KeybindHandler.java index 7e52ad36..0637cb7c 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/KeybindHandler.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/KeybindHandler.java @@ -135,7 +135,7 @@ private static boolean tryCallSort(Screen gui) { double mouseX = mh.xpos() * mc.getWindow().getGuiScaledWidth() / mc.getWindow().getScreenWidth(); double mouseY = mh.ypos() * mc.getWindow().getGuiScaledHeight() / mc.getWindow().getScreenHeight(); Slot selectedSlot = screen.findSlot(mouseX, mouseY); - if (selectedSlot != null && container.isNotPlayersInventorySlot(selectedSlot.index)) { + if (selectedSlot == null || container.isNotPlayersInventorySlot(selectedSlot.index)) { container.sort(); return true; }