aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
index 54d85fc3..e7486dba 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
@@ -1212,8 +1212,16 @@ public class NEUOverlay extends Gui {
NotEnoughUpdates.INSTANCE.openGui = new GuiPriceGraph(internalname.get());
return true;
} else if (keyPressed == NotEnoughUpdates.INSTANCE.config.misc.openAHKeybind) {
- String cleanName = Utils.cleanColour(item.get("displayname").getAsString()).replace("[Lvl {LVL}]", "").trim();
- if (NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalname.get()) == null) {
+ String displayname = item.get("displayname").getAsString();
+
+ String cleanName = Utils.cleanColour(displayname).replace("[Lvl {LVL}]", "").trim();
+
+ if (displayname.equals("§fEnchanted Book")) {
+ String loreName = Utils.cleanColour(item.getAsJsonArray("lore").get(0).getAsString());
+
+ String bookName = loreName.substring(0, loreName.lastIndexOf(' '));
+ NotEnoughUpdates.INSTANCE.trySendCommand("/bz " + bookName);
+ } else if (NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalname.get()) == null) {
NotEnoughUpdates.INSTANCE.trySendCommand("/ahs " + cleanName);
} else {
NotEnoughUpdates.INSTANCE.trySendCommand("/bz " + cleanName);