Delay calculating skin updates a bit, partially fixes the skin issue!

This commit is contained in:
mcmonkey4eva 2015-04-06 15:32:00 -07:00
parent 62c6b724df
commit 8a52f81ae5

View File

@ -280,7 +280,10 @@ public class EventListen implements Listener {
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerJoin(PlayerJoinEvent event) { public void onPlayerJoin(final PlayerJoinEvent event) {
new BukkitRunnable() {
@Override
public void run() {
final Player player = event.getPlayer(); final Player player = event.getPlayer();
final List<EntityPlayer> nearbyNPCs = new ArrayList<EntityPlayer>(); final List<EntityPlayer> nearbyNPCs = new ArrayList<EntityPlayer>();
for (NPC npc : getAllNPCs()) { for (NPC npc : getAllNPCs()) {
@ -294,13 +297,16 @@ public class EventListen implements Listener {
public void run() { public void run() {
sendToPlayer(player, nearbyNPCs); sendToPlayer(player, nearbyNPCs);
} }
}.runTaskLater(CitizensAPI.getPlugin(), 40); }.runTaskLater(CitizensAPI.getPlugin(), 30);
new BukkitRunnable() { new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
sendToPlayer(player, nearbyNPCs); sendToPlayer(player, nearbyNPCs);
} }
}.runTaskLater(CitizensAPI.getPlugin(), 80); }.runTaskLater(CitizensAPI.getPlugin(), 70);
}
}.runTaskLater(CitizensAPI.getPlugin(), 10);
} }
void sendToPlayer(final Player player, final List<EntityPlayer> nearbyNPCs) { void sendToPlayer(final Player player, final List<EntityPlayer> nearbyNPCs) {