/*     */ public boolean senderHasPermission() /*     */ {
   /*  67 */ CommandPermissions permissions =
       (CommandPermissions) commandClass.getAnnotation(CommandPermissions.class);
   /*  69 */ if (permissions == null)
   /*     */ {
     /*  71 */ TFM_Log.warning(commandClass.getName() + " is missing permissions annotation.");
     /*  72 */ return true;
     /*     */ }
   /*  75 */ boolean isSuper = TFM_AdminList.isSuperAdmin(commandSender);
   /*  76 */ boolean isSenior = false;
   /*  78 */ if (isSuper) {
     /*  80 */ isSenior = TFM_AdminList.isSeniorAdmin(commandSender);
     /*     */ }
   /*  83 */ AdminLevel level = permissions.level();
   /*  84 */ SourceType source = permissions.source();
   /*  85 */ boolean blockHostConsole = permissions.blockHostConsole();
   /*  87 */ if (!(commandSender instanceof Player))
   /*     */ {
     /*  89 */ if (source == SourceType.ONLY_IN_GAME) {
       /*  91 */ return false;
       /*     */ }
     /*  94 */ if ((level == AdminLevel.SENIOR) && (!isSenior)) {
       /*  96 */ return false;
       /*     */ }
     /*  99 */ if ((blockHostConsole) && (TFM_Util.isFromHostConsole(commandSender.getName()))) {
       /* 101 */ return false;
       /*     */ }
     /* 104 */ return true;
     /*     */ }
   /* 107 */ Player senderPlayer = (Player) commandSender;
   /* 109 */ if (source == SourceType.ONLY_CONSOLE) {
     /* 111 */ return false;
     /*     */ }
   /* 114 */ if (level == AdminLevel.SENIOR)
   /*     */ {
     /* 116 */ if (!isSenior) {
       /* 118 */ return false;
       /*     */ }
     /* 121 */ if (!TFM_PlayerData.getPlayerData(senderPlayer).isSuperadminIdVerified()) {
       /* 123 */ return false;
       /*     */ }
     /* 126 */ return true;
     /*     */ }
   /* 129 */ if ((level == AdminLevel.SUPER) && (!isSuper)) {
     /* 131 */ return false;
     /*     */ }
   /* 134 */ if ((level == AdminLevel.OP) && (!senderPlayer.isOp())) {
     /* 136 */ return false;
     /*     */ }
   /* 139 */ return true;
   /*     */ }
Esempio n. 2
0
 // Level.WARNING:
 public static void warning(String message) {
   warning(message, false);
 }