private void checkInventory(Inventory inv, Set<BlockData> goals, Location loc) {
   for (ItemStack item : inv.getContents()) {
     BlockData bd = BlockData.fromItemStack(item);
     for (BlockData data : goals)
       if (data.equals(bd)) master.found.add(new _Entry<BlockData, Vector>(data, loc.toVector()));
   }
 }
Esempio n. 2
0
  public void updateCarrying(Inventory inv) {
    Set<BlockData> newCarrying = Sets.newHashSet();
    if (getTeam() != null) {
      if (inv != null)
        for (ItemStack itm : inv) if (itm != null) newCarrying.add(BlockData.fromItemStack(itm));
      newCarrying.retainAll(getTeam().winConditions.values());

      if (newCarrying != carrying) getTeam().updateCarrying(this, carrying, newCarrying);
    }
    carrying = newCarrying;
  }