mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
Add world checks FireShield
This commit is contained in:
parent
bb9dc95dd7
commit
e9827fd499
1 changed files with 6 additions and 3 deletions
|
@ -185,12 +185,15 @@ public class FireShield {
|
||||||
FireShield fshield = instances.get(player);
|
FireShield fshield = instances.get(player);
|
||||||
Location playerLoc = fshield.player.getLocation();
|
Location playerLoc = fshield.player.getLocation();
|
||||||
|
|
||||||
if(fshield.shield){
|
if(fshield.shield) {
|
||||||
|
if (playerLoc.getWorld() != loc.getWorld())
|
||||||
|
return false;
|
||||||
if(playerLoc.distance(loc) <= fshield.radius)
|
if(playerLoc.distance(loc) <= fshield.radius)
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
Location tempLoc = playerLoc.clone().add(playerLoc.multiply(fshield.discradius));
|
Location tempLoc = playerLoc.clone().add(playerLoc.multiply(fshield.discradius));
|
||||||
|
if (playerLoc.getWorld() != tempLoc.getWorld())
|
||||||
|
return false;
|
||||||
if(tempLoc.distance(loc) <= fshield.discradius)
|
if(tempLoc.distance(loc) <= fshield.discradius)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue