Fix #2436: Stop dropping upgrades when they are clicked (#2508)

This commit is contained in:
Technici4n 2021-09-20 08:59:09 +02:00 committed by GitHub
parent 4c4881e7e5
commit f7e1ad1367
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -454,8 +454,8 @@ public class GuiBase<T extends ScreenHandler> extends HandledScreen<T> {
@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<GuiTab> getTabs() {

View file

@ -3,3 +3,5 @@ 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;
accessible method net/minecraft/client/gui/screen/ingame/HandledScreen getSlotAt (DD)Lnet/minecraft/screen/slot/Slot;