#1467 Change /authme messages to only update help text file now

This commit is contained in:
ljacqu
2018-02-02 20:12:42 +01:00
parent 1d6d9eb764
commit cd61febd76
4 changed files with 15 additions and 22 deletions
@@ -12,7 +12,6 @@ import fr.xephi.authme.command.executable.authme.ForceLoginCommand;
import fr.xephi.authme.command.executable.authme.GetEmailCommand;
import fr.xephi.authme.command.executable.authme.GetIpCommand;
import fr.xephi.authme.command.executable.authme.LastLoginCommand;
import fr.xephi.authme.command.executable.authme.MessagesCommand;
import fr.xephi.authme.command.executable.authme.PurgeBannedPlayersCommand;
import fr.xephi.authme.command.executable.authme.PurgeCommand;
import fr.xephi.authme.command.executable.authme.PurgeLastPositionCommand;
@@ -26,6 +25,7 @@ import fr.xephi.authme.command.executable.authme.SetSpawnCommand;
import fr.xephi.authme.command.executable.authme.SpawnCommand;
import fr.xephi.authme.command.executable.authme.SwitchAntiBotCommand;
import fr.xephi.authme.command.executable.authme.UnregisterAdminCommand;
import fr.xephi.authme.command.executable.authme.UpdateHelpMessagesCommand;
import fr.xephi.authme.command.executable.authme.VersionCommand;
import fr.xephi.authme.command.executable.authme.debug.DebugCommand;
import fr.xephi.authme.command.executable.captcha.CaptchaCommand;
@@ -427,11 +427,10 @@ public class CommandInitializer {
CommandDescription.builder()
.parent(authmeBase)
.labels("messages", "msg")
.description("Add missing messages")
.detailedDescription("Adds missing messages to the current messages file.")
.withArgument("help", "Add 'help' to update the help messages file", true)
.description("Add missing help messages")
.detailedDescription("Adds missing texts to the current help messages file.")
.permission(AdminPermission.UPDATE_MESSAGES)
.executableCommand(MessagesCommand.class)
.executableCommand(UpdateHelpMessagesCommand.class)
.register();
CommandDescription.builder()
@@ -11,10 +11,10 @@ import java.io.IOException;
import java.util.List;
/**
* Messages command, updates the user's messages file with any missing files
* Messages command, updates the user's help messages file with any missing files
* from the provided file in the JAR.
*/
public class MessagesCommand implements ExecutableCommand {
public class UpdateHelpMessagesCommand implements ExecutableCommand {
@Inject
private HelpTranslationGenerator helpTranslationGenerator;
@@ -23,12 +23,6 @@ public class MessagesCommand implements ExecutableCommand {
@Override
public void executeCommand(CommandSender sender, List<String> arguments) {
if (!arguments.isEmpty() && "help".equalsIgnoreCase(arguments.get(0))) {
updateHelpFile(sender);
}
}
private void updateHelpFile(CommandSender sender) {
try {
helpTranslationGenerator.updateHelpFile();
sender.sendMessage("Successfully updated the help file");