Skip to content

Commit

Permalink
Fix crash when setting zero experience in BlockDropsEvent (#1090)
Browse files Browse the repository at this point in the history
Closes #1088
  • Loading branch information
Shadows-of-Fire authored and Technici4n committed Jun 11, 2024
1 parent 89b1791 commit f9eb6d9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ public int getDroppedExperience() {
/**
* Set the amount of experience points that will be dropped by the block
*
* @param experience The new amount. Must be a positive value.
* @param experience The new amount. Must not be negative.
* @apiNote When cancelled, no experience is dropped, regardless of this value.
*/
public void setDroppedExperience(int experience) {
Preconditions.checkArgument(experience > 0, "May not set a negative experience drop.");
Preconditions.checkArgument(experience >= 0, "May not set a negative experience drop.");
this.experience = experience;
}
}

0 comments on commit f9eb6d9

Please sign in to comment.