mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
EarthSmash: Fixed an error when checking distances
This commit is contained in:
parent
9a02098119
commit
1d3ded62f6
1 changed files with 5 additions and 2 deletions
|
@ -545,10 +545,13 @@ public class EarthSmash {
|
||||||
|
|
||||||
for(EarthSmash smash : instances) {
|
for(EarthSmash smash : instances) {
|
||||||
//Check to see if the player is standing on top of the smash.
|
//Check to see if the player is standing on top of the smash.
|
||||||
if(smash.state == State.LIFTED)
|
if(smash.state == State.LIFTED) {
|
||||||
if(smash.loc.clone().add(0,2,0).distanceSquared(player.getLocation()) <= Math.pow(FLIGHT_DETECTION_RADIUS, 2))
|
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 smash;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue