コード例 #1
0
        @Override
        public void call(MessageRunner runner) {
          ItemPattern pattern = runner.<ItemPattern>getValue("pattern");

          WeightedItemList list = OrbAcquirableItems.idList;
          int size = list.size(), damageRemoved = 0;

          for (Iterator<WeightedItem> iter = list.iterator(); iter.hasNext(); ) {
            Pair<Integer, Boolean> info = iter.next().runBlacklistPattern(pattern);

            if (info.getRight()) iter.remove();
            damageRemoved += info.getLeft();
          }

          size = size - list.size();

          if (size == 0 && damageRemoved == 0)
            MessageLogger.logWarn("Did not find any items to remove.");
          else if (size == 0)
            MessageLogger.logOk("Removed $0 damage value(s) from items.", damageRemoved);
          else
            MessageLogger.logOk(
                "Removed $0 item(s) and $1 damage value(s) in total.", size, damageRemoved);

          if (list.size() == 0)
            MessageLogger.logWarn("No items left in the list, falling back to generic chest loot.");
        }
コード例 #2
0
 @Override
 public void call(MessageRunner runner) {
   if (OrbSpawnableMobs.classList.remove(
       EntityList.stringToClassMapping.get(runner.getString("id"))))
     MessageLogger.logOk("Removed 1 mob from the list.");
   else MessageLogger.logFail("The mob was not present in the list.");
 }
コード例 #3
0
        @Override
        public void call(MessageRunner runner) {
          Class<?> cls = (Class<?>) EntityList.stringToClassMapping.get(runner.getString("id"));

          if (IBossDisplayData.class.isAssignableFrom(cls))
            MessageLogger.logFail("Cannot add boss mobs to the list.");
          else if (OrbSpawnableMobs.classList.add(cls))
            MessageLogger.logOk("Added 1 mob to the list.");
          else MessageLogger.logFail("The mob was already in the list.");
        }