Skip to content

Commit

Permalink
Fix ItemTag meta not being set
Browse files Browse the repository at this point in the history
* Resolves issue where votebook can't be clicked

Signed-off-by: applenick <[email protected]>
  • Loading branch information
applenick authored and Electroid committed Apr 29, 2021
1 parent bb55208 commit 13da9b5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import javax.annotation.Nullable;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
Expand Down Expand Up @@ -53,8 +54,11 @@ public String get(ItemStack item) {

@Override
public void set(ItemStack item, String value) {
if (!item.hasItemMeta()) return;
ItemMeta itemMeta = item.getItemMeta();
if (!item.hasItemMeta()) {
// Create missing item meta if none is found
itemMeta = Bukkit.getItemFactory().getItemMeta(item.getType());
}
List<String> lore = itemMeta.getLore();

// If the item has no lore, ensure there is at least 1 line.
Expand Down

0 comments on commit 13da9b5

Please sign in to comment.