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

Prevent damage to Extendo-Grip from Frost Walker #7339

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

Conversation

cassiancc
Copy link

Frost Walker places frosted ice blocks through the EntityPlaceEvent. Currently, the event then damages the Extendo-Grip for every frosted ice block placed by the enchantment, rapidly breaking it. This fix prevents damage to the Extendo-Grip when the block is Frosted Ice and the player's equipment has Frost Walker.

Frost Walker places frosted ice blocks through the EntityPlaceEvent. Currently, the event then damages the Extendo-Grip for every frosted ice block placed by the enchantment, rapidly breaking it. This fix prevents damage to the Extendo-Grip when the block is Frosted Ice and the player's equipment has Frost Walker.
@cassiancc
Copy link
Author

This should fix #5494.

Copy link
Contributor

@VoidLeech VoidLeech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should have the call to findAndDamageExtendoGrip not be in an else block, and just do an early return. As is, this is going to call findAndDamageExtendoGrip if any armor piece has any enchantment that isn’t Frost Walker, and multiple times as well.
Also, there should just be a method in EnchantmentHelper that’ll tell you whether an entity has an enchantment, no need to iterate over armorslots and enchantments. (And if iterating over armorslots was necessary, there’s always Map#containsKey)

Checking to see if the block is Frosted Ice is failing, possibly due to the event happening before the block is placed.
@TropheusJ
Copy link
Collaborator

this will deal no damage when the player is placing blocks in water.

@IThundxr IThundxr added the pr type: fix PR fixes a bug label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr type: fix PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants