Fix instant unsit after sit

This commit is contained in:
Shevchik 2013-12-14 21:16:05 +04:00
parent 16a292dc6c
commit ab080914b0

View File

@ -134,7 +134,6 @@ public class Chairs extends JavaPlugin {
sitblock.put(block, player.getName()); sitblock.put(block, player.getName());
sitblockbr.put(player.getName(), block); sitblockbr.put(player.getName(), block);
startReSitTask(player); startReSitTask(player);
player.teleport(player.getWorld().getSpawnLocation());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -155,8 +154,9 @@ public class Chairs extends JavaPlugin {
protected void reSitPlayer(final Player player) protected void reSitPlayer(final Player player)
{ {
try { try {
player.eject();
final Entity prevarrow = sit.get(player.getName()); final Entity prevarrow = sit.get(player.getName());
sit.remove(player.getName());
player.eject();
Block block = sitblockbr.get(player.getName()); Block block = sitblockbr.get(player.getName());
Location arrowloc = block.getLocation().add(0.5, 0 , 0.5); Location arrowloc = block.getLocation().add(0.5, 0 , 0.5);
Entity arrow = player.getWorld().spawnArrow(arrowloc, new Vector(0, 0.1 ,0), 0, 0); Entity arrow = player.getWorld().spawnArrow(arrowloc, new Vector(0, 0.1 ,0), 0, 0);