From 7dcae62dc4da0fa02913b7a1d90994c1c14a4921 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sun, 25 Dec 2011 05:05:22 +0800 Subject: [PATCH] Add support for world-level hide/show in visibleregions and hiddenregions using "world:" syntax --- .../java/org/dynmap/factions/DynmapFactionsPlugin.java | 10 +++++----- src/main/resources/config.yml | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/dynmap/factions/DynmapFactionsPlugin.java b/src/main/java/org/dynmap/factions/DynmapFactionsPlugin.java index 1786410..51eda37 100644 --- a/src/main/java/org/dynmap/factions/DynmapFactionsPlugin.java +++ b/src/main/java/org/dynmap/factions/DynmapFactionsPlugin.java @@ -138,19 +138,19 @@ public class DynmapFactionsPlugin extends JavaPlugin { return v; } - private boolean isVisible(String id) { + private boolean isVisible(String id, String worldname) { if((visible != null) && (visible.size() > 0)) { - if(visible.contains(id) == false) { + if((visible.contains(id) == false) && (visible.contains("world:" + worldname) == false)) { return false; } } if((hidden != null) && (hidden.size() > 0)) { - if(hidden.contains(id)) + if(hidden.contains(id) || hidden.contains("world:" + worldname)) return false; } return true; } - + private void addStyle(String resid, AreaMarker m) { AreaStyle as = cusstyle.get(resid); if(as == null) { @@ -224,7 +224,7 @@ public class DynmapFactionsPlugin extends JavaPlugin { String desc = formatInfoWindow(fact); /* Handle areas */ - if(isVisible(factname)) { + if(isVisible(factname, world)) { if(blocks.isEmpty()) return; LinkedList nodevals = new LinkedList(); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 8da0def..0d4a191 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -25,9 +25,11 @@ regionstyle: homeicon: "redflag" # 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:' to the list visibleregions: [ ] # Optional setting to hide specific regions, by name +# To hide all regions on a given world, add 'world:' to the list hiddenregions: [ ] # Optional per-region overrides for regionstyle (any defined replace those in regionstyle)