File tree Expand file tree Collapse file tree
src/main/java/net/pistonmaster/pistonqueue/shared Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ private void connectPlayer(QueueType type) {
276276 continue ;
277277 }
278278
279- indexPositionTime ();
279+ indexPositionTime (type );
280280
281281 Map <Integer , Instant > cache = type .getPositionCache ().get (entry .getKey ());
282282 if (cache != null ) {
@@ -313,19 +313,17 @@ private void sendXPSoundToQueueType(QueueType type) {
313313 server .sendPluginMessage ("piston:queue" , out .toByteArray ()));
314314 }
315315
316- private void indexPositionTime () {
317- for (QueueType type : Config .QUEUE_TYPES ) {
318- int position = 0 ;
316+ private void indexPositionTime (QueueType type ) {
317+ int position = 0 ;
319318
320- for (UUID uuid : new LinkedHashMap <>(type .getQueueMap ()).keySet ()) {
321- position ++;
322- Map <Integer , Instant > list = type .getPositionCache ().get (uuid );
323- if (list == null ) {
324- type .getPositionCache ().put (uuid , new HashMap <>(Collections .singletonMap (position , Instant .now ())));
325- } else {
326- if (!list .containsKey (position )) {
327- list .put (position , Instant .now ());
328- }
319+ for (UUID uuid : new LinkedHashMap <>(type .getQueueMap ()).keySet ()) {
320+ position ++;
321+ Map <Integer , Instant > list = type .getPositionCache ().get (uuid );
322+ if (list == null ) {
323+ type .getPositionCache ().put (uuid , new HashMap <>(Collections .singletonMap (position , Instant .now ())));
324+ } else {
325+ if (!list .containsKey (position )) {
326+ list .put (position , Instant .now ());
329327 }
330328 }
331329 }
You can’t perform that action at this time.
0 commit comments