From 8e946bcba27765cf9dc8f6415d1b15cedc5d830f Mon Sep 17 00:00:00 2001 From: FrozenCow Date: Thu, 26 May 2011 18:04:12 +0200 Subject: [PATCH] Reverted map-structure for worlds, so that worlds have an order again. This reverts commit 0f4a8c2023cdf4374fddc14ad4edfd3827b74ea4, eb76fbe007b49420a9521c9c950c2df5a158f4f8 and 1b827459d01ca873f3f6dc12463fec662495cca4. --- configuration.txt | 10 +++++----- src/main/java/org/dynmap/DynmapPlugin.java | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/configuration.txt b/configuration.txt index d8afad9a..35d0ada2 100644 --- a/configuration.txt +++ b/configuration.txt @@ -177,13 +177,13 @@ worlds: # Worlds can be handled by templates, based on world type # You can override the properties of the template by specifying them in this section # for example 'Title: "My Awesome World"' - #world: + #- name: world # title: "World" - # # Use 'enabled: false' to disable a certain world. + # Use 'enabled: false' to disable a certain world. # enabled: false - # # Use 'template: mycustomtemplate' to use the properties specified in the template 'mycustomtemplate' to this world. Default it is set to the environment-name (normal or nether). + # Use 'template: mycustomtemplate' to use the properties specified in the template 'mycustomtemplate' to this world. Default it is set to the environment-name (normal or nether). # template: mycustomtemplate - # # Rest of comes from template - uncomment to tailor for world specifically + # Rest of comes from template - uncomment to tailor for world specifically # center: # x: 0 # y: 64 @@ -224,7 +224,7 @@ worlds: #- name: world2 # title: "Second World" # - #nether: + #- name: nether # title: "Nether" # center: # x: 0 diff --git a/src/main/java/org/dynmap/DynmapPlugin.java b/src/main/java/org/dynmap/DynmapPlugin.java index ee1b6fe4..c16f789a 100644 --- a/src/main/java/org/dynmap/DynmapPlugin.java +++ b/src/main/java/org/dynmap/DynmapPlugin.java @@ -406,9 +406,11 @@ public class DynmapPlugin extends JavaPlugin { } private ConfigurationNode getWorldConfigurationNode(String worldName) { - ConfigurationNode worlds = configuration.getNode("worlds"); - if (worlds != null) - return configuration.getNode("worlds").getNode(worldName); + for(ConfigurationNode worldNode : configuration.getNodes("worlds")) { + if (worldName.equals(worldNode.getString("name"))) { + return worldNode; + } + } return new ConfigurationNode(); }