Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.21.4] Recipe priority system for solving overlaps in recipe ingredients and patterns. #1855

Open
wants to merge 3 commits into
base: 1.21.x
Choose a base branch
from

Conversation

bconlon1
Copy link
Contributor

Updated version of #1152

This PR implements a system intended to give modders a solution to the problem of needing to implement a recipe with a pattern of ingredients, but it overlaps with a vanilla recipe that has the same pattern but using a tag instead. For example, a modder may be trying to make a Chest for a specific wood type in a custom dimension, but in Vanilla, crafting Chests uses the #planks tag, so all wood types are normally going to give the default Chest block.

Specifically, this PR does the following main things:

  • Adds a new class RecipePrioritiesProvider, which is a data provider that can be extended to generate a map of recipe ResourceLocations to Integer priorities. Vanilla recipes are considered at a baseline of 0, so positive numbered recipes are higher priority and negative numbered recipes are lower priority.
  • Adds RecipePriorityManager, which reads the JSON data.
  • Patches RecipeManager and RecipeMap to use ordered data types that are ordered by taking into account any priority values that are found to match a recipe ID.

2024-06-18_20 56 21
2024-06-18_20 56 32

@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.4 Targeted at Minecraft 1.21.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants