mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-15 15:15:38 +01:00
i18n: Regen command
This commit is contained in:
parent
8b450910ba
commit
3e468dba4d
@ -18,6 +18,7 @@ import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagGroup;
|
||||
import com.onarandombox.MultiverseCore.commandtools.flags.CommandValueFlag;
|
||||
import com.onarandombox.MultiverseCore.commandtools.flags.ParsedCommandFlags;
|
||||
import com.onarandombox.MultiverseCore.commandtools.queue.QueuedCommand;
|
||||
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -42,17 +43,17 @@ public class RegenCommand extends MultiverseCoreCommand {
|
||||
@CommandPermission("multiverse.core.regen")
|
||||
@CommandCompletion("@mvworlds:scope=both @flags:groupName=mvregen")
|
||||
@Syntax("<world> --seed [seed] --keep-gamerules")
|
||||
@Description("Regenerates a world on your server. The previous state will be lost PERMANENTLY.")
|
||||
@Description("{@@mv-core.regen.description}")
|
||||
public void onRegenCommand(BukkitCommandIssuer issuer,
|
||||
|
||||
@Conditions("validWorldName:scope=both")
|
||||
@Syntax("<world>")
|
||||
@Description("World that you want to regen.")
|
||||
@Description("{@@mv-core.regen.world.description}")
|
||||
String worldName,
|
||||
|
||||
@Optional
|
||||
@Syntax("--seed [seed] --keep-gamerules")
|
||||
@Description("Other world settings. See: http://gg.gg/nn8lk")
|
||||
@Description("{@@mv-core.regen.other.description}")
|
||||
String[] flags
|
||||
) {
|
||||
ParsedCommandFlags parsedFlags = parseFlags(flags);
|
||||
@ -60,7 +61,8 @@ public class RegenCommand extends MultiverseCoreCommand {
|
||||
this.plugin.getMVCommandManager().getCommandQueueManager().addToQueue(new QueuedCommand(
|
||||
issuer.getIssuer(),
|
||||
() -> {
|
||||
issuer.sendMessage(String.format("Regenerating world '%s'...", worldName));
|
||||
issuer.sendInfo(MVCorei18n.REGEN_REGENERATING,
|
||||
"{world}", worldName);
|
||||
if (!this.plugin.getMVWorldManager().regenWorld(
|
||||
worldName,
|
||||
parsedFlags.hasFlag("--seed"),
|
||||
@ -68,12 +70,14 @@ public class RegenCommand extends MultiverseCoreCommand {
|
||||
parsedFlags.flagValue("--seed", String.class),
|
||||
parsedFlags.hasFlag("--keep-gamerules")
|
||||
)) {
|
||||
issuer.sendMessage(String.format("%sThere was an issue regenerating '%s'! Please check console for errors.", ChatColor.RED, worldName));
|
||||
issuer.sendInfo(MVCorei18n.REGEN_FAILED,
|
||||
"{world}", worldName);
|
||||
return;
|
||||
}
|
||||
issuer.sendMessage(String.format("%sWorld %s was regenerated!", ChatColor.GREEN, worldName));
|
||||
issuer.sendInfo(MVCorei18n.REGEN_SUCCESS,
|
||||
"{world}", worldName);
|
||||
},
|
||||
"Are you sure you want to regenerate world '" + worldName + "'?"
|
||||
"{@@mv-core.regen.prompt}".replace("{world}", worldName)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,12 @@ public enum MVCorei18n implements MessageKeyProvider {
|
||||
LOAD_LOADING,
|
||||
LOAD_FAILED,
|
||||
LOAD_SUCCESS,
|
||||
|
||||
// regen command
|
||||
REGEN_REGENERATING,
|
||||
REGEN_FAILED,
|
||||
REGEN_SUCCESS,
|
||||
REGEN_PROMPT,
|
||||
DEBUG_INFO_OFF,
|
||||
DEBUG_INFO_ON;
|
||||
|
||||
|
@ -53,6 +53,14 @@ mv-core.load.world.description=Name of world you want to load.
|
||||
mv-core.load.loading=Loading world '{world}'...
|
||||
mv-core.load.failed=Error trying to load world '{world}'!
|
||||
mv-core.load.success=Loaded world '{world}'!
|
||||
|
||||
mv-core.regen.description=Regenerates a world on your server. The previous state will be lost PERMANENTLY.
|
||||
mv-core.regen.world.description=World that you want to regen.
|
||||
mv-core.regen.other.description=Other world settings. See: http://gg.gg/nn8lk
|
||||
mv-core.regen.regenerating=Regenerating world '{world}'...
|
||||
mv-core.regen.failed=There was an issue regenerating '{world}'! Please check console for errors.
|
||||
mv-core.regen.success=World {world} was regenerated!
|
||||
mv-core.regen.prompt=Are you sure you want to regenerate world '{world}'?
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user