Less bad isInZone method

This commit is contained in:
Ceikry 2022-09-09 07:58:17 -05:00
parent 6ea70423bd
commit b9f5c80753

View file

@ -289,21 +289,19 @@ public final class WildernessZone extends MapZone {
} }
} }
/** /**
* Checks if the entity is inside the wilderness. * Checks if the entity is inside the wilderness.
* @param e The entity. * @param e The entity.
* @return {@code True} if so. * @return {@code True} if so.
*/ */
public static boolean isInZone(Entity e) { public static boolean isInZone(Entity e) {
Location l = e.getLocation(); for (ZoneBorders border : INSTANCE.borders) {
for (RegionZone zone : e.getViewport().getRegion().getRegionZones()) { if (border.insideBorder(e))
if (zone.getZone() == INSTANCE && zone.getBorders().insideBorder(l.getX(), l.getY())) {
return true; return true;
}
} }
return false; return false;
} }
/** /**
* The wilderness level. * The wilderness level.
* @return the level. * @return the level.