diff options
author | Dalwyn <kendal.cooper.3460@gmail.com> | 2022-08-28 12:07:42 +0200 |
---|---|---|
committer | Dalwyn <kendal.cooper.3460@gmail.com> | 2022-08-28 12:12:30 +0200 |
commit | d08303d26628a185270b5201a9282477b85bff01 (patch) | |
tree | 11f36e69be486ddddf8aa347dfd7954bf1642dc3 | |
parent | 55ba07455d4481a22d6327d6901a46fa5c7ac26a (diff) | |
download | SoopyV2-d08303d26628a185270b5201a9282477b85bff01.tar.gz SoopyV2-d08303d26628a185270b5201a9282477b85bff01.tar.bz2 SoopyV2-d08303d26628a185270b5201a9282477b85bff01.zip |
Changes as requested
-rw-r--r-- | features/betterGuis/dungeonReadyGui.js | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/features/betterGuis/dungeonReadyGui.js b/features/betterGuis/dungeonReadyGui.js index 6af07a1..8188865 100644 --- a/features/betterGuis/dungeonReadyGui.js +++ b/features/betterGuis/dungeonReadyGui.js @@ -202,27 +202,27 @@ class DungeonReadyGui { //select class buttons - if (!Player.getContainer().getStackInSlot(2 + 4 * 9 + i)) clickingClassButton = i; - - this.classBoxes[i].setColor(253, 255, 227); - if (Player.getContainer().getStackInSlot(2 + 4 * 9 + i).getDamage() === 10) - this.classBoxes[i].setColor(250, 255, 150); - - this.classBoxes[i] - .setText("§0" + Object.keys(this.classes)[i] + "§7 - " + ChatLib.removeFormatting(Player.getContainer().getStackInSlot(2 + 4 * 9 + i).getName().split(" ")[0])) - .setLore(Player.getContainer().getStackInSlot(2 + 4 * 9 + i).getLore()); - - let isPlayerClass = false; - Player.getContainer().getStackInSlot(2 + 4 * 9 + i).getLore().forEach(line => { - if (!ChatLib.removeFormatting(line).startsWith(" - ")) return; - if (ChatLib.removeFormatting(line.split(" ").pop()) === Player.getName()) - isPlayerClass = true; - }) + if (Player.getContainer().getStackInSlot(2 + 4 * 9 + i)) { + this.classBoxes[i].setColor(253, 255, 227); + if (Player.getContainer().getStackInSlot(2 + 4 * 9 + i).getDamage() === 10) + this.classBoxes[i].setColor(250, 255, 150); + + this.classBoxes[i] + .setText("§0" + Object.keys(this.classes)[i] + "§7 - " + ChatLib.removeFormatting(Player.getContainer().getStackInSlot(2 + 4 * 9 + i).getName().split(" ")[0])) + .setLore(Player.getContainer().getStackInSlot(2 + 4 * 9 + i).getLore()); + + let isPlayerClass = false; + Player.getContainer().getStackInSlot(2 + 4 * 9 + i).getLore().forEach(line => { + if (!ChatLib.removeFormatting(line).startsWith(" - ")) return; + if (ChatLib.removeFormatting(line.split(" ").pop()) === Player.getName()) + isPlayerClass = true; + }) if (isPlayerClass) { this.currentPlayerClass = i; this.classBoxes[i].setColor(150, 255, 150); } + } else clickingClassButton = i; } if (clickingClassButton !== -1) { @@ -252,7 +252,7 @@ class DungeonReadyGui { name = event.gui.field_147002_h.func_85151_d().func_145748_c_().func_150260_c(); if (this.soopyGui.ctGui.isOpen()) { - if (!event.gui && !event.gui.field_147002_h) return; + if (!event.gui || !event.gui.field_147002_h) return; Player.getPlayer().field_71070_bA = event.gui.field_147002_h if (!Player.getContainer().getName().startsWith("Catacombs - Floor ")) return; @@ -269,7 +269,7 @@ class DungeonReadyGui { } } - keyPress(key, keyId) { + keyPress(_, keyId) { if (keyId === 1) //escape key // this.dontOpen = 1 Client.currentGui.close(); |