Java 类net.minecraftforge.common.brewing.BrewingRecipe 实例源码

项目:SeasonsAPI    文件:SeasonPotion.java   
private static void registerUpgrades(PotionType normal, PotionType extended, PotionType strong) {
    BrewingRecipeRegistry.addRecipe(createBrewingRecipe(normal, new ItemStack(Items.REDSTONE), extended));
    BrewingRecipeRegistry.addRecipe(createBrewingRecipe(strong, new ItemStack(Items.REDSTONE), extended));
    BrewingRecipeRegistry.addRecipe(createBrewingRecipe(normal, new ItemStack(Items.GLOWSTONE_DUST), strong));      
    BrewingRecipeRegistry.addRecipe(createBrewingRecipe(extended, new ItemStack(Items.GLOWSTONE_DUST), strong));    
    BrewingRecipeRegistry.addRecipe(createSplashBrewingRecipe(normal, new ItemStack(Items.REDSTONE), extended));
    BrewingRecipeRegistry.addRecipe(createSplashBrewingRecipe(strong, new ItemStack(Items.REDSTONE), extended));
    BrewingRecipeRegistry.addRecipe(createSplashBrewingRecipe(normal, new ItemStack(Items.GLOWSTONE_DUST), strong));        
    BrewingRecipeRegistry.addRecipe(createSplashBrewingRecipe(extended, new ItemStack(Items.GLOWSTONE_DUST), strong));  
    BrewingRecipeRegistry.addRecipe(createLingeringBrewingRecipe(normal, new ItemStack(Items.REDSTONE), extended));
    BrewingRecipeRegistry.addRecipe(createLingeringBrewingRecipe(strong, new ItemStack(Items.REDSTONE), extended));
    BrewingRecipeRegistry.addRecipe(createLingeringBrewingRecipe(normal, new ItemStack(Items.GLOWSTONE_DUST), strong)); 
    BrewingRecipeRegistry.addRecipe(createLingeringBrewingRecipe(extended, new ItemStack(Items.GLOWSTONE_DUST), strong));   
    BrewingRecipeRegistry.addRecipe(new BrewingRecipe(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), normal), new ItemStack(Items.GUNPOWDER), (PotionUtils.addPotionToItemStack(new ItemStack(Items.SPLASH_POTION), normal))));
    BrewingRecipeRegistry.addRecipe(new BrewingRecipe(PotionUtils.addPotionToItemStack(new ItemStack(Items.SPLASH_POTION), normal), new ItemStack(Items.DRAGON_BREATH), (PotionUtils.addPotionToItemStack(new ItemStack(Items.LINGERING_POTION), normal))));
}
项目:CraftingHarmonics    文件:AddBrew.java   
@Override
public void init() throws OperationException {
    super.init();

    if(with != null && with.length >= 2) {
        input = with[0];
        ingredient = with[1];
    }

    if(input.equals("") || ingredient.equals("")) throw new OperationException("Brewing recipe is missing input or ingredient.");

    if(input == null) throw new RuntimeException("Unable to find requested input item " + input.toString());
    if(input.hasNbt()) {
        LogHelper.warn("NBT support for brews isn't done yet because it's considered an edge case - NBT + " +
                "stack size 1? - if you need this, please let me know!");
    }
    if(input.getItemStack().getMaxStackSize() > 1) throw new RuntimeException("Inputs for brewing cannot be stackable.");

    if(ingredient == null) throw new RuntimeException("Unable to find requested ingredient item " + ingredient.toString());
    recipe = new BrewingRecipe(input.getItemStack(), ingredient.getItemStack(), output.getItemStack());
}
项目:Cyclic    文件:RecipeRegistry.java   
/**
 * Currently not used but it does work.
 * 
 * has built in unit test
 * 
 * @param input
 * @param ingredient
 * @param output
 * @return
 */
public static BrewingRecipe addBrewingRecipe(ItemStack input, ItemStack ingredient, ItemStack output) {
  if (input.isEmpty() || input.getItem() == null) {
    return null;
  }
  BrewingRecipe recipe = new BrewingRecipe(
      input,
      ingredient,
      output);
  BrewingRecipeRegistry.addRecipe(recipe);
  if (ModCyclic.logger.runUnitTests()) {//OMG UNIT TESTING WAAT
    ItemStack output0 = BrewingRecipeRegistry.getOutput(input, ingredient);
    if (output0.getItem() == output.getItem())
      ModCyclic.logger.logTestResult("Brewing Recipe succefully registered and working: " + output.getUnlocalizedName());
    else {
      ModCyclic.logger.logTestResult("Brewing Recipe FAILED to register" + output.getUnlocalizedName());
    }
  }
  return recipe;
}
项目:SeasonsAPI    文件:SeasonPotion.java   
private static BrewingRecipe createBrewingRecipe(PotionType in, ItemStack ingredient, PotionType out) {
    return new BrewingRecipe(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), in), ingredient, (PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), out)));
}
项目:SeasonsAPI    文件:SeasonPotion.java   
private static BrewingRecipe createSplashBrewingRecipe(PotionType in, ItemStack ingredient, PotionType out) {
    return new BrewingRecipe(PotionUtils.addPotionToItemStack(new ItemStack(Items.SPLASH_POTION), in), ingredient, (PotionUtils.addPotionToItemStack(new ItemStack(Items.SPLASH_POTION), out)));
}
项目:SeasonsAPI    文件:SeasonPotion.java   
private static BrewingRecipe createLingeringBrewingRecipe(PotionType in, ItemStack ingredient, PotionType out) {
    return new BrewingRecipe(PotionUtils.addPotionToItemStack(new ItemStack(Items.LINGERING_POTION), in), ingredient, (PotionUtils.addPotionToItemStack(new ItemStack(Items.LINGERING_POTION), out)));
}
项目:Cyclic    文件:GuideRegistry.java   
public GuidePage(BrewingRecipe t) {
  brewRecipe = t;
}
项目:Cyclic    文件:GuideRegistry.java   
public void addRecipePage(BrewingRecipe t) {
  if (t == null) {
    return;
  }
  this.pages.add(new GuidePage(t));
}