Skip to content

Fix issue 97#98

Open
m1919810 wants to merge 1 commit into
SlimefunGuguProject:masterfrom
m1919810:fix/issue97
Open

Fix issue 97#98
m1919810 wants to merge 1 commit into
SlimefunGuguProject:masterfrom
m1919810:fix/issue97

Conversation

@m1919810

Copy link
Copy Markdown

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
Copy Markdown
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()) {

Copilot AI left a comment

Copy link
Copy Markdown

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.

3 participants