diff --git a/src/com/cnaude/chairs/Chairs.java b/src/com/cnaude/chairs/Chairs.java index beaf273..9776ea7 100644 --- a/src/com/cnaude/chairs/Chairs.java +++ b/src/com/cnaude/chairs/Chairs.java @@ -117,9 +117,20 @@ public class Chairs extends JavaPlugin { protected HashMap sitblock = new HashMap(); protected HashMap sitblockbr = new HashMap(); protected HashMap sitstopteleportloc = new HashMap(); - protected void ejectPlayer(Player player) + protected void ejectPlayer(final Player player) { player.eject(); + final Location tploc = sitstopteleportloc.get(player.getName()); + System.out.println(tploc); + if (tploc != null) + { + Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable(){ + public void run() + { + player.teleport(tploc); + } + },1); + } unSit(player); } protected void unSit(Player player) { diff --git a/src/com/cnaude/chairs/EventListener.java b/src/com/cnaude/chairs/EventListener.java index 9f87b50..af92a37 100644 --- a/src/com/cnaude/chairs/EventListener.java +++ b/src/com/cnaude/chairs/EventListener.java @@ -265,6 +265,7 @@ public class EventListener implements Listener { player.sendMessage(plugin.msgSitting); } + plugin.sitstopteleportloc.put(player.getName(), player.getLocation()); player.teleport(plocation); Entity arrow = block.getWorld().spawnArrow(getBlockCentre(block).subtract(0, 0.5, 0), new Vector(0, 0, 0), 0, 0); arrow.setPassenger(player); diff --git a/target/Chairs.jar b/target/Chairs.jar index ff4bceb..3b3658b 100644 Binary files a/target/Chairs.jar and b/target/Chairs.jar differ