Unsit player on quit
This commit is contained in:
parent
cba9a08208
commit
699d7a5ec3
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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;
|
||||||
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user