@Override
 @SuppressWarnings("unchecked")
 public void loadCraftingRecipes(String outputId, Object... results) {
   if (outputId.equals("freezing")
       && getClass() == FreezerRecipeHandler.class) // don't want subclasses getting a hold of this
   {
     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();
       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)))));
     }
   } else {
     super.loadCraftingRecipes(outputId, results);
   }
 }
Esempio n. 2
0
  @Override
  public void loadCraftingRecipes(String outputId, Object... results) {

    if (outputId.equals(getRecipesID())) {
      for (Cutter_Recipe recipe : RecipeRegistry.cutter) recipes.add(recipe);
    } else super.loadCraftingRecipes(outputId, results);
  }
 @Override
 public void loadCraftingRecipes(String outputId, Object... results) {
   if (outputId.equals("botania.brewery"))
     for (RecipeBrew recipe : BotaniaAPI.brewRecipes)
       arecipes.add(new CachedBreweryRecipe(recipe));
   else super.loadCraftingRecipes(outputId, results);
 }
 @Override
 public void loadCraftingRecipes(String outputId, Object... results) {
   if (outputId != null && outputId.equals("rcpulsej")) {
     Collection<ItemStack> li = RecipesPulseFurnace.getRecipes().getAllSmeltables();
     for (ItemStack is : li) arecipes.add(new PulseJetRecipe(is));
   }
   super.loadCraftingRecipes(outputId, results);
 }
 @Override
 public void loadCraftingRecipes(String outputId, Object... results) {
   if (outputId != null && outputId.equals("rccentri")) {
     Collection<ItemStack> li = RecipesCentrifuge.getRecipes().getAllCentrifugables();
     for (ItemStack is : li) arecipes.add(new CentrifugeRecipe(is));
   }
   super.loadCraftingRecipes(outputId, results);
 }
 @Override
 public void loadCraftingRecipes(String outputId, Object... results) {
   if ((outputId.equals("redstone")) && (getClass() == RedstoneExtractorHandler.class)) {
     Map<ItemStack, Integer> recipes = RedstoneExtractorRecipes.discharge().getPowerList();
     for (Map.Entry<ItemStack, Integer> recipe : recipes.entrySet())
       this.arecipes.add(new StarchPair(recipe.getKey(), recipe.getValue()));
   } else {
     super.loadCraftingRecipes(outputId, results);
   }
 }
 @Override
 public void loadCraftingRecipes(String outputId, Object... results) {
   if (outputId.equals(this.getRecipeId())) {
     for (final Map.Entry<PositionedStack, PositionedStack> irecipe : this.getRecipes()) {
       this.arecipes.add(new CachedRefineryRecipe(irecipe));
     }
   } else {
     super.loadCraftingRecipes(outputId, results);
   }
 }
 public void loadCraftingRecipes(String outputId, Object... results) {
   if (outputId.equals("chisel2.chisel")) {
     for (String name : Carving.chisel.getSortedGroupNames()) {
       ICarvingGroup g = Carving.chisel.getGroup(name);
       if (!g.getVariations().isEmpty()) {
         addCached(getVariationStacks(g));
       }
     }
   } else {
     super.loadCraftingRecipes(outputId, results);
   }
 }
 public void loadCraftingRecipes(String outputId, Object... results) {
   if ((outputId.equals("electrolysing")) && (getClass() == ElectrolyserRecipeHandler.class)) {
     Map<Object[], Object[]> recipes = ElectrolyserRecipes.instance().getRecipes();
     for (Map.Entry<Object[], Object[]> recipe : recipes.entrySet()) {
       this.arecipes.add(
           new SmeltingPair(
               recipe.getKey()[0],
               recipe.getValue()[0],
               recipe.getValue()[1],
               recipe.getValue()[2],
               recipe.getValue()[3]));
     }
   } else {
     super.loadCraftingRecipes(outputId, results);
   }
 }
  @Override
  public void loadCraftingRecipes(String outputId, Object... results) {
    if (outputId.equals("DCsHeatSource") && getClass() == HeatSourceHandler.class) {
      List<ICookingHeatSource> recipes = this.recipeLoader();

      if (recipes == null || recipes.isEmpty()) return;
      for (ICookingHeatSource recipe : recipes) {
        Block block = recipe.getBlock();
        int m = recipe.getMetadata();
        boolean a = RecipeRegisterManager.plateRecipe.isHeatSource(block, m);
        boolean b = RecipeRegisterManager.panRecipe.isHeatSource(block, m);
        arecipes.add(new HeatRecipeCacher(new ItemStack(block, 1, m), a, b));
      }
    } else {
      super.loadCraftingRecipes(outputId, results);
    }
  }
 @Override
 public void loadCraftingRecipes(String outputId, Object... results) {
   if (outputId.equals("contraptions.heat"))
     for (HeatRecipes recipe : RecipeManager.heat) arecipes.add(new CachedHeatRecipe(recipe));
   else super.loadCraftingRecipes(outputId, results);
 }