Exemplo n.º 1
0
  public static void purgeRecipes() {

    List<ItemStack> toPurge = new ArrayList<ItemStack>();

    for (String entry : SI.CONFIG.purgerecipes) {
      Object is = SI.REGISTRY.stringToItemStack(entry);
      if (is instanceof ItemStack) {
        toPurge.add((ItemStack) is);
      }
    }

    List recipes = CraftingManager.getInstance().getRecipeList();
    List removallist = new ArrayList();

    for (ItemStack purgeEntry : toPurge) {
      for (Object entry : recipes) {
        if (entry instanceof IRecipe) {
          ItemStack output = ((IRecipe) entry).getRecipeOutput();
          if (output != null) {

            if ((output.getItem() == purgeEntry.getItem())
                && (output.getItemDamage() == 32767
                    || output.getItemDamage() == purgeEntry.getItemDamage())) {
              removallist.add(entry);
            }
          }
        }
      }
    }

    for (Object toRemove : removallist) {
      recipes.remove(toRemove);
    }
  }
Exemplo n.º 2
0
  public static void hideNEIItems() {
    for (String entry : SI.CONFIG.hideitemsfromnei) {
      Object is = SI.REGISTRY.stringToItemStack(entry);
      if (is instanceof ItemStack) {

        API.hideItem((ItemStack) is);
      }
    }
  }