From 28d22a7a95521c48254086a84d00c5144be2cb8b Mon Sep 17 00:00:00 2001 From: Shevchik Date: Sun, 15 Dec 2013 12:06:04 +0400 Subject: [PATCH] Also unsit player on death --- src/com/cnaude/chairs/EventListener.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/com/cnaude/chairs/EventListener.java b/src/com/cnaude/chairs/EventListener.java index 09bc7a9..bf9aa88 100644 --- a/src/com/cnaude/chairs/EventListener.java +++ b/src/com/cnaude/chairs/EventListener.java @@ -15,6 +15,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.vehicle.VehicleExitEvent; @@ -42,6 +43,16 @@ public class EventListener implements Listener { } } + @EventHandler(priority=EventPriority.LOWEST) + public void onPlayerDeath(PlayerDeathEvent event) + { + Player player = event.getEntity(); + if (plugin.sit.containsKey(player.getName())) + { + plugin.unSitPlayer(player,true); + } + } + private HashSet queueUnsit = new HashSet(); @EventHandler(priority=EventPriority.LOWEST) public void onExitVehicle(VehicleExitEvent e)