mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
Fix Spout speed limiting (#590)
This commit is contained in:
parent
df273dce6e
commit
2fd345de8a
1 changed files with 14 additions and 16 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue