This commit is contained in:
Shevchik 2013-12-15 19:29:20 +04:00
parent 4710e5b10d
commit 6332a9b4ba

View File

@ -40,17 +40,17 @@ public class TryUnsitEventListener implements Listener {
if (plugin.sit.containsKey(player.getName())) if (plugin.sit.containsKey(player.getName()))
{ {
plugin.unSitPlayer(player, false, false); plugin.unSitPlayer(player, false, false);
event.setCancelled(true);
final Location loc = event.getTo();
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
{
public void run()
{
player.teleport(loc);
player.setSneaking(false);
}
},1);
} }
event.setCancelled(true);
final Location loc = event.getTo();
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
{
public void run()
{
player.teleport(loc);
player.setSneaking(false);
}
},1);
} }
@EventHandler(priority=EventPriority.LOWEST) @EventHandler(priority=EventPriority.LOWEST)