Skip to content

Commit

Permalink
🚧 New command - /betterpvp version
Browse files Browse the repository at this point in the history
  • Loading branch information
Sstudiosdev authored Apr 1, 2024
1 parent cb5fb68 commit 687b39b
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,19 @@ public void execute(CommandSender sender, String[] args) {
sender.sendMessage(ChatColorUtil.colorize("&f"));
sender.sendMessage(ChatColorUtil.colorize("&3/betterpvp help &7- Show this help message"));
sender.sendMessage(ChatColorUtil.colorize("&f"));
sender.sendMessage(ChatColorUtil.colorize("&3/betterpvp version &7- shows you the current plugin version"));
sender.sendMessage(ChatColorUtil.colorize("&f"));
sender.sendMessage(ChatColorUtil.colorize("&3/pvp <on/off> &7- activates and deactivates player pvp"));
sender.sendMessage(ChatColorUtil.colorize("&f"));
sender.sendMessage(ChatColorUtil.colorize("&3/pvpworld <on/off> <world> &7- disable and enable global pvp for all players in that world"));
} else if (args.length == 1 && args[0].equalsIgnoreCase("version")) {
// Handle version argument
String pluginVersion = betterPvP.getDescription().getVersion();
String versionMessage = betterPvP.getMainConfig().getString("version-message");
if (versionMessage != null) {
versionMessage = versionMessage.replace("%version%", pluginVersion);
sender.sendMessage(ChatColorUtil.colorize(BetterPvP.prefix + " " + versionMessage));
}
} else {
// Incorrect use message
sender.sendMessage(ChatColorUtil.colorize(BetterPvP.prefix + " &cUsage: /betterpvp <command>"));
Expand All @@ -55,6 +65,7 @@ public List<String> tabComplete(CommandSender sender, String alias, String[] arg
if (args.length == 1) {
completions.add("reload");
completions.add("help");
completions.add("version");
}
return completions;
}
Expand Down

0 comments on commit 687b39b

Please sign in to comment.