Properly eject player

Actually i don't know why it works like that
This commit is contained in:
Shevchik 2013-12-14 21:45:04 +04:00
parent e6d1a1ed76
commit aa26c6626a
2 changed files with 10 additions and 9 deletions

View File

@ -189,13 +189,8 @@ public class Chairs extends JavaPlugin {
final Entity arrow = sit.get(player.getName());
sit.remove(player.getName());
player.eject();
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable()
{
public void run()
{
player.eject();
arrow.remove();
}
},20);
final Location tploc = sitstopteleportloc.get(player.getName());
if (tploc != null && !ignoretp)
{

View File

@ -45,12 +45,18 @@ public class EventListener implements Listener {
{
if (e.getVehicle().getPassenger() instanceof Player)
{
Player player = (Player) e.getVehicle().getPassenger();
final Player player = (Player) e.getVehicle().getPassenger();
if (plugin.sit.containsKey(player.getName()))
{
e.setCancelled(true);
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
{
public void run()
{
plugin.unSitPlayer(player, false);
}
});
}
}
}