Jump to content

Brewing Recipe accepting any ingredient


eggpasta

Recommended Posts

I have a brewing recipe with the following code but the issue is that it's accepting anything as an ingredient

package mod.trianglesinpoo.mcores;

import javax.annotation.Nonnull;

import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionUtils;
import net.minecraft.potion.Potions;
import net.minecraftforge.common.brewing.IBrewingRecipe;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class brewrecipe implements IBrewingRecipe{
	private static final Logger LOGGER = LogManager.getLogger();
	    private static final ItemStack INGREDIENT = new ItemStack(ItemHolder.CRYOEXTRACT.get());
	    private static final ItemStack OUTPUT = new ItemStack(ItemHolder.CRYOCOCKTAIL.get());


	    @Override
	    public boolean isInput(@Nonnull ItemStack stack) {
	        return PotionUtils.getPotion(stack) == Potions.WATER;
	    }
	    @Override
	    public boolean isIngredient(@Nonnull ItemStack ingredient) {
	        return INGREDIENT.getItem() == ItemHolder.CRYOEXTRACT.get();
	    }

	    @Nonnull
	    @Override
	    public ItemStack getOutput(@Nonnull ItemStack input,@Nonnull ItemStack ingredient) {
	        if (isInput(input) && isIngredient(ingredient)) {
	            return new ItemStack(ItemHolder.CRYOCOCKTAIL.get());
	        }
	        return ItemStack.EMPTY;
	    }
	}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.