i18n: Remove command

This commit is contained in:
Lildirt 2023-03-01 11:26:02 -05:00
parent ca0f6febb5
commit 12f6ceb622
3 changed files with 15 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import co.aikar.commands.annotation.Single;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import org.bukkit.ChatColor;
import org.jetbrains.annotations.NotNull;
@ -23,19 +24,20 @@ public class RemoveCommand extends MultiverseCoreCommand {
@CommandPermission("multiverse.core.remove")
@CommandCompletion("@mvworlds:scope=both")
@Syntax("<world>")
@Description("Unloads a world from Multiverse and removes it from worlds.yml, this does NOT DELETE the world folder.")
@Description("{@@mv-core.remove.description}")
public void onRemoveCommand(BukkitCommandIssuer issuer,
@Single
@Conditions("mvworlds:scope=both")
@Syntax("<world>")
@Description("World you want to remove from mv's knowledge.")
@Description("{@@mv-core.remove.world.description}")
String worldName
) {
if (!this.plugin.getMVWorldManager().removeWorldFromConfig(worldName)) {
issuer.sendMessage(String.format("%sError trying to remove world from config!", ChatColor.RED));
issuer.sendInfo(MVCorei18n.REMOVE_FAILED);
return;
}
issuer.sendMessage(String.format("World '%s' is removed from config!", worldName));
issuer.sendInfo(MVCorei18n.REMOVE_SUCCESS,
"{world}", worldName);
}
}

View File

@ -54,6 +54,10 @@ public enum MVCorei18n implements MessageKeyProvider {
// reload command
RELOAD_RELOADING,
RELOAD_SUCCESS,
// remove command
REMOVE_FAILED,
REMOVE_SUCCESS,
DEBUG_INFO_OFF,
DEBUG_INFO_ON;

View File

@ -65,6 +65,11 @@ mv-core.regen.prompt=Are you sure you want to regenerate world '{world}'?
mv-core.reload.description=Reloads config files for all Multiverse modules.
mv-core.reload.reloading=Reloading all Multiverse Plugin configs...
mv-core.reload.success=Reload complete!
mv-core.remove.description=Unloads a world from Multiverse and removes it from worlds.yml. This does NOT delete the world folder.
mv-core.remove.world.description=World you want to remove from MV's knowledge.
mv-core.remove.failed=Error trying to remove world from config!
mv-core.remove.success=World '{world}' is removed from config!
mv-core.debug.info.description=Show the current debug level.
mv-core.debug.info.off=&fMultiverse Debug mode is &cOFF&f.
mv-core.debug.info.on=&fMultiverse Debug mode is at &alevel {level}&f.