diff --git a/src/redempt/redlib/itemutils/ItemUtils.java b/src/redempt/redlib/itemutils/ItemUtils.java index 29c4ff2..eda5b40 100644 --- a/src/redempt/redlib/itemutils/ItemUtils.java +++ b/src/redempt/redlib/itemutils/ItemUtils.java @@ -57,13 +57,16 @@ private static ItemStack getBaseSkull() { } /** - * Renames an ItemStack, functionally identical to {@link ItemUtils#setName(ItemStack, String)} but kept for legacy reasons + * Renames an ItemStack, functionally identical to {@link ItemUtils#setName(ItemStack, String)} but kept for legacy reasons. This has no effect on items without meta such as Air * @param item The ItemStack to be renamed * @param name The name to give the ItemStack * @return The renamed ItemStack */ public static ItemStack rename(ItemStack item, String name) { ItemMeta meta = item.getItemMeta(); + if (meta == null) { + return item; + } meta.setDisplayName(name); item.setItemMeta(meta); return item;