Skip to content

[API] Item Filling & Emptying Registries #8177

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

Open
wants to merge 1 commit into
base: mc1.20.1/dev
Choose a base branch
from

Conversation

RaymondBlaze
Copy link
Contributor

Replaced hardcoded internal implementation of GenericItemFilling and GenericItemEmptying with a new api backed by SimpleRegistry.Multi of ItemFilling and ItemEmptying.

  • 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 by EmptyingRecipe.

Both ItemFilling and ItemEmptying 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 the GenericItemFilling's behaviour. That being said, the FillingRecipe 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).

@VoidLeech VoidLeech added area: api Issue or PR is related to API pr type: feature PR adds a new feature or changes an existing feature labels Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Issue or PR is related to API pr type: feature PR adds a new feature or changes an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants