Skip to content

Commit

Permalink
Fix up dWorld.
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Jul 2, 2013
1 parent f926eec commit 410d786
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/net/aufdemrand/denizen/objects/dWorld.java
Expand Up @@ -22,7 +22,7 @@ public static dWorld mirrorBukkitWorld(World world) {
}

@ObjectFetcher("w")
public static dPlayer valueOf(String string) {
public static dWorld valueOf(String string) {
if (string == null) return null;

string = string.replace("w@", "");
Expand All @@ -36,7 +36,11 @@ public static dPlayer valueOf(String string) {
if (world.getName().equalsIgnoreCase(string))
returnable = world;

if (returnable != null) new dWorld(returnable);
if (returnable != null) {
if (worlds.containsKey(returnable.getName()))
return worlds.get(returnable.getName());
else return new dWorld(returnable);
}
else dB.echoError("Invalid World! '" + string
+ "' could not be found.");

Expand Down

0 comments on commit 410d786

Please sign in to comment.