Skip to content

Commit

Permalink
Rework getting custom item
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Aug 8, 2024
1 parent 34b785e commit c5d38a4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public AbstractCustomItem(TemplatePaperPlugin plugin, String itemId, Material ma
Bukkit.getPluginManager().registerEvents(this, plugin);
}

public abstract ItemStack getCustomItem(Player player);
protected abstract ItemStack generateCustomItem(ItemStack baseCustomItem, Player player);

protected ItemStack getBaseCustomItem() {
public ItemStack getCustomItem(Player player) {
ItemStack item = new ItemStack(material);
item.editMeta((meta) -> meta.getPersistentDataContainer().set(itemIdKey, PersistentDataType.STRING, itemId));
return item;
return generateCustomItem(item, player);
}

public boolean isItem(ItemStack itemStack) {
Expand Down

0 comments on commit c5d38a4

Please sign in to comment.