Skip to content

Commit

Permalink
Added jellyfish and leech as potion ingredients. Closes #20
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed May 4, 2018
1 parent 69a481c commit 47e2841
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void preInit(FMLPreInitializationEvent event) {
public void load(FMLInitializationEvent event) {

AquacultureRecipes.addSmeltingRecipes();
AquacultureRecipes.addBrewingRecipes();

AquacultureEnchants.init();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

import com.teammetallurgy.aquaculture.items.AquacultureItems;
import net.minecraft.init.Items;
import net.minecraft.init.PotionTypes;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionType;
import net.minecraft.potion.PotionUtils;
import net.minecraft.util.NonNullList;
import net.minecraftforge.common.brewing.BrewingRecipeRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
Expand All @@ -19,6 +24,25 @@ public static void addSmeltingRecipes() {
GameRegistry.addSmelting(AquacultureItems.tinCan.getItemStack(), OreDictionary.doesOreNameExist("nuggetTin") ? new ItemStack(getOreDict("nuggetTin").getItem(), 7, getOreDict("nuggetTin").getItemDamage()) : new ItemStack(Items.IRON_NUGGET, 7), 0.7F);
}

public static void addBrewingRecipes() {
addFishBrewingRecipe(Items.POTIONITEM, PotionTypes.WATER, "Jellyfish", Items.POTIONITEM, PotionTypes.MUNDANE);
addFishBrewingRecipe(Items.POTIONITEM, PotionTypes.AWKWARD, "Jellyfish", Items.POTIONITEM, PotionTypes.POISON);
addFishBrewingRecipe(Items.SPLASH_POTION, PotionTypes.AWKWARD, "Jellyfish", Items.SPLASH_POTION, PotionTypes.POISON);
addFishBrewingRecipe(Items.SPLASH_POTION, PotionTypes.WATER, "Jellyfish", Items.SPLASH_POTION, PotionTypes.MUNDANE);
addFishBrewingRecipe(Items.LINGERING_POTION, PotionTypes.WATER, "Jellyfish", Items.LINGERING_POTION, PotionTypes.MUNDANE);
addFishBrewingRecipe(Items.LINGERING_POTION, PotionTypes.AWKWARD, "Jellyfish", Items.LINGERING_POTION, PotionTypes.POISON);
addFishBrewingRecipe(Items.POTIONITEM, PotionTypes.WATER, "Leech", Items.POTIONITEM, PotionTypes.MUNDANE);
addFishBrewingRecipe(Items.POTIONITEM, PotionTypes.AWKWARD, "Leech", Items.POTIONITEM, PotionTypes.HEALING);
addFishBrewingRecipe(Items.SPLASH_POTION, PotionTypes.AWKWARD, "Leech", Items.SPLASH_POTION, PotionTypes.HEALING);
addFishBrewingRecipe(Items.SPLASH_POTION, PotionTypes.WATER, "Leech", Items.SPLASH_POTION, PotionTypes.MUNDANE);
addFishBrewingRecipe(Items.LINGERING_POTION, PotionTypes.WATER, "Leech", Items.LINGERING_POTION, PotionTypes.MUNDANE);
addFishBrewingRecipe(Items.LINGERING_POTION, PotionTypes.AWKWARD, "Leech", Items.LINGERING_POTION, PotionTypes.HEALING);
}

private static void addFishBrewingRecipe(Item input, PotionType potionInput, String fishType, Item potionItem, PotionType potionType) {
BrewingRecipeRegistry.addRecipe(PotionUtils.addPotionToItemStack(new ItemStack(input), potionInput), AquacultureItems.fish.getItemStackFish(fishType), PotionUtils.addPotionToItemStack(new ItemStack(potionItem), potionType));
}

private static ItemStack getOreDict(String oreName) {
NonNullList<ItemStack> oreStacks = OreDictionary.getOres(oreName);
if (!oreStacks.isEmpty()) {
Expand Down

0 comments on commit 47e2841

Please sign in to comment.