Make help message configurable. Resolves #52.
This commit is contained in:
@@ -62,13 +62,10 @@ public class VaultCommand implements CommandExecutor {
|
|||||||
|
|
||||||
if (VaultOperations.openOtherVault(player, searchPlayer, args[1])) {
|
if (VaultOperations.openOtherVault(player, searchPlayer, args[1])) {
|
||||||
PlayerVaults.getInstance().getInVault().put(player.getUniqueId().toString(), new VaultViewInfo(player.getUniqueId(), Integer.parseInt(args[1])));
|
PlayerVaults.getInstance().getInVault().put(player.getUniqueId().toString(), new VaultViewInfo(player.getUniqueId(), Integer.parseInt(args[1])));
|
||||||
} else {
|
|
||||||
sender.sendMessage(Lang.TITLE.toString() + "Failed to open vault.");
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sender.sendMessage(Lang.TITLE + "/pv <number>");
|
sender.sendMessage(Lang.TITLE.toString() + Lang.HELP.toString());
|
||||||
sender.sendMessage(Lang.TITLE + "/pv <player> <number>");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(Lang.TITLE.toString() + ChatColor.RED + Lang.PLAYER_ONLY.toString());
|
sender.sendMessage(Lang.TITLE.toString() + ChatColor.RED + Lang.PLAYER_ONLY.toString());
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ public enum Lang {
|
|||||||
CONVERT_PLUGIN_NOT_FOUND("plugin-not-found", "&cNo converter found for that plugin"),
|
CONVERT_PLUGIN_NOT_FOUND("plugin-not-found", "&cNo converter found for that plugin"),
|
||||||
CONVERT_COMPLETE("conversion-complete", "&aConverted %converted players to PlayerVaults"),
|
CONVERT_COMPLETE("conversion-complete", "&aConverted %converted players to PlayerVaults"),
|
||||||
CONVERT_BACKGROUND("conversion-background", "&fConversion has been forked to the background. See console for updates."),
|
CONVERT_BACKGROUND("conversion-background", "&fConversion has been forked to the background. See console for updates."),
|
||||||
LOCKED("vaults-locked", "&cVaults are currently locked while conversion occurs. Please try again in a moment!");
|
LOCKED("vaults-locked", "&cVaults are currently locked while conversion occurs. Please try again in a moment!"),
|
||||||
|
HELP("help", "/pv <number>");
|
||||||
|
|
||||||
private String path;
|
private String path;
|
||||||
private String def;
|
private String def;
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ public class VaultOperations {
|
|||||||
try {
|
try {
|
||||||
number = Integer.parseInt(arg);
|
number = Integer.parseInt(arg);
|
||||||
if (number < 1) {
|
if (number < 1) {
|
||||||
|
player.sendMessage(Lang.TITLE.toString() + ChatColor.RED + Lang.MUST_BE_NUMBER);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException nfe) {
|
} catch (NumberFormatException nfe) {
|
||||||
|
|||||||
@@ -25,4 +25,5 @@ no-player-found: "&cCannot find player &a%p"
|
|||||||
plugin-not-found: "&cNo converter found for that plugin"
|
plugin-not-found: "&cNo converter found for that plugin"
|
||||||
conversion-complete: "&aConverted %converted players to PlayerVaults"
|
conversion-complete: "&aConverted %converted players to PlayerVaults"
|
||||||
conversion-background: "&fConversion has been forked to the background. See console for updates."
|
conversion-background: "&fConversion has been forked to the background. See console for updates."
|
||||||
vaults-locked: "&cVaults are currently locked while conversion occurs. Please try again in a moment!"
|
vaults-locked: "&cVaults are currently locked while conversion occurs. Please try again in a moment!"
|
||||||
|
help: "/pv <number>"
|
||||||
Reference in New Issue
Block a user