mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-11 02:49:11 +01:00
WIP fix for tp cross-world
This commit is contained in:
parent
46ccf0895f
commit
8df17d2f02
@ -411,21 +411,20 @@ public class EventListen implements Listener {
|
||||
toRespawn.values().remove(event.getNPC());
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
@EventHandler
|
||||
public void onPlayerChangedWorld(PlayerChangedWorldEvent event) {
|
||||
skinUpdateTracker.removePlayer(event.getPlayer().getUniqueId());
|
||||
skinUpdateTracker.updatePlayer(event.getPlayer(), 20, true);
|
||||
if (CitizensAPI.getNPCRegistry().getNPC(event.getPlayer()) == null)
|
||||
return;
|
||||
NMS.removeFromServerPlayerList(event.getPlayer());
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), () -> {
|
||||
NMS.replaceTracker(event.getPlayer());
|
||||
NMS.removeFromServerPlayerList(event.getPlayer());
|
||||
}, 1);
|
||||
// on teleport, player NPCs are added to the server player list. this is
|
||||
// undesirable as player NPCs are not real players and confuse plugins.
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerChangeWorld(PlayerChangedWorldEvent event) {
|
||||
skinUpdateTracker.updatePlayer(event.getPlayer(), 20, true);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerCreateNPC(PlayerCreateNPCEvent event) {
|
||||
checkCreationEvent(event);
|
||||
|
Loading…
Reference in New Issue
Block a user