Skip to content

Commit

Permalink
Experimental fix for shooting fireballs with a script arg
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 18, 2017
1 parent 60f54a0 commit b4541ee
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -318,9 +318,9 @@ public void run() {

// Otherwise, if the entity is no longer traveling through
// the air, stop the task
else if (lastVelocity != null) {
if (lastVelocity.distance
(lastEntity.getBukkitEntity().getVelocity()) < 0.05) {
else if (lastLocation != null && lastVelocity != null) {
if (lastLocation.distanceSquared(lastEntity.getBukkitEntity().getLocation()) < 1
&& lastVelocity.distanceSquared(lastEntity.getBukkitEntity().getVelocity()) < 0.1) {
flying = false;
}
}
Expand Down Expand Up @@ -385,7 +385,7 @@ else if (lastVelocity != null) {
scriptEntry.setFinished(true);
}
else {
// Record it's position in case the entity dies
// Record its position in case the entity dies
lastLocation = lastEntity.getLocation();
lastVelocity = lastEntity.getVelocity();
}
Expand Down

0 comments on commit b4541ee

Please sign in to comment.