mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2025-12-27 18:59:10 +00:00
Add dynmap support to other integrations
This commit is contained in:
@@ -70,6 +70,14 @@ public class GriefPreventionIntegration implements IntegrationManager {
|
||||
|
||||
@Override
|
||||
public @NotNull List<Location> getBoundingBoxPoints(Location regionLocation, @Nullable String regionId) {
|
||||
return null;
|
||||
List<Location> points = new ArrayList<>();
|
||||
Claim claim = GriefPrevention.instance.dataStore.getClaimAt(regionLocation, false, null);
|
||||
if (regionId != null && !String.valueOf(claim.getID()).equals(regionId)) {
|
||||
return points;
|
||||
}
|
||||
|
||||
points.add(claim.getGreaterBoundaryCorner());
|
||||
points.add(claim.getLesserBoundaryCorner());
|
||||
return points;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -61,6 +62,6 @@ public class ResidenceIntegration implements IntegrationManager {
|
||||
|
||||
@Override
|
||||
public @NotNull List<Location> getBoundingBoxPoints(Location regionLocation, @Nullable String regionId) {
|
||||
return null;
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -40,6 +41,6 @@ public class RPGRegionsIntegration implements IntegrationManager {
|
||||
|
||||
@Override
|
||||
public @NotNull List<Location> getBoundingBoxPoints(Location regionLocation, @Nullable String regionId) {
|
||||
return null;
|
||||
return new ArrayList<>(); // TODO
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,17 @@ public class UltraRegionsIntegration implements IntegrationManager {
|
||||
|
||||
@Override
|
||||
public @NotNull List<Location> getBoundingBoxPoints(Location regionLocation, @Nullable String regionId) {
|
||||
return null;
|
||||
List<Location> points = new ArrayList<>();
|
||||
for (Region region : getProtectedRegions(regionLocation)) {
|
||||
if (regionId != null && !region.getName().equals(regionId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (XYZ point : region.getSelection().getTracePoints()) {
|
||||
points.add(new Location(regionLocation.getWorld(), point.getX(), regionLocation.getY(), point.getZ()));
|
||||
}
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
private List<Region> getProtectedRegions(Location location) {
|
||||
|
||||
Reference in New Issue
Block a user