Skip to content

Commit 81a4b96

Browse files
small cleanup
1 parent d8055aa commit 81a4b96

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

plugin/src/main/resources/web/js/modules/Pl3xMap.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ class Pl3xMap {
126126
const zoom = this.map.getZoom();
127127
const x = Math.floor(center.x);
128128
const z = Math.floor(center.y);
129-
const followedPlayer = this.playerList.getFollowedPlayer();
130-
return `?world=${this.worldList.curWorld.name}&zoom=${zoom}&x=${x}&z=${z}${(followedPlayer ? `&uuid=${followedPlayer}` : '' )}`;
129+
const following = this.playerList.following ? `&uuid=${this.playerList.following}` : '';
130+
return `?world=${this.worldList.curWorld.name}&zoom=${zoom}&x=${x}&z=${z}${following}`;
131131
}
132132
updateBrowserUrl(url) {
133133
window.history.replaceState(null, "", url);

plugin/src/main/resources/web/js/modules/PlayerList.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@ class PlayerList {
8282
this.removeFromList(player);
8383
}
8484

85-
// First tick: Are we tracking someone by url parameter?
85+
// first tick only
8686
if (this.firstTick) {
8787
this.firstTick = false;
88-
const trackedUuid = P.getUrlParam("uuid", null);
89-
if (trackedUuid != null && this.players.get(trackedUuid) != null) {
90-
this.followPlayerMarker(trackedUuid);
88+
89+
// follow uuid from url
90+
const follow = P.getUrlParam("uuid", null);
91+
if (follow != null && this.players.get(follow) != null) {
92+
this.followPlayerMarker(follow);
9193
}
9294
}
9395

@@ -120,10 +122,6 @@ class PlayerList {
120122
document.getElementById(this.following).classList.add("following");
121123
}
122124
}
123-
124-
getFollowedPlayer() {
125-
return this.following;
126-
}
127125
}
128126

129127
export { PlayerList };

0 commit comments

Comments
 (0)