Add support for world-level hide/show in visibleregions and hiddenregions using "world:<worldname>" syntax.

recommended 0.13
Mike Primm 14 years ago committed by mikeprimm
parent 76ad1f8419
commit 4a19a941ff
  1. 8
      src/main/java/org/dynmap/worldguard/DynmapWorldGuardPlugin.java
  2. 2
      src/main/resources/config.yml

@ -115,14 +115,14 @@ public class DynmapWorldGuardPlugin extends JavaPlugin {
return v; return v;
} }
private boolean isVisible(String id) { private boolean isVisible(String id, String worldname) {
if((visible != null) && (visible.size() > 0)) { if((visible != null) && (visible.size() > 0)) {
if(visible.contains(id) == false) { if((visible.contains(id) == false) && (visible.contains("world:" + worldname) == false)) {
return false; return false;
} }
} }
if((hidden != null) && (hidden.size() > 0)) { if((hidden != null) && (hidden.size() > 0)) {
if(hidden.contains(id)) if(hidden.contains(id) || hidden.contains("world:" + worldname))
return false; return false;
} }
return true; return true;
@ -183,7 +183,7 @@ public class DynmapWorldGuardPlugin extends JavaPlugin {
String desc = formatInfoWindow(region); String desc = formatInfoWindow(region);
/* Handle areas */ /* Handle areas */
if(isVisible(region.getId())) { if(isVisible(region.getId(), world.getName())) {
String id = region.getId(); String id = region.getId();
String tn = region.getTypeName(); String tn = region.getTypeName();
BlockVector l0 = region.getMinimumPoint(); BlockVector l0 = region.getMinimumPoint();

@ -27,9 +27,11 @@ regionstyle:
fillOpacity: 0.35 fillOpacity: 0.35
# Optional setting to limit which regions to show, by name - if commented out, all regions are shown # Optional setting to limit which regions to show, by name - if commented out, all regions are shown
# To show all regions on a given world, add 'world:<worldname>' to the list
visibleregions: [ ] visibleregions: [ ]
# Optional setting to hide specific regions, by name # Optional setting to hide specific regions, by name
# To hide all regions on a given world, add 'world:<worldname>' to the list
hiddenregions: [ ] hiddenregions: [ ]
# Optional per-region overrides for regionstyle (any defined replace those in regionstyle) # Optional per-region overrides for regionstyle (any defined replace those in regionstyle)

Loading…
Cancel
Save