File tree 2 files changed +8
-10
lines changed
plugin/src/main/resources/web/js/modules
2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -126,8 +126,8 @@ class Pl3xMap {
126
126
const zoom = this . map . getZoom ( ) ;
127
127
const x = Math . floor ( center . x ) ;
128
128
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 } ` ;
131
131
}
132
132
updateBrowserUrl ( url ) {
133
133
window . history . replaceState ( null , "" , url ) ;
Original file line number Diff line number Diff line change @@ -82,12 +82,14 @@ class PlayerList {
82
82
this . removeFromList ( player ) ;
83
83
}
84
84
85
- // First tick: Are we tracking someone by url parameter?
85
+ // first tick only
86
86
if ( this . firstTick ) {
87
87
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 ) ;
91
93
}
92
94
}
93
95
@@ -120,10 +122,6 @@ class PlayerList {
120
122
document . getElementById ( this . following ) . classList . add ( "following" ) ;
121
123
}
122
124
}
123
-
124
- getFollowedPlayer ( ) {
125
- return this . following ;
126
- }
127
125
}
128
126
129
127
export { PlayerList } ;
You can’t perform that action at this time.
0 commit comments