Skip to content

Fix item enchant not being actually applied to the items in the challenge menu#73

Merged
minoneer merged 1 commit into
uskyblock:masterfrom
marcbal:fix-challenge-enchant
Jan 28, 2025
Merged

Fix item enchant not being actually applied to the items in the challenge menu#73
minoneer merged 1 commit into
uskyblock:masterfrom
marcbal:fix-challenge-enchant

Conversation

@marcbal

@marcbal marcbal commented Jan 28, 2025

Copy link
Copy Markdown
Contributor

Completed challenges are usually shown with an enchant glowing effect when they are completed at least once. This may be useful for the player, but the "enchanted" status of the item is also used in the ChallengeLogic to determine if a challenge with offset: -1 is displayed or not, in place of the completed one.

New MC version, with the new data component system, does not allow an enchant level of 0 (even with unsafe enchant level), an is silently ignored (see decompiled source from Paper: net.minecraft.world.item.enchantment.ItemEnchantments.Mutable#set ).

This commit changes the enchant level to 1, and adds a flag to the item meta to hide the enchant information from the tooltip.

…challenge menu

Completed challenges are usually shown with an enchant glowing effect when they are completed at least once. This may be useful for the player, but the "enchanted" status of the item is also used in the ChallengeLogic to determine if a challenge with `offset: -1` is displayed or not, in place of the completed one.

New MC version, with the new data component system, does not allow an enchant level of 0 (even with unsafe enchant level), an is silently ignored.

This commit changes the enchant level to 1, and adds a flag to the item meta to hide the enchant information from the tooltip.
@minoneer

minoneer commented Jan 28, 2025

Copy link
Copy Markdown
Member

That's a good catch; thanks! I had noticed the offset was not working, but I did not connect it to that. We should probably make that more robust, but it'll work for now. Thanks!

@minoneer minoneer merged commit 5bed2ba into uskyblock:master Jan 28, 2025
@marcbal marcbal deleted the fix-challenge-enchant branch February 5, 2025 21:58
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