Invisible after tp

Discussion in 'Plugin Development' started by confuserr, Aug 19, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    confuserr

    If players are teleported in the same tick, they become invisible. Theres multiple tickets for it already. Would it be possible as a temporary fix within a plugin to delay the onTeleport event by a tick so they aren't invisible?

    Edit: Actually, even if you delayed it by a tick, someone else could still be tp'ed at the same time.
     
  2. You'd need some sort of queue.

    Every teleportation would be denied. And then go via a "request" that is put in a "queue".
    The queue is then emptied over time .
     
  3. Offline

    mcgamer99

    Try this, if when a player teleport is invisible, he become visible:
    Code:
        public void tp(PlayerTeleportEvent e) {
            for(Player other : Bukkit.getServer().getOnlinePlayers()) {
                if(!other.canSee(e.getPlayer())) {
                    other.showPlayer(e.getPlayer());
                    return;
                }
            }
        }
     
Thread Status:
Not open for further replies.

Share This Page