From 1316f035cd3707f522351e016846f06224e40e1e Mon Sep 17 00:00:00 2001 From: jchung01 <60687097+jchung01@users.noreply.github.com> Date: Tue, 18 Jun 2024 01:12:03 -0700 Subject: [PATCH] Fix some MouseTweaks interactions (#455) --- src/main/java/appeng/client/gui/AEBaseGui.java | 14 +++++++++++--- src/main/resources/appliedenergistics2_at.cfg | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/appeng/client/gui/AEBaseGui.java b/src/main/java/appeng/client/gui/AEBaseGui.java index f919874884b..4c2beb8c079 100644 --- a/src/main/java/appeng/client/gui/AEBaseGui.java +++ b/src/main/java/appeng/client/gui/AEBaseGui.java @@ -1057,7 +1057,7 @@ private void updateDragSplitting() @Override @Optional.Method(modid = "mousetweaks") public boolean MT_isMouseTweaksDisabled() { - return true; + return false; } @Override @@ -1087,12 +1087,20 @@ public boolean MT_isCraftingOutput(Slot slot) { @Override @Optional.Method(modid = "mousetweaks") public boolean MT_isIgnored(Slot slot) { - return true; + return false; } @Override @Optional.Method(modid = "mousetweaks") public boolean MT_disableRMBDraggingFunctionality() { - return true; + if (this.dragSplitting && this.dragSplittingButton == 1) { + this.dragSplitting = false; + // Don't ignoreMouseUp on slots that can't accept the item. (crafting output, ME slot, etc.) + if (this.getSlotUnderMouse() != null && this.getSlotUnderMouse().isItemValid(this.mc.player.inventory.getItemStack())) { + this.ignoreMouseUp = true; + } + return true; + } + return false; } } diff --git a/src/main/resources/appliedenergistics2_at.cfg b/src/main/resources/appliedenergistics2_at.cfg index 9c010e3c197..0522092aa8b 100644 --- a/src/main/resources/appliedenergistics2_at.cfg +++ b/src/main/resources/appliedenergistics2_at.cfg @@ -1,3 +1,6 @@ # GUI rendering public net.minecraft.client.gui.inventory.GuiContainer func_146977_a(Lnet/minecraft/inventory/Slot;)V # drawSlot +public net.minecraft.client.gui.inventory.GuiContainer field_146988_G # dragSplittingButton +public net.minecraft.client.gui.inventory.GuiContainer field_146987_F # dragSplittingLimit +public net.minecraft.client.gui.inventory.GuiContainer field_146995_H # ignoreMouseUp public net.minecraft.client.gui.GuiTextField func_146188_c(IIII)V # drawSelectionBox