From 125bf1eb72e7e2b9ecc4cce924e07ed1b6b233eb Mon Sep 17 00:00:00 2001 From: Nathan Stoltenberg <ataranlen@gmail.com> Date: Tue, 15 Mar 2016 12:00:08 -0500 Subject: [PATCH] Wrap the HidePlayer in a sync task instead of async. --- pom.xml | 2 +- src/main/java/net/md_5/itag/iTag.java | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index e9cd038..a2cb188 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ <groupId>net.md-5</groupId> <artifactId>iTag</artifactId> - <version>1.1.4-SNAPSHOT</version> + <version>1.1.5-SNAPSHOT</version> <packaging>jar</packaging> <name>iTag</name> diff --git a/src/main/java/net/md_5/itag/iTag.java b/src/main/java/net/md_5/itag/iTag.java index 0d73b64..ca576cd 100644 --- a/src/main/java/net/md_5/itag/iTag.java +++ b/src/main/java/net/md_5/itag/iTag.java @@ -159,15 +159,22 @@ public void refreshPlayer(final Player player, final Player forWhom) Preconditions.checkNotNull( forWhom, "forWhom" ); if ( player != forWhom && player.getWorld() == forWhom.getWorld() && forWhom.canSee( player ) ) - { - forWhom.hidePlayer( player ); - getServer().getScheduler().scheduleSyncDelayedTask( this, new Runnable() + { + getServer().getScheduler().scheduleSyncDelayedTask( this, new Runnable() + { + public void run() + { + forWhom.hidePlayer( player ); + } + }, 1); + getServer().getScheduler().scheduleSyncDelayedTask( this, new Runnable() { public void run() { forWhom.showPlayer( player ); } - }, 2 ); + }, 5); + } }