@@ -610,46 +610,33 @@ public boolean updatePlayer(Player player, ProfileData profile) {
610610 Location loc = profile .get (BED_SPAWN );
611611 if (loc == null ) {
612612 Logging .finer ("No respawn location saved" );
613- setSpawnLocation (player , player .getWorld ().getSpawnLocation ());
613+ player . setBedSpawnLocation (player .getWorld ().getSpawnLocation (), true );
614614 return false ;
615615 }
616616 World loclWorld = Try .of (loc ::getWorld ).getOrNull ();
617617 if (loclWorld == null ) {
618618 Logging .warning ("Respawn location has invalid world!" );
619- setSpawnLocation (player , player .getWorld ().getSpawnLocation ());
619+ player . setBedSpawnLocation (player .getWorld ().getSpawnLocation (), true );
620620 return false ;
621621 }
622622 if (inventoriesConfig .getValidateBedAnchorRespawnLocation ()
623623 && loc instanceof RespawnLocation respawnLocation
624624 && !respawnLocation .isValidRespawnLocation ()) {
625625 Logging .finer ("Respawn location validation failed for respawn type: " + respawnLocation .getRespawnType ());
626- setSpawnLocation (player , player .getWorld ().getSpawnLocation ());
626+ player . setBedSpawnLocation (player .getWorld ().getSpawnLocation (), true );
627627 return false ;
628628 }
629- setSpawnLocation ( player , loc );
629+ player . setBedSpawnLocation ( loc , true );
630630 Logging .finer ("updated respawn location: " + player .getBedSpawnLocation ());
631631 return true ;
632632 }
633633 }).serializer (new ProfileEntry (false , DataStrings .PLAYER_BED_SPAWN_LOCATION ),
634634 new LocationSerializer .RespawnLocationSerializer ())
635635 .altName ("bedspawn" ).altName ("bed" ).altName ("beds" ).altName ("bedspawns" ).build ();
636636
637- // todo: handle this somewhere better
638- private static final List <UUID > ignoreSpawnListener = new ArrayList <>();
639637 private static final boolean hasSetSpawnEvent = ReflectHelper .hasClass ("org.bukkit.event.player.PlayerSpawnChangeEvent" )
640638 || ReflectHelper .hasClass ("com.destroystokyo.paper.event.player.PlayerSetSpawnEvent" );
641639
642- private static void setSpawnLocation (Player player , Location loc ) {
643- ignoreSpawnListener .add (player .getUniqueId ());
644- player .setBedSpawnLocation (loc , true );
645- ignoreSpawnListener .remove (player .getUniqueId ());
646- }
647-
648- @ ApiStatus .Internal
649- public static boolean isIgnoringSpawnListener (Player player ) {
650- return ignoreSpawnListener .contains (player .getUniqueId ());
651- }
652-
653640 /**
654641 * Sharing Last Location.
655642 */
0 commit comments