diff --git a/src/com/cnaude/chairs/EventListener.java b/src/com/cnaude/chairs/EventListener.java index 6f08f0e..7fbfc0f 100644 --- a/src/com/cnaude/chairs/EventListener.java +++ b/src/com/cnaude/chairs/EventListener.java @@ -14,6 +14,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.material.Stairs; import org.bukkit.material.Step; import org.bukkit.material.WoodenStep; @@ -62,6 +63,17 @@ public class EventListener implements Listener { } } + @EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) + public void onPlayerQuit(PlayerQuitEvent event) + { + Player player = event.getPlayer(); + if (plugin.sit.containsKey(player.getName())) + { + player.eject(); + unSit(player); + } + } + @EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onBlockBreak(BlockBreakEvent event) { diff --git a/src/com/cnaude/chairs/PacketListener.java b/src/com/cnaude/chairs/PacketListener.java index 64e8d22..2ddefd3 100644 --- a/src/com/cnaude/chairs/PacketListener.java +++ b/src/com/cnaude/chairs/PacketListener.java @@ -1,7 +1,5 @@ package com.cnaude.chairs; -import org.bukkit.Location; -import org.bukkit.block.Block; import org.bukkit.entity.Player; import com.comphenix.protocol.Packets; @@ -65,16 +63,6 @@ public class PacketListener { } } } - - - private Location getTeleportLoc(Player player) - { - Block sittingon = pluginInstance.sitblockbr.get(player.getName()); - sittingon.getLocation(); - player.getLocation().getYaw(); - Location to = player.getLineOfSight(null, 5).get(0).getLocation(); - return to; - } - + } diff --git a/target/Chairs.jar b/target/Chairs.jar index 25dd114..20d11ba 100644 Binary files a/target/Chairs.jar and b/target/Chairs.jar differ