mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 11:05:49 +01:00
Delay calculating skin updates a bit, partially fixes the skin issue!
This commit is contained in:
parent
62c6b724df
commit
8a52f81ae5
@ -280,27 +280,33 @@ public class EventListen implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final List<EntityPlayer> nearbyNPCs = new ArrayList<EntityPlayer>();
|
||||
for (NPC npc : getAllNPCs()) {
|
||||
Entity npcEntity = npc.getEntity();
|
||||
if (npcEntity instanceof Player && player.canSee((Player) npcEntity)) {
|
||||
nearbyNPCs.add(((CraftPlayer) npcEntity).getHandle());
|
||||
}
|
||||
}
|
||||
public void onPlayerJoin(final PlayerJoinEvent event) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
sendToPlayer(player, nearbyNPCs);
|
||||
final Player player = event.getPlayer();
|
||||
final List<EntityPlayer> nearbyNPCs = new ArrayList<EntityPlayer>();
|
||||
for (NPC npc : getAllNPCs()) {
|
||||
Entity npcEntity = npc.getEntity();
|
||||
if (npcEntity instanceof Player && player.canSee((Player) npcEntity)) {
|
||||
nearbyNPCs.add(((CraftPlayer) npcEntity).getHandle());
|
||||
}
|
||||
}
|
||||
}.runTaskLater(CitizensAPI.getPlugin(), 40);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
sendToPlayer(player, nearbyNPCs);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
sendToPlayer(player, nearbyNPCs);
|
||||
}
|
||||
}.runTaskLater(CitizensAPI.getPlugin(), 30);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
sendToPlayer(player, nearbyNPCs);
|
||||
}
|
||||
}.runTaskLater(CitizensAPI.getPlugin(), 70);
|
||||
}
|
||||
}.runTaskLater(CitizensAPI.getPlugin(), 80);
|
||||
}.runTaskLater(CitizensAPI.getPlugin(), 10);
|
||||
|
||||
}
|
||||
|
||||
void sendToPlayer(final Player player, final List<EntityPlayer> nearbyNPCs) {
|
||||
|
Loading…
Reference in New Issue
Block a user