Jump to content

[1.12.2] Getting brewing recipe to only target certain potion types? [SOLVED]


Recommended Posts

Posted (edited)

I've now got my Ender Pearls brewing away quite happily! It's actually the step before it that isn't so happy. Basically, it should go Water Bottle > Thick Potion > Ender Slime, but when I'm brewing the Ender Slime, it also overwrites all of the other potions in the brewing stand!

 

For reference, I'm writing my own IBrewingRecipe handler (and it has to be a single class, because adding more than one recipe apparently doesn't work on the Forge version I'm on, which is 1.12.2-14.23.5.2768) I've gone back to the IBrewingRecipe and I'm hoping for the best, and I've tried checking against Item and PotionType.

 

Admittedly, I know very little about potions, so I'm kind of out of my depth here. How does one compare potions?

 

EDIT: Changing back to the separate IBrewingRecipes actually completely broke whatever recipe I decide to register second. Not sure what's happening there. Nothing in the logs about it.

Edited by mirk
Posted
3 hours ago, deerangle said:

Try implementing and registering net.minecraftforge.common.brewing.BrewingRecipe instead. It supports input, ingredient and output as item stacks. 

Well, that helped fix the second recipe that I was registering, so thank you! However, I still get the bug where Thick Potion > Ender Slime changes all other potion types in the brewing stand, for some reason. I just can't figure it out.

 

How does vanilla Minecraft compare potions?

  • 2 weeks later...
Posted

Just a quick bump. Been sick for a while, so was away from the forums. Sorry about that.

 

So I've implemented net.minecraftforge.common.brewing.BrewingRecipe instead of IBrewingRecipe, and it's having the same behaviour, where it replaces all potions in the brewing stand, regardless of what they are. Is there a way to stop this?

 

The code for the custom recipe is very simple, as below.

 

Spoiler

public class BrewingEnderSlime extends net.minecraftforge.common.brewing.BrewingRecipe
{
    public BrewingEnderSlime()
    {
        super(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.THICK), new ItemStack(Blocks.PUMPKIN), new ItemStack(ModItems.ENDER_SLIME));
    }
}

 

 

Posted

I have potion recipes working quite well...my code correctly targets any thick potion (normal thick, splash thick, lingering thick) and outputs the correct result; you could even put one of each of these in the slots and get a normal, splash, and lingering of whatever your output is.  It also correctly does *not* work with any non-thick potion.

 

Btw, we both seem to have had the same idea, using thick potions as a base

 

Code is here:
https://github.com/Laike-Endaril/Dynamic-Stealth/tree/1.12.2/src/main/java/com/fantasticsource/dynamicstealth/common/potions/recipes

 

  • Thanks 1
Posted
16 hours ago, Laike_Endaril said:

I have potion recipes working quite well...my code correctly targets any thick potion (normal thick, splash thick, lingering thick) and outputs the correct result; you could even put one of each of these in the slots and get a normal, splash, and lingering of whatever your output is.  It also correctly does *not* work with any non-thick potion.

 

Btw, we both seem to have had the same idea, using thick potions as a base

 

Code is here:
https://github.com/Laike-Endaril/Dynamic-Stealth/tree/1.12.2/src/main/java/com/fantasticsource/dynamicstealth/common/potions/recipes

 

Thanks for this! That worked perfectly.

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.