Unsit player on quit

This commit is contained in:
Shevchik 2013-09-01 15:43:26 +04:00
parent cba9a08208
commit 699d7a5ec3
3 changed files with 13 additions and 13 deletions

View File

@ -14,6 +14,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.material.Stairs; import org.bukkit.material.Stairs;
import org.bukkit.material.Step; import org.bukkit.material.Step;
import org.bukkit.material.WoodenStep; 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) @EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true)
public void onBlockBreak(BlockBreakEvent event) public void onBlockBreak(BlockBreakEvent event)
{ {

View File

@ -1,7 +1,5 @@
package com.cnaude.chairs; package com.cnaude.chairs;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.comphenix.protocol.Packets; import com.comphenix.protocol.Packets;
@ -67,14 +65,4 @@ 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;
}
} }

Binary file not shown.