Fix exception in world ordering code when world not in worlds list
This commit is contained in:
parent
e4628b2664
commit
51db1bda82
1 changed files with 13 additions and 9 deletions
|
|
@ -223,16 +223,20 @@ 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);
|
||||||
int insertIndex;
|
if(worldIndex == null) {
|
||||||
for(insertIndex = 0; insertIndex < worlds.size(); insertIndex++) {
|
worlds.add(dynmapWorld); /* Put at end if no world section */
|
||||||
Integer nextWorldIndex = indexLookup.get(worlds.get(insertIndex).world.getName());
|
}
|
||||||
if (nextWorldIndex == null || worldIndex < nextWorldIndex.intValue()) {
|
else {
|
||||||
break;
|
int insertIndex;
|
||||||
}
|
for(insertIndex = 0; insertIndex < worlds.size(); insertIndex++) {
|
||||||
|
Integer nextWorldIndex = indexLookup.get(worlds.get(insertIndex).world.getName());
|
||||||
|
if (nextWorldIndex == null || worldIndex < nextWorldIndex.intValue()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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…
Add table
Add a link
Reference in a new issue