From 30df8ca7836e4b3e8e11534e69bdec73dc998dd3 Mon Sep 17 00:00:00 2001 From: mcmonkey4eva Date: Sun, 19 Oct 2014 09:29:00 -0700 Subject: [PATCH] Throw less errors in the time command Who names their world 'world'? --- .../denizen/scripts/commands/world/TimeCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/world/TimeCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/world/TimeCommand.java index 1505faa5dd..82e2e2b6ce 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/world/TimeCommand.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/world/TimeCommand.java @@ -55,8 +55,10 @@ else if (!scriptEntry.hasObject("world") scriptEntry.defaultObject("world", scriptEntry.hasNPC() ? new dWorld(scriptEntry.getNPC().getWorld()) : null, - scriptEntry.hasPlayer() ? new dWorld(scriptEntry.getPlayer().getWorld()) : null, - dWorld.valueOf("world")); + scriptEntry.hasPlayer() ? new dWorld(scriptEntry.getPlayer().getWorld()) : null); + + if (!scriptEntry.hasObject("world")) + throw new InvalidArgumentsException("Must specify a valid world!"); } @Override