Search in sources :

Example 1 with KettleItemRecipe

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

the class TileKettle method itemRitualLogic.

@SuppressWarnings("unchecked")
public void itemRitualLogic() {
    Optional<KettleItemRecipe> optional = KettleRegistry.getKettleItemRituals().stream().filter(i -> i.matches(ingredients)).findAny();
    if (optional.isPresent()) {
        KettleItemRecipe recipe = optional.get();
        setRitual(new RitualHolder<>(recipe.getRitual()));
        if (ritual.canPerform(this, world, getPos())) {
            setMode(Mode.RITUAL);
            markDirty();
        } else {
            failHorribly();
        }
    }
}
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) KettleItemRecipe(com.witchworks.api.recipe.KettleItemRecipe)

Example 2 with KettleItemRecipe

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

the class KettleRegistry method registerKettleItemRitual.

public static KettleItemRecipe registerKettleItemRitual(ItemRitual ritual, Object... objects) {
    final KettleItemRecipe recipe = new KettleItemRecipe(ritual, objects);
    KETTLE_ITEM_RITUALS.add(recipe);
    if (!RITUALS.contains(ritual))
        RITUALS.add(ritual);
    return recipe;
}
Also used : KettleItemRecipe(com.witchworks.api.recipe.KettleItemRecipe)

Aggregations

KettleItemRecipe (com.witchworks.api.recipe.KettleItemRecipe)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 KettleBrewRecipe (com.witchworks.api.recipe.KettleBrewRecipe)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