Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlitzOffline committed Jul 11, 2024
1 parent 04baa81 commit 5d651c3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.stream.Collectors;

import com.google.common.base.Enums;
import com.google.common.primitives.Ints;
import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.Material;
Expand Down Expand Up @@ -1543,7 +1544,7 @@ public void addDamageOptionToBuilder(FileConfiguration c, String currentPath, St
DeluxeMenus.debug(
DebugLevel.HIGHEST,
Level.WARNING,
"Found 'data' and 'damage' option for item: " + itemKey + " in menu: " + menuName +
"Found 'data' and 'damage' options for item: " + itemKey + " in menu: " + menuName +
". 'data' option is deprecated and will be ignored. Using 'damage' instead."
);
}
Expand All @@ -1557,7 +1558,7 @@ public void addDamageOptionToBuilder(FileConfiguration c, String currentPath, St
key = "damage";
}

if (!ItemUtils.isPlaceholderOption(damageValue)) {
if (!ItemUtils.isPlaceholderOption(damageValue) && Ints.tryParse(damageValue) == null) {
DeluxeMenus.debug(
DebugLevel.HIGHEST,
Level.WARNING,
Expand All @@ -1572,7 +1573,7 @@ public void addDamageOptionToBuilder(FileConfiguration c, String currentPath, St
}

final String[] parts = damageValue.split("-", 2);
if (parts.length < 2 || !containsPlaceholders(parts[1])) {
if (parts.length >= 2 && !containsPlaceholders(parts[1])) {
DeluxeMenus.debug(
DebugLevel.HIGHEST,
Level.WARNING,
Expand All @@ -1583,6 +1584,6 @@ public void addDamageOptionToBuilder(FileConfiguration c, String currentPath, St
return;
}

builder.damage(parts[1]);
builder.damage(parts.length == 1 ? parts[0] : parts[1]);
}
}

0 comments on commit 5d651c3

Please sign in to comment.