PvP zones are now only applied to the intended planet instead of every planet #290

This commit is contained in:
Ziggy
2020-12-12 11:47:01 +01:00
parent 0e0b518f52
commit 13fd3a1747

View File

@@ -281,6 +281,11 @@ public class FactionFlagService extends Service {
return pvpZones.values().stream()
.anyMatch(pvpZone -> {
Location zoneLocation = pvpZone.getLocation();
if (location.getTerrain() != zoneLocation.getTerrain()) {
return false;
}
double radius = pvpZone.getRadius();
return location.isWithinFlatDistance(zoneLocation, radius);