Merge pull request #161 from mikeprimm/master

Add hiddenworlds list to suppress templates on listed worlds
This commit is contained in:
mikeprimm 2011-05-23 08:10:18 -07:00
commit d75a0ea325
2 changed files with 10 additions and 2 deletions

View File

@ -169,7 +169,10 @@ template:
prefix: nt
maximumheight: 127
colorscheme: default
# This list of worlds will be hidden - they will not be automatically initialized by templates
hiddenworlds:
- MyHiddenWorld
- AnotherHiddenWorld
# The maptypes Dynmap will use to render.
worlds:

View File

@ -379,13 +379,18 @@ public class DynmapPlugin extends JavaPlugin {
worlds = new ArrayList<ConfigurationNode>();
worldsupdated = true;
}
List<String> hiddenworlds = node.getStrings("hiddenworlds", Collections.EMPTY_LIST);
/* Iternate by world type - so that order in templateworldtypes drives our default order */
for(int wtype = 0; wtype < templateworldtypes.length; wtype++) {
ConfigurationNode typetemplate = template.getNode(templateworldtypes[wtype]);
if(typetemplate == null)
continue;
for(World w : getServer().getWorlds()) { /* Roll through worlds */
String wn = w.getName();
String wn = w.getName();
/* Skip processing on hidden worlds */
if(hiddenworlds.contains(wn))
continue;
/* Find node for this world, if any */
ConfigurationNode world = null;
int index;