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)))); }
@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()); }
/** * 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; }
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))); }
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))); }
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))); }
public GuidePage(BrewingRecipe t) { brewRecipe = t; }
public void addRecipePage(BrewingRecipe t) { if (t == null) { return; } this.pages.add(new GuidePage(t)); }