Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.List;
Expand All @@ -24,19 +25,17 @@ public static ItemStack create(Material material, Consumer<ItemMeta> metaConsume
return new ItemStackEditor(material).andMetaConsumer(metaConsumer).create();
}

public static ItemStack create(ItemStack item, @Nullable String name, String... lore) {
return new ItemStackEditor(item)
.setDisplayName(name)
.setLore(lore)
.create();
public static ItemStack create(ItemStack item, @Nullable String name, @Nullable String... lore) {
ItemStackEditor editor = new ItemStackEditor(item).setDisplayName(name);
return (lore != null) ? editor.setLore(lore).create() : editor.create();
}

public static ItemStack create(Material material, @Nullable String name, String... lore) {
public static ItemStack create(Material material, @Nullable String name, @Nullable String... lore) {
return create(new ItemStack(material), name, lore);
}

public static ItemStack create(Material type, @Nullable String name, List<String> lore) {
return create(new ItemStack(type), name, lore.toArray(String[]::new));
public static ItemStack create(Material type, @Nullable String name, @Nullable List<String> lore) {
return create(new ItemStack(type), name, (lore != null) ? lore.toArray(String[]::new): null);
}


Expand Down