EarthSmash: Fixed an error when checking distances

This commit is contained in:
nathank33 2015-01-29 23:45:57 -08:00
parent 9a02098119
commit 1d3ded62f6

View file

@ -545,10 +545,13 @@ public class EarthSmash {
for(EarthSmash smash : instances) {
//Check to see if the player is standing on top of the smash.
if(smash.state == State.LIFTED)
if(smash.loc.clone().add(0,2,0).distanceSquared(player.getLocation()) <= Math.pow(FLIGHT_DETECTION_RADIUS, 2))
if(smash.state == State.LIFTED) {
if(smash.loc.getWorld().equals(player.getWorld())
&& smash.loc.clone().add(0,2,0).distanceSquared(player.getLocation()) <= Math.pow(FLIGHT_DETECTION_RADIUS, 2)) {
return smash;
}
}
}
return null;
}