Skip to content

Commit

Permalink
Require valid worlds to form a dCuboid
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Apr 1, 2016
1 parent 681519d commit 58e1931
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/main/java/net/aufdemrand/denizen/Denizen.java
Expand Up @@ -1215,8 +1215,6 @@ public boolean onCommand(CommandSender sender, Command cmd, String cmdName, Stri
return true;
}

//if (Depends.citizens != null)
// return citizens.onCommand(sender, cmd, cmdName, args);
String modifier = args.length > 0 ? args[0] : "";
if (!commandManager.hasCommand(cmd, modifier) && !modifier.isEmpty()) {
return suggestClosestModifier(sender, cmd.getName(), modifier);
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dCuboid.java
Expand Up @@ -105,6 +105,11 @@ public static dCuboid valueOf(String string, TagContext context) {
dB.echoError("valueOf in dCuboid returning null (null locations): '" + string + "'.");
return null;
}
// Must have valid worlds
if (pos_1.getWorld() == null || pos_2.getWorld() == null) {
dB.echoError("valueOf in dCuboid returning null (null worlds): '" + string + "'.");
return null;
}
toReturn.addPair(pos_1, pos_2);
}

Expand Down
Expand Up @@ -760,11 +760,11 @@ public void registerCoreMembers() {
// @Syntax createworld [<name>] (g:<generator>) (worldtype:<type>) (environment:<environment>) (copy_from:<world>)
// @Required 1
// @Stable unstable
// @Short Creates a new world
// @Short Creates a new world, or loads an existing world.
// @Author aufdemrand, mcmonkey
// @Group world
// @Description
// This command creates a new minecraft world with the specified name.
// This command creates a new minecraft world with the specified name, or loads an existing world by thet name.
// TODO: Document Command Details (generator)
// It accepts a world type which can be specified with 'worldtype:'.
// If a worldtype is not specified it will create a world with a worldtype of NORMAL.
Expand Down

0 comments on commit 58e1931

Please sign in to comment.