mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Less bad isInZone method
This commit is contained in:
parent
6ea70423bd
commit
b9f5c80753
1 changed files with 3 additions and 5 deletions
|
|
@ -289,21 +289,19 @@ public final class WildernessZone extends MapZone {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the entity is inside the wilderness.
|
||||
* @param e The entity.
|
||||
* @return {@code True} if so.
|
||||
*/
|
||||
public static boolean isInZone(Entity e) {
|
||||
Location l = e.getLocation();
|
||||
for (RegionZone zone : e.getViewport().getRegion().getRegionZones()) {
|
||||
if (zone.getZone() == INSTANCE && zone.getBorders().insideBorder(l.getX(), l.getY())) {
|
||||
for (ZoneBorders border : INSTANCE.borders) {
|
||||
if (border.insideBorder(e))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The wilderness level.
|
||||
* @return the level.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue