From e970c02808f409583feee3293e2aa2ef42015f43 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Mon, 22 Aug 2011 23:48:18 -0500 Subject: [PATCH] Capes were not applying properly to players when added at login (at least as seen by existing connected clients), so a slight delay has been added there to fix it --- .../factions/listeners/FactionsPlayerListener.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java index c8d814b1..e3fe1c2c 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -123,8 +123,10 @@ public class FactionsPlayerListener extends PlayerListener{ @Override public void onPlayerJoin(PlayerJoinEvent event) { + final Player player = event.getPlayer(); + // Make sure that all online players do have a fplayer. - FPlayer me = FPlayer.get(event.getPlayer()); + FPlayer me = FPlayer.get(player); // Update the lastLoginTime for this fplayer me.setLastLoginTime(System.currentTimeMillis()); @@ -133,7 +135,12 @@ public class FactionsPlayerListener extends PlayerListener{ FPlayer.autoLeaveOnInactivityRoutine(); FPlayer.autoLeaveOnInactivityRoutine(); - SpoutFeatures.updateAppearances(event.getPlayer()); + // Appearance updates which are run when a player joins don't apply properly for other clients, so they need to be delayed slightly + Factions.instance.getServer().getScheduler().scheduleSyncDelayedTask(Factions.instance, new Runnable() { + public void run() { + SpoutFeatures.updateAppearances(player); + } + }); } @Override