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)