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:
@@ -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);
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user