From f7e1ad1367e5bddda75c78768e297b80e58bbfd2 Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Mon, 20 Sep 2021 08:59:09 +0200 Subject: [PATCH] Fix #2436: Stop dropping upgrades when they are clicked (#2508) --- .../src/main/java/reborncore/client/gui/builder/GuiBase.java | 4 ++-- RebornCore/src/main/resources/reborncore.accesswidener | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java b/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java index ee517e846..f1ef1fb55 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java +++ b/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java @@ -454,8 +454,8 @@ public class GuiBase extends HandledScreen { @Override protected boolean isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int mouseButton) { - //Expanded the width to allow for the upgrades - return super.isClickOutsideBounds(mouseX + 40, mouseY, left + 40, top, mouseButton); + // Upgrades are normally outside of the bounds, so let's pretend we are within the bounds if there is a slot here. + return getSlotAt(mouseX, mouseY) == null && super.isClickOutsideBounds(mouseX, mouseY, left, top, mouseButton); } public List getTabs() { diff --git a/RebornCore/src/main/resources/reborncore.accesswidener b/RebornCore/src/main/resources/reborncore.accesswidener index 56e702394..ef3efa371 100644 --- a/RebornCore/src/main/resources/reborncore.accesswidener +++ b/RebornCore/src/main/resources/reborncore.accesswidener @@ -2,4 +2,6 @@ accessWidener v1 named accessible method net/minecraft/recipe/ShapedRecipe readSymbols (Lcom/google/gson/JsonObject;)Ljava/util/Map; accessible method net/minecraft/recipe/ShapedRecipe getPattern (Lcom/google/gson/JsonArray;)[Ljava/lang/String; -accessible method net/minecraft/recipe/ShapedRecipe createPatternMatrix ([Ljava/lang/String;Ljava/util/Map;II)Lnet/minecraft/util/collection/DefaultedList; \ No newline at end of file +accessible method net/minecraft/recipe/ShapedRecipe createPatternMatrix ([Ljava/lang/String;Ljava/util/Map;II)Lnet/minecraft/util/collection/DefaultedList; + +accessible method net/minecraft/client/gui/screen/ingame/HandledScreen getSlotAt (DD)Lnet/minecraft/screen/slot/Slot;