예제 #1
0
 @HookHandler
 public void onCommand(PlayerCommandHook hook) {
   if (hook.getPlayer().isAdmin()) {
     return;
   }
   String[] split = hook.getCommand();
   if (CuboidInterface.get().commandIsRestricted(hook.getPlayer(), split[0])) {
     hook.setCanceled();
   }
 }
예제 #2
0
 @Override
 public Hook onCommand(PlayerCommandHook hook) {
   String[] split = hook.getCommand();
   Player player = hook.getPlayer();
   if (split[0].equalsIgnoreCase("/me")) {
     String message = "";
     for (int $x = 1; $x < split.length; $x++) {
       message = message + " " + split[$x];
     }
     this.plugin.sendIRCMessage("* " + player.getName() + message);
   }
   if ((split[0].equalsIgnoreCase("/ircreload")) && (player.hasPermission("ircanary.reload"))) {
     this.plugin.loadAdmins();
     player.sendMessage("§c[IRCanary] IRC admins reloaded");
   }
   hook.setCancelled();
   return hook;
 }