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

Support brewing recipes in tags #2423

Merged
merged 8 commits into from Jan 2, 2023

Conversation

tal5
Copy link
Member

@tal5 tal5 commented Jan 2, 2023

Additions

  • BrewingRecipe class - a temporary class to hold an input, ingredient, and result of a brewing recipe. Can be replaced by Paper's one once Spigot support is dropped.
  • ItemHelper#getCustomBrewingRecipes - returns a Map of keys to brewing recipes.
  • ItemHelper#getCustomBrewingRecipeIDs - returns a Set of all brewing recipe keys.
  • ItemHelper#getCustomBrewingRecipe - returns a brewing recipe by ID.
  • ItemHelperImpl#getNMSCustomBrewingRecipes - returns the internal custom brewing recipe map
  • ItemHelperImpl#paperMixToRecipe - converts paper's PaperPotionMix into a BrewingRecipe.

Changes

  • ItemTag.recipe_ids, server.recipe_ids, server.recipe_items, server.recipe_type, and server.recipe_result now support custom brewing recipes on Paper servers.
  • Updated some code to modern java.
  • Cleaned up imports.

Notes

  • The code is slightly messy currently because we can't access Paper's object directly, but I tried setting it up in a way that would make it easy to clean up later once we go Paper-Only.
  • The reason for the separate methods is to avoid going over the entire map converting to BrewingRecipe's with reflection for simple things such as getting the IDs. We could maybe remove them once we go Paper-only and that code is cleaned up - Let me know if these methods should be merged already.

@tal5 tal5 changed the title Brewing recipes in tags Support brewing recipes in tags Jan 2, 2023
@mcmonkey4eva mcmonkey4eva merged commit 1349bf6 into DenizenScript:dev Jan 2, 2023
@tal5 tal5 deleted the Brewing_Recipes_In_Tags branch January 2, 2023 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants