We like sort order :)

This commit is contained in:
Olof Larsson 2013-01-01 11:07:42 +01:00
parent cfff2c5c09
commit b13f8f2df0

View File

@ -2,11 +2,11 @@ package com.massivecraft.mcore5.usys;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import java.util.TreeSet;
import com.massivecraft.mcore5.MCore; import com.massivecraft.mcore5.MCore;
import com.massivecraft.mcore5.cmd.arg.ARUniverse; import com.massivecraft.mcore5.cmd.arg.ARUniverse;
@ -88,7 +88,7 @@ public class Multiverse extends Entity<Multiverse, String>
public Set<String> getUniverses() public Set<String> getUniverses()
{ {
Set<String> ret = new LinkedHashSet<String>(); Set<String> ret = new TreeSet<String>();
ret.addAll(this.uw.keySet()); ret.addAll(this.uw.keySet());
ret.add(MCore.DEFAULT); ret.add(MCore.DEFAULT);
return ret; return ret;
@ -145,7 +145,7 @@ public class Multiverse extends Entity<Multiverse, String>
public Set<String> getWorlds() public Set<String> getWorlds()
{ {
Set<String>ret = new HashSet<String>(); Set<String> ret = new TreeSet<String>();
for (Set<String> uworlds : this.uw.values()) for (Set<String> uworlds : this.uw.values())
{ {
ret.addAll(uworlds); ret.addAll(uworlds);
@ -155,7 +155,13 @@ public class Multiverse extends Entity<Multiverse, String>
public Set<String> getWorlds(String universe) public Set<String> getWorlds(String universe)
{ {
return this.uw.get(universe); Set<String> orig = this.uw.get(universe);
if (orig == null) return null;
Set<String> ret = new TreeSet<String>();
ret.addAll(orig);
return ret;
} }
public boolean removeWorld(String worldName) public boolean removeWorld(String worldName)