mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
Fix exception in world ordering code when world not in worlds list
This commit is contained in:
parent
bc6176f3e1
commit
f9f615db2d
@ -223,7 +223,11 @@ public class MapManager {
|
|||||||
ConfigurationNode node = nodes.get(i);
|
ConfigurationNode node = nodes.get(i);
|
||||||
indexLookup.put(node.getString("name"), i);
|
indexLookup.put(node.getString("name"), i);
|
||||||
}
|
}
|
||||||
int worldIndex = indexLookup.get(worldName);
|
Integer worldIndex = indexLookup.get(worldName);
|
||||||
|
if(worldIndex == null) {
|
||||||
|
worlds.add(dynmapWorld); /* Put at end if no world section */
|
||||||
|
}
|
||||||
|
else {
|
||||||
int insertIndex;
|
int insertIndex;
|
||||||
for(insertIndex = 0; insertIndex < worlds.size(); insertIndex++) {
|
for(insertIndex = 0; insertIndex < worlds.size(); insertIndex++) {
|
||||||
Integer nextWorldIndex = indexLookup.get(worlds.get(insertIndex).world.getName());
|
Integer nextWorldIndex = indexLookup.get(worlds.get(insertIndex).world.getName());
|
||||||
@ -232,7 +236,7 @@ public class MapManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
worlds.add(insertIndex, dynmapWorld);
|
worlds.add(insertIndex, dynmapWorld);
|
||||||
|
}
|
||||||
|
|
||||||
worldsLookup.put(w.getName(), dynmapWorld);
|
worldsLookup.put(w.getName(), dynmapWorld);
|
||||||
plug_in.events.trigger("worldactivated", dynmapWorld);
|
plug_in.events.trigger("worldactivated", dynmapWorld);
|
||||||
|
Loading…
Reference in New Issue
Block a user