Restore player unsit locations after plugin reload
This commit is contained in:
parent
f60e22b414
commit
32e28b1695
@ -69,6 +69,21 @@ public class Chairs extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
protocolManager = ProtocolLibrary.getProtocolManager();
|
protocolManager = ProtocolLibrary.getProtocolManager();
|
||||||
new PacketListener(protocolManager, this);
|
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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user