[API] Item Filling & Emptying Registries #8177
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaced hardcoded internal implementation of
GenericItemFilling
andGenericItemEmptying
with a new api backed bySimpleRegistry.Multi
ofItemFilling
andItemEmptying
.ItemFilling
: Designed to be used for container-like items (e.g. Glass Bottle), where the filling behaviour is not restricted to Spout filling (e.g. Fluid Tank in Creative Mode).ItemEmptying
: Designed to be used for fluid containers that needs special handling (e.g. Potions). Normal fluid containers like Honey Bottle should still be backed byEmptyingRecipe
.Both
ItemFilling
andItemEmptying
includes api method for providing their recipe representation to show in JEI.Builtin defaults currently includes Potions (automatically includes water bottle), Honey Bottle, Builder's Tea, Milk Bottle (from Farmer's Delight and Neapolitan), Lava Bottle (from Alex's Mobs), the corresponding filling recipe is therefore removed.
Considering these builtin defaults no longer recipe-backed, and conflicting filling result could exist, the simple
ItemFilling
cases should be backed by DataMap in 1.21.1 to provide data-driven control on which filling result should be selected as canon.For 1.20.1, a weaker solution for determine filling result that only applies to the Spout filling would be making a matching
FillingRecipe
so it supersedes theGenericItemFilling
's behaviour. That being said, theFillingRecipe
should cover most survival usecase since filling from Fluid Tank is a creative-only behaviour (still, addons could make items like Fluid Hatch to provide such ability in survival).