aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/events/SlotClickEvent.java11
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java7
2 files changed, 17 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/events/SlotClickEvent.java b/src/main/java/io/github/moulberry/notenoughupdates/events/SlotClickEvent.java
index d8d3615d..f7a1e9b2 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/events/SlotClickEvent.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/events/SlotClickEvent.java
@@ -30,6 +30,17 @@ public class SlotClickEvent extends NEUEvent {
public final @NotNull Slot slot;
public final int slotId;
public int clickedButton;
+ /**
+ * Click types (along with the default keybind):
+ *
+ * <ul>
+ * <li>0 : mouse click (either LMB or RMB)</li>
+ * <li>1 : Shift mouse click</li>
+ * <li>2 : hotbar keybind (0-9) -> see clickedButton</li>
+ * <li>3 : pick block (middle mouse button)</li>
+ * <li>4 : drop block (Q)</li>
+ * </ul>
+ */
public int clickType;
public boolean usePickblockInstead = false;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
index c823cf88..9d346638 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
@@ -691,7 +691,12 @@ public class PetInfoOverlay extends TextOverlay {
@SubscribeEvent
public void onStackClick(SlotClickEvent event) {
- if (event.clickedButton != 0 && event.clickedButton != 1 && event.clickedButton != 2) return;
+ // 0 through 8 are the mouse as well as the keyboard buttons, allow all of those
+ if (event.clickedButton < 0 || event.clickedButton > 8) return;
+ // Ignore RMB clicks, which convert the pet to an item
+ if (event.clickedButton == 1 && event.clickType == 0) return;
+ // Ignore shift clicks, which don't work
+ if (event.clickType == 1) return;
int slotIdMod = (event.slotId - 10) % 9;
if (event.slotId >= 10 && event.slotId <= 43 && slotIdMod >= 0 && slotIdMod <= 6 &&