Search in sources :

Example 1 with KettleBrewRecipe

use of com.witchworks.api.recipe.KettleBrewRecipe in project Witchworks by Um-Mitternacht.

the class KettleRegistry method registerKettleBrewRecipe.

public static KettleBrewRecipe registerKettleBrewRecipe(ItemStack stack, Object... objects) {
    final KettleBrewRecipe recipe = new KettleBrewRecipe(stack, objects);
    KETTLE_BREW_RECIPES.add(recipe);
    return recipe;
}
Also used : KettleBrewRecipe(com.witchworks.api.recipe.KettleBrewRecipe)

Example 2 with KettleBrewRecipe

use of com.witchworks.api.recipe.KettleBrewRecipe in project Witchworks by Um-Mitternacht.

the class TileKettle method potionRecipeLogic.

public void potionRecipeLogic(EntityPlayer player, EnumHand hand, ItemStack stack) {
    List<KettleBrewRecipe> potions = KettleRegistry.getKettleBrewRecipes();
    Optional<KettleBrewRecipe> optional = potions.stream().filter(recipe -> recipe.canTake(stack) && recipe.matches(ingredients)).findAny();
    if (optional.isPresent()) {
        ItemStack potion = optional.get().getResult();
        potion.setCount(1 + getBrewMultiplier(player));
        giveItem(player, hand, stack, potion);
        inv.setFluid(null);
        onLiquidChange();
    }
}
Also used : net.minecraft.util(net.minecraft.util) ItemValidator(com.witchworks.api.recipe.ItemValidator) RitualHolder(com.witchworks.api.ritual.RitualHolder) ParticleF(com.witchworks.client.fx.ParticleF) Item(net.minecraft.item.Item) AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) KettleRegistry(com.witchworks.api.KettleRegistry) KettleItemRecipe(com.witchworks.api.recipe.KettleItemRecipe) FluidRegistry(net.minecraftforge.fluids.FluidRegistry) KettleBrewRecipe(com.witchworks.api.recipe.KettleBrewRecipe) BrewEffect(com.witchworks.api.item.BrewEffect) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) PotionEffect(net.minecraft.potion.PotionEffect) BUCKET_VOLUME(net.minecraftforge.fluids.Fluid.BUCKET_VOLUME) NBTTagList(net.minecraft.nbt.NBTTagList) Map(java.util.Map) Fluid(net.minecraftforge.fluids.Fluid) Nullable(javax.annotation.Nullable) PotionUtils(net.minecraft.potion.PotionUtils) EntityItem(net.minecraft.entity.item.EntityItem) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) BrewModifier(com.witchworks.api.recipe.BrewModifier) Entity(net.minecraft.entity.Entity) SoundEvents(net.minecraft.init.SoundEvents) CapabilityFluidHandler(net.minecraftforge.fluids.capability.CapabilityFluidHandler) Items(net.minecraft.init.Items) java.awt(java.awt) BrewUtils(com.witchworks.common.potions.BrewUtils) List(java.util.List) ModItems(com.witchworks.common.item.ModItems) Material(net.minecraft.block.material.Material) WitchWorks(com.witchworks.common.WitchWorks) EntityPlayer(net.minecraft.entity.player.EntityPlayer) MathHelper(net.minecraft.util.math.MathHelper) IFluidHandlerItem(net.minecraftforge.fluids.capability.IFluidHandlerItem) Optional(java.util.Optional) ItemNullHelper(com.witchworks.api.helper.ItemNullHelper) FluidStack(net.minecraftforge.fluids.FluidStack) PacketHandler(com.witchworks.common.core.net.PacketHandler) KettleBrewRecipe(com.witchworks.api.recipe.KettleBrewRecipe) ItemStack(net.minecraft.item.ItemStack)

Aggregations

KettleBrewRecipe (com.witchworks.api.recipe.KettleBrewRecipe)2 KettleRegistry (com.witchworks.api.KettleRegistry)1 ItemNullHelper (com.witchworks.api.helper.ItemNullHelper)1 BrewEffect (com.witchworks.api.item.BrewEffect)1 BrewModifier (com.witchworks.api.recipe.BrewModifier)1 ItemValidator (com.witchworks.api.recipe.ItemValidator)1 KettleItemRecipe (com.witchworks.api.recipe.KettleItemRecipe)1 RitualHolder (com.witchworks.api.ritual.RitualHolder)1 ParticleF (com.witchworks.client.fx.ParticleF)1 WitchWorks (com.witchworks.common.WitchWorks)1 PacketHandler (com.witchworks.common.core.net.PacketHandler)1 ModItems (com.witchworks.common.item.ModItems)1 BrewUtils (com.witchworks.common.potions.BrewUtils)1 java.awt (java.awt)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Nullable (javax.annotation.Nullable)1 Material (net.minecraft.block.material.Material)1