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

Change Enchantment API for data-driven enchantments #3761

Merged
merged 2 commits into from
May 10, 2024

Conversation

Syst3ms
Copy link
Contributor

@Syst3ms Syst3ms commented May 9, 2024

The current implementation actually diverges from vanilla and replaces all isPrimaryItem calls with isAcceptableItem by default, so in theory one could enchant an axe with sharpness inside an enchanting table, which is definitely a bug.

This PR fixes that, and now that vanilla clearly delineates "acceptable" and "primary" checks, EnchantingContext was (breakingly) reworked. Given how recent the enchantment API is and how much the datafication of enchantments will break enchantment code anyway, I don't think the breakage is a very big deal.

Testmod is still very very broken, we might need a DRM argument or something in some places. No DRM needed, as the recommended design is now to work with enchantment tags rather than specific ones inside code.

breaking: complete overhaul of EnchantingContext
@modmuss50 modmuss50 merged commit ad0af49 into FabricMC:1.21 May 10, 2024
4 checks passed
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.

2 participants