if (args.length != 1 || args[0].length() == 0) {
sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
return false;
}
Difficulty difficulty = Difficulty.getByValue(getDifficultyForString(sender, args[0]));
if (Bukkit.isHardcore()) {
difficulty = Difficulty.HARD;
}
Bukkit.getWorlds().get(0).setDifficulty(difficulty);
int levelCount = 1;
if (Bukkit.getAllowNether()) {
Bukkit.getWorlds().get(levelCount).setDifficulty(difficulty);
levelCount++;
}
if (Bukkit.getAllowEnd()) {
Bukkit.getWorlds().get(levelCount).setDifficulty(difficulty);
}
Command.broadcastCommandMessage(sender, "Set difficulty to " + difficulty.toString());
return true;
}