Skip to content

Commit

Permalink
ItemUtils - forgot to check the value before resetting
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneBeee committed Jul 1, 2024
1 parent 6c1ffbf commit 0e647dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/bukkitutil/ItemUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static void setMaxDamage(ItemStack itemStack, int maxDamage) {
ItemMeta meta = itemStack.getItemMeta();
if (HAS_MAX_DAMAGE && meta instanceof Damageable) {
Damageable damageable = (Damageable) meta;
if (HAS_RESET) {
if (HAS_RESET && maxDamage < 1) {
damageable.resetDamage();
} else {
damageable.setMaxDamage(Math.max(1, maxDamage));
Expand Down

0 comments on commit 0e647dd

Please sign in to comment.