Jump to content

Vanilla Crafting Recipes and Toasts [1.15.2]


Recommended Posts

My goal is to both 1) remove vanilla crafting recipes from the game and 2) to remove the toasts that notify the player when they've unlocked a new recipe.


1) I have seen old posts from 1.12 (and the following code from Extra-Additions) about overriding vanilla recipes with


 ForgeRegistry<IRecipe> recipeRegistry = (ForgeRegistry<IRecipe>)ForgeRegistries.RECIPES; 


However, ForgeRegistries.RECIPES seems to have become ForgeRegistries.RECIPE_SERIALIZERS. Using recipeRegistry.getValues() I can get an collection of IRecipeSerializers, but how do I go from IRecipeSerializers to an IRecipe? What's the new way to remove vanilla crafting recipes? I've come across the RecipesUpdatedEvent but this doesn't seem to be preventative of player crafting as it is merely the server telling the player what recipe's it's unlocked.


2) A method (that I think is old?) from Quark of removing toasts was to access Minecraft.getInstance().getToastGui().toastsQueue. However, in 1.15.2 Forge, toastsQueue is a private variable. If I want to remove crafting/smelting/etc. recipe toasts, how do I do this? While there is the ToastGUI#clear method, this isn't helpful as it clears the whole toast, including achievements. I considered using ToastGui#getToasts then clearing and adding back only the toasts I care to keep, but I can't seem to use getToasts correctly, as it crashes the game or turns up empty.


I've generally been trying to replicate the results of the Quark class linked above, but it locks crafting from unlocked recipes instead of removing them, and it doesn't seem to block the event of a new recipe being unlocked. Any help appreciated, if anyone has been able to accomplish this in 1.15.2


Edit: *Formatted for readability*

Edited by izofar
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.

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.


  • Create New...

Important Information

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