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

Method canApplyAtEnchantingTable in IForgeItem cannot be used adequately #10181

Closed
Corail31 opened this issue Nov 21, 2024 · 0 comments
Closed

Comments

@Corail31
Copy link

Corail31 commented Nov 21, 2024

Minecraft Version: 1.21.1 -> 1.21.3

Forge Version: 52. to 53+

Description of issue:
The method boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) in ForgeItem can't be used usefully.
It provides an enchantment as parameter instead of an enchantment holder preventing to compare "easily" with an enchantment RK/RL.

Possible Solutions

  • Remove that method
  • Provide an enchantment holder as parameter (used in getAvailableEnchantmentResults() in EnchantmentHelper)

Related Code

public static List<EnchantmentInstance> getAvailableEnchantmentResults(int p_44818_, ItemStack p_44819_, Stream<Holder<Enchantment>> p_342857_) {
        List<EnchantmentInstance> list = Lists.newArrayList();
        boolean flag = p_44819_.is(Items.BOOK);
        p_342857_.filter(p_341799_ -> p_44819_.canApplyAtEnchantingTable(p_341799_.value()) || flag).forEach(p_341708_ -> {

Thanks you for reading me.

@Corail31 Corail31 added the Triage This request requires the active attention of the Triage Team. Requires labelling or reviews. label Nov 21, 2024
@autoforge autoforge bot removed the Triage This request requires the active attention of the Triage Team. Requires labelling or reviews. label Nov 21, 2024
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

No branches or pull requests

1 participant