use of org.spongepowered.api.world.difficulty.Difficulty in project Nucleus by NucleusPowered.
the class SetDifficultyWorldCommand method executeCommand.
@Override
public CommandResult executeCommand(final CommandSource src, CommandContext args) throws Exception {
Difficulty difficultyInput = args.<Difficulty>getOne(difficulty).get();
WorldProperties worldProperties = getWorldFromUserOrArgs(src, this.world, args);
worldProperties.setDifficulty(difficultyInput);
src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("command.world.setdifficulty.success", worldProperties.getWorldName(), Util.getTranslatableIfPresent(difficultyInput)));
return CommandResult.success();
}
Aggregations