@SuppressWarnings("unchecked")
 @Override
 public void loadCraftingRecipes(ItemStack result) {
   HashMap<List<Object>, ItemStack> recipes = null;
   try {
     try {
       recipes =
           ReflectionManager.getField(
               RecipeRegistry.class, HashMap.class, RecipeRegistry.registry(), 1);
     } catch (ArrayIndexOutOfBoundsException e) {
     }
   } catch (Exception e) {
     e.printStackTrace();
     return;
   }
   if (recipes == null) return;
   for (Entry<List<Object>, ItemStack> recipe : recipes.entrySet()) {
     ItemStack item = recipe.getValue();
     if (NEIClientUtils.areStacksSameType(item, result)) {
       arecipes.add(
           new FreezingPair(
               new ItemStack((Item) recipe.getKey().get(0), 1, (Integer) recipe.getKey().get(1)),
               item,
               new ItemStack((Item) recipe.getKey().get(0), 1, (Integer) recipe.getKey().get(1))
                   .getItem()
                   .getContainerItem(
                       new ItemStack(
                           (Item) recipe.getKey().get(0), 1, (Integer) recipe.getKey().get(1)))));
     }
   }
 }
 public String getRecipeName() {
   return NEIClientUtils.translate("recipe.shapeless");
 }
Exemplo n.º 3
0
 private void updateNames() {
   toggleButton.text =
       NEIClientUtils.translate("options." + name + "." + (show() ? "show" : "hide"));
 }