ImportCommand now checks if the world was successfully imported.

Fixes #359
This commit is contained in:
main() 2012-01-01 17:28:44 +01:00
parent 47e052d180
commit 07247a1afd
2 changed files with 5 additions and 3 deletions

View File

@ -143,8 +143,10 @@ public class ImportCommand extends MultiverseCommand {
if (worldFile.exists() && env != null) {
Command.broadcastCommandMessage(sender, "Starting import of world '" + worldName + "'...");
this.worldManager.addWorld(worldName, environment, null, generator, useSpawnAdjust);
Command.broadcastCommandMessage(sender, "Complete!");
if (this.worldManager.addWorld(worldName, environment, null, generator, useSpawnAdjust))
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Complete!");
else
Command.broadcastCommandMessage(sender, ChatColor.RED + "Failed!");
} else if (env == null) {
sender.sendMessage(ChatColor.RED + "FAILED.");
sender.sendMessage("That world environment did not exist.");

View File

@ -131,7 +131,7 @@ public class TestWorldStuff {
verify(mockCommandSender).sendMessage("Starting import of world 'world'...");
verify(mockCommandSender).sendMessage("Starting import of world 'world_nether'...");
verify(mockCommandSender).sendMessage("Starting import of world 'world_the_end'...");
verify(mockCommandSender, VerificationModeFactory.times(3)).sendMessage("Complete!");
verify(mockCommandSender, VerificationModeFactory.times(3)).sendMessage(ChatColor.GREEN + "Complete!");
}
@Test