📝 Add version command

This commit is contained in:
Maxlego08 2024-02-22 16:35:30 +01:00
parent 5489150d3b
commit 326d18f298
6 changed files with 34 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;
}
}

View File

@ -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"),

View File

@ -16,6 +16,7 @@
# /zkoth spawn <koth name> - zkoth.spawn - Spawn a koth
# /zkoth stop <koth name> - zkoth.stop - Stop a koth
# /zkoth move <koth name> - zkoth.stop - Move a koth
# /zkoth version - no permission - Show plugin version
#
# Placeholders:
#