public class PlayerMoveListener implements Listener {
@EventHandler
public void onMove(PlayerMoveEvent e)
{
if (e.isCancelled()) {
return;
}
Player p = e.getPlayer();
Combat c = CombatManager.getCombat(p);
if (c.hasFight())
{
Location to = e.getTo();
Location from = e.getFrom();
if (((from.getBlockX() != to.getBlockX()) || (from.getBlockY() != to.getBlockY()) || (from.getBlockZ() != to.getBlockZ())) && (ChatUtil.Location(Config.SPAWNLINE_MINX, Config.SPAWNLINE_MAXX, Config.SPAWNLINE_MINZ, Config.SPAWNLINE_MAXZ, to)))
{
Location l = p.getLocation().subtract(10, 80, 10);
double distance = p.getLocation().distance(l);
Vector v = l.toVector().add(new Vector(1, 1, 1)).multiply(3.0D / distance);
p.setVelocity(v.multiply(4.5D).setY(0.5));
ChatUtil.sendTitleMessage(p, Config.MESSAGES_TITLE, Config.SPAWNLINE_MESSAGE, 75, 70, 65);
e.setCancelled(true);
return;
}
}
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}