Fix Spout speed limiting (#590)

This commit is contained in:
Christopher Martin 2016-10-08 14:09:03 -07:00 committed by GitHub
parent df273dce6e
commit 2fd345de8a

View file

@ -1088,22 +1088,20 @@ public class PKListener implements Listener {
return; return;
} }
// else if (CoreAbility.hasAbility(player, WaterSpout.class) || CoreAbility.hasAbility(player, AirSpout.class) || CoreAbility.hasAbility(player, SandSpout.class)) { else if (CoreAbility.hasAbility(player, WaterSpout.class) || CoreAbility.hasAbility(player, AirSpout.class) || CoreAbility.hasAbility(player, SandSpout.class)) {
// Vector vel = new Vector(); Vector vel = new Vector();
// vel.setX(event.getTo().getX() - event.getFrom().getX()); vel.setX(event.getTo().getX() - event.getFrom().getX());
// vel.setY(event.getTo().getY() - event.getFrom().getY()); vel.setZ(event.getTo().getZ() - event.getFrom().getZ());
// vel.setZ(event.getTo().getZ() - event.getFrom().getZ());
// // You now know the old velocity. Set to match recommended velocity double currspeed = vel.length();
// double currspeed = vel.length(); double maxspeed = .2;
// double maxspeed = .15; if (currspeed > maxspeed) {
// if (currspeed > maxspeed) { // apply only if moving set a factor
// // only if moving set a factor vel = vel.normalize().multiply(maxspeed);
// vel = vel.normalize().multiply(maxspeed); // apply the new velocity
// // apply the new velocity (MAY REQUIRE A SCHEDULED TASK event.getPlayer().setVelocity(vel);
// // INSTEAD!) }
// event.getPlayer().setVelocity(vel); }
// }
// }
else if (Bloodbending.isBloodbent(player)) { else if (Bloodbending.isBloodbent(player)) {
double distance1, distance2; double distance1, distance2;