Remove old arrow instantly

This commit is contained in:
Shevchik 2015-01-15 12:55:01 +04:00
parent 7cc0d12ed6
commit b409aa9b7a

View File

@ -61,9 +61,9 @@ public class PlayerSitData {
sitdata.resittask = task; sitdata.resittask = task;
player.teleport(sitlocation); player.teleport(sitlocation);
arrow.setPassenger(player); arrow.setPassenger(player);
sitdata.sitting = true;
sit.put(player, sitdata); sit.put(player, sitdata);
sitblock.put(blocktooccupy, player); sitblock.put(blocktooccupy, player);
sitdata.sitting = true;
return true; return true;
} }
@ -74,17 +74,8 @@ public class PlayerSitData {
Entity arrow = plugin.getNMSAccess().spawnArrow(prevarrow.getLocation()); Entity arrow = plugin.getNMSAccess().spawnArrow(prevarrow.getLocation());
arrow.setPassenger(player); arrow.setPassenger(player);
sitdata.arrow = arrow; sitdata.arrow = arrow;
sitdata.sitting = true;
Bukkit.getScheduler().scheduleSyncDelayedTask(
plugin,
new Runnable() {
@Override
public void run() {
prevarrow.remove(); prevarrow.remove();
} sitdata.sitting = true;
},
100
);
} }
public boolean unsitPlayer(Player player) { public boolean unsitPlayer(Player player) {