9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-31 04:36:29 +00:00

Add option to enable dynmap per-region

This commit is contained in:
SamB440
2021-05-11 21:49:48 +01:00
parent b53b85efc3
commit 7f2a2bebf9
2 changed files with 7 additions and 0 deletions

View File

@@ -77,6 +77,7 @@ public class ConfiguredRegion {
@EditableField(material = XMaterial.RED_DYE, name = "Hex display colour", description = "Set the colour of the region. It is a hex colour (e.g 0x42f4f1 for red) and is used in dynmap.")
private final String colour;
private final String lineColour;
private final boolean dynmap;
public ConfiguredRegion(@Nullable World world, String id, String customName,
List<DiscoveryReward> rewards, List<RegionEffect> effects) {
@@ -103,6 +104,7 @@ public class ConfiguredRegion {
this.showActionbar = true;
this.colour = String.valueOf(13369344);
this.lineColour = String.valueOf(13369344);
this.dynmap = true;
}
public ConfiguredRegion(@Nullable World world, String id, String customName,
@@ -334,6 +336,10 @@ public class ConfiguredRegion {
return lineColour;
}
public boolean isDynmap() {
return dynmap;
}
public void save(IRPGRegionsAPI plugin) {
try {
File file = this.findFile(plugin);

View File

@@ -28,6 +28,7 @@ public class DynmapTask implements Runnable {
@Override
public void run() {
plugin.getManagers().getRegionsCache().getConfiguredRegions().forEach((name, region) -> {
if (!region.isDynmap()) return;
List<Location> boundingBox = region.getBoundingBox();
if (boundingBox == null) return;
if (!markers.containsKey(name)) {