aboutsummaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-29 18:06:36 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-29 18:06:36 +0800
commita1b64e42345a2c5b2ba738bd15e8a87be42bfadc (patch)
treeeecb92e2a19a07b151d90797e98f93c46b37e58a /features
parentaea02ec1040ff1155b0b1a1e768f88e3e404b7c0 (diff)
downloadSoopyV2-a1b64e42345a2c5b2ba738bd15e8a87be42bfadc.tar.gz
SoopyV2-a1b64e42345a2c5b2ba738bd15e8a87be42bfadc.tar.bz2
SoopyV2-a1b64e42345a2c5b2ba738bd15e8a87be42bfadc.zip
fix museum gui breaking on special items if there is only 1 page
Diffstat (limited to 'features')
-rw-r--r--features/betterGuis/museumGui.js2
-rw-r--r--features/stat_next_to_name/index.js8
2 files changed, 6 insertions, 4 deletions
diff --git a/features/betterGuis/museumGui.js b/features/betterGuis/museumGui.js
index 44d4d41..dad8abf 100644
--- a/features/betterGuis/museumGui.js
+++ b/features/betterGuis/museumGui.js
@@ -409,7 +409,7 @@ class MuseumGui {
let itempages = ["Weapons", "Armor Sets", "Rarities", "Special Items"]
if(itempages.includes(this.replacePage[Player.getOpenedInventory().getName().split("➜").pop()])){
let page = this.replacePage[Player.getOpenedInventory().getName().split("➜").pop()]
- let [currPage, pageNum] = Player.getOpenedInventory().getName().split(")")[0].split("(")[1].split("/").map(a=>parseInt(a))
+ let [currPage, pageNum] = Player.getOpenedInventory().getName().includes("/")?Player.getOpenedInventory().getName().split(")")[0].split("(")[1].split("/").map(a=>parseInt(a)):[1,1]
if(!this.searchText){
if(currPage > 1){
diff --git a/features/stat_next_to_name/index.js b/features/stat_next_to_name/index.js
index a182515..c76ecd7 100644
--- a/features/stat_next_to_name/index.js
+++ b/features/stat_next_to_name/index.js
@@ -41,6 +41,7 @@ class StatNextToName extends Feature {
loadPlayerStatsTick(){
let nearestPlayer = undefined
+ let nearestPlayerName = undefined
let nearestDistance = Infinity
World.getAllPlayers().forEach(player => {
@@ -55,11 +56,12 @@ class StatNextToName extends Feature {
if(dist < nearestDistance){
nearestDistance = dist
nearestPlayer = player.getUUID().toString().replace(/-/g, "")
+ nearestPlayerName = player.getName()
}
})
if(nearestPlayer){
- this.loadPlayerStats(nearestPlayer)
+ this.loadPlayerStats(nearestPlayer, nearestPlayerName)
}
}
@@ -92,9 +94,9 @@ class StatNextToName extends Feature {
player.setNametagName(new TextComponent(nameTagString));
}
- loadPlayerStats(uuid){
+ loadPlayerStats(uuid, username){
// console.log("loading stats for " + uuid)
- soopyV2Server.requestPlayerStats(uuid)
+ soopyV2Server.requestPlayerStats(uuid, username)
this.loadingStats.push(uuid)
}