Skip to content

Conversation

@m1919810
Copy link

No description provided.

@m1919810 m1919810 requested a review from a team as a code owner November 11, 2025 06:19
damageable.setDamage(damageable.getDamage() + event.getDamage());
damagedItem.setItemMeta(im);
// fix issue 97: only when the event is not cancelled should we check durability and set damage
if(!event.isCancelled()){
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(!event.isCancelled()){
if (!event.isCancelled()) {

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes issue 97 by preventing durability modifications from being processed when an item damage event has already been cancelled.

  • Wraps durability modification logic in a check for !event.isCancelled() to avoid unnecessary processing
  • Ensures that when traits or modifiers cancel damage events, the durability system respects that decision

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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