Skip to content

Commit

Permalink
Support CustomModelData in kits
Browse files Browse the repository at this point in the history
  • Loading branch information
YanisBft committed Jul 17, 2023
1 parent 6012959 commit fb5bbd2
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ public void addStringMeta(final CommandSource sender, final boolean allowUnsafe,
final ItemMeta meta = stack.getItemMeta();
meta.setLore(lore);
stack.setItemMeta(meta);
} else if ((split[0].equalsIgnoreCase("custom-model-data") || split[0].equalsIgnoreCase("cmd")) && hasMetaPermission(sender, "custom-model-data", false, true, ess)) {
if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_14_R01)) {
final int value = split.length <= 1 ? 0 : Integer.parseInt(split[1]);
final ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(value);
stack.setItemMeta(meta);
}
} else if (split[0].equalsIgnoreCase("unbreakable") && hasMetaPermission(sender, "unbreakable", false, true, ess)) {
final boolean value = split.length <= 1 || Boolean.parseBoolean(split[1]);
setUnbreakable(ess, stack, value);
Expand Down

0 comments on commit fb5bbd2

Please sign in to comment.