コード例 #1
0
 private void safeUnban(
     final String playerName, final CommandSender commandSender, final boolean silentFlag) {
   try {
     Banlist.unban(playerName);
     Bukkit.getLogger()
         .info(String.format("%s unbanned by %s", playerName, commandSender.getName()));
     if (!silentFlag) {
       Bukkit.broadcastMessage(
           AsshatModule.formatBroadcastMessage(
               configuration.getUnbanBroadcastMsg(), playerName, commandSender.getName(), ""));
     }
   } catch (Exception ex) {
     ex.printStackTrace();
     commandSender.sendMessage(String.format("Something went wrong: %s", ex.getMessage()));
   }
 }
コード例 #2
0
 /**
  * Creates a new unban command executor.
  *
  * @param module The owning module.
  */
 public UnbanCommandExecutor(final AsshatModule module) {
   configuration = (AsshatModuleConfiguration) module.getConfiguration();
 }