Properly eject player
Actually i don't know why it works like that
This commit is contained in:
parent
e6d1a1ed76
commit
aa26c6626a
@ -189,13 +189,8 @@ public class Chairs extends JavaPlugin {
|
|||||||
final Entity arrow = sit.get(player.getName());
|
final Entity arrow = sit.get(player.getName());
|
||||||
sit.remove(player.getName());
|
sit.remove(player.getName());
|
||||||
player.eject();
|
player.eject();
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable()
|
player.eject();
|
||||||
{
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
arrow.remove();
|
arrow.remove();
|
||||||
}
|
|
||||||
},20);
|
|
||||||
final Location tploc = sitstopteleportloc.get(player.getName());
|
final Location tploc = sitstopteleportloc.get(player.getName());
|
||||||
if (tploc != null && !ignoretp)
|
if (tploc != null && !ignoretp)
|
||||||
{
|
{
|
||||||
|
@ -45,12 +45,18 @@ public class EventListener implements Listener {
|
|||||||
{
|
{
|
||||||
if (e.getVehicle().getPassenger() instanceof Player)
|
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()))
|
if (plugin.sit.containsKey(player.getName()))
|
||||||
{
|
{
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
plugin.unSitPlayer(player, false);
|
plugin.unSitPlayer(player, false);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user