Restore player unsit locations after plugin reload

This commit is contained in:
Shevchik 2013-09-06 03:34:01 +04:00
parent f60e22b414
commit 32e28b1695

View File

@ -69,6 +69,21 @@ public class Chairs extends JavaPlugin {
}
protocolManager = ProtocolLibrary.getProtocolManager();
new PacketListener(protocolManager, this);
for (final Player player : Bukkit.getOnlinePlayers())
{
final Location loc = getPlayerSitstoploc(player.getName());
if (loc != null)
{
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable()
{
public void run()
{
player.teleport(loc);
player.setSneaking(false);
}
},1);
}
}
}
@Override