Skip to content

Commit

Permalink
Wrap the HidePlayer in a sync task instead of async.
Browse files Browse the repository at this point in the history
  • Loading branch information
ataranlen committed Mar 15, 2016
1 parent 628ab8a commit 125bf1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/net/md_5/itag/iTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
}

Expand Down

0 comments on commit 125bf1e

Please sign in to comment.