Added new permission node to control who can check version number

Negate this permission node to hide the version number from /mcmmo and
motd
This commit is contained in:
TfT_02 2014-02-17 16:31:59 +01:00
parent 0a6735110f
commit c51fde7f1f
4 changed files with 11 additions and 2 deletions

View File

@ -30,7 +30,10 @@ public class McmmoCommand implements CommandExecutor {
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "gjmcferrin@gmail.com" + ChatColor.GOLD + " Paypal");
}
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
if (Permissions.showversion(sender)) {
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
}
mcMMO.getHolidayManager().anniversaryCheck(sender);
return true;

View File

@ -34,7 +34,9 @@ public final class Motd {
* @param version Plugin version
*/
public static void displayVersion(Player player, String version) {
player.sendMessage(LocaleLoader.getString("MOTD.Version", version));
if (Permissions.showversion(player)) {
player.sendMessage(LocaleLoader.getString("MOTD.Version", version));
}
}
/**

View File

@ -25,6 +25,7 @@ public final class Permissions {
public static boolean mobHealthDisplay(Permissible permissible) { return permissible.hasPermission("mcmmo.mobhealthdisplay"); }
public static boolean updateNotifications(Permissible permissible) {return permissible.hasPermission("mcmmo.tools.updatecheck"); }
public static boolean chimaeraWing(Permissible permissible) { return permissible.hasPermission("mcmmo.item.chimaerawing"); }
public static boolean showversion(Permissible permissible) { return permissible.hasPermission("mcmmo.showversion"); }
/* BYPASS */
public static boolean hardcoreBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.hardcoremode"); }

View File

@ -1937,6 +1937,9 @@ permissions:
children:
mcmmo.ability.woodcutting.all: true
mcmmo.commands.woodcutting: true
mcmmo.showversion:
default: true
description: Show mcMMO version number in /mcmmo and motd
mcmmo.tools.*:
default: false
description: Implies all mcmmo.tools permissions.