diff --git a/src/fr/maxlego08/koth/command/commands/CommandKoth.java b/src/fr/maxlego08/koth/command/commands/CommandKoth.java index 0533f73..d7b7d9c 100644 --- a/src/fr/maxlego08/koth/command/commands/CommandKoth.java +++ b/src/fr/maxlego08/koth/command/commands/CommandKoth.java @@ -17,6 +17,7 @@ public class CommandKoth extends VCommand { this.addSubCommand(new CommandKothSpawn(plugin)); this.addSubCommand(new CommandKothStop(plugin)); this.addSubCommand(new CommandKothMove(plugin)); + this.addSubCommand(new CommandKothVersion(plugin)); } @Override diff --git a/src/fr/maxlego08/koth/command/commands/CommandKothAxe.java b/src/fr/maxlego08/koth/command/commands/CommandKothAxe.java index 475567f..bd57e27 100644 --- a/src/fr/maxlego08/koth/command/commands/CommandKothAxe.java +++ b/src/fr/maxlego08/koth/command/commands/CommandKothAxe.java @@ -14,6 +14,7 @@ public class CommandKothAxe extends VCommand { this.setPermission(Permission.ZKOTH_AXE); this.addSubCommand("axe"); this.setDescription(Message.DESCRIPTION_AXE); + this.onlyPlayers(); } @Override diff --git a/src/fr/maxlego08/koth/command/commands/CommandKothCreate.java b/src/fr/maxlego08/koth/command/commands/CommandKothCreate.java index 33c0df3..912c850 100644 --- a/src/fr/maxlego08/koth/command/commands/CommandKothCreate.java +++ b/src/fr/maxlego08/koth/command/commands/CommandKothCreate.java @@ -24,6 +24,7 @@ public class CommandKothCreate extends VCommand { this.addRequireArg("name"); this.addOptionalArg("type", (a, b) -> Arrays.stream(KothType.values()).map(e -> e.name().toLowerCase()).collect(Collectors.toList())); this.addOptionalArg("capture/score", (a, b) -> Arrays.asList("10", "20", "30", "40", "50", "60")); + this.onlyPlayers(); } @Override diff --git a/src/fr/maxlego08/koth/command/commands/CommandKothVersion.java b/src/fr/maxlego08/koth/command/commands/CommandKothVersion.java new file mode 100644 index 0000000..3faf940 --- /dev/null +++ b/src/fr/maxlego08/koth/command/commands/CommandKothVersion.java @@ -0,0 +1,29 @@ +package fr.maxlego08.koth.command.commands; + +import fr.maxlego08.koth.KothPlugin; +import fr.maxlego08.koth.command.VCommand; +import fr.maxlego08.koth.zcore.enums.Message; +import fr.maxlego08.koth.zcore.enums.Permission; +import fr.maxlego08.koth.zcore.utils.commands.CommandType; + +public class CommandKothVersion extends VCommand { + + public CommandKothVersion(KothPlugin plugin) { + super(plugin); + this.addSubCommand("version", "?", "v"); + this.setDescription(Message.DESCRIPTION_SPAWN); + } + + @Override + protected CommandType perform(KothPlugin plugin) { + + message(this.sender, "§aVersion du plugin§7: §2" + plugin.getDescription().getVersion()); + message(this.sender, "§aAuteur§7: §2Maxlego08"); + message(this.sender, "§aDiscord§7: §2http://discord.groupez.dev/"); + message(this.sender, "§aBuy it for §d8€§7: §2https://groupez.dev/resources/zKoth.9"); + message(this.sender, "§aSponsor§7: §chttps://serveur-minecraft-vote.fr/?ref=345"); + + return CommandType.SUCCESS; + } + +} diff --git a/src/fr/maxlego08/koth/zcore/enums/Message.java b/src/fr/maxlego08/koth/zcore/enums/Message.java index 933e1ab..8aa9f9b 100644 --- a/src/fr/maxlego08/koth/zcore/enums/Message.java +++ b/src/fr/maxlego08/koth/zcore/enums/Message.java @@ -46,6 +46,7 @@ public enum Message { DESCRIPTION_RELOAD("Reload configuration files"), DESCRIPTION_NOW("Spawn a koth without cooldown"), DESCRIPTION_SPAWN("Spawn a koth with cooldown"), + DESCRIPTION_VERSION("Show plugin version"), DESCRIPTION_STOP("Stop a koth"), DESCRIPTION_MOVE("Move a koth"), DESCRIPTION_AXE("Getting the selection axe"), diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 50f0ceb..2fa7cfd 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -16,6 +16,7 @@ # /zkoth spawn - zkoth.spawn - Spawn a koth # /zkoth stop - zkoth.stop - Stop a koth # /zkoth move - zkoth.stop - Move a koth +# /zkoth version - no permission - Show plugin version # # Placeholders: #