From a1b64e42345a2c5b2ba738bd15e8a87be42bfadc Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Wed, 29 Dec 2021 18:06:36 +0800 Subject: fix museum gui breaking on special items if there is only 1 page --- features/stat_next_to_name/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'features/stat_next_to_name') 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) } -- cgit