From 5b080fb669993f0c882fe29fc77563c2d2663d51 Mon Sep 17 00:00:00 2001 From: Lilac Date: Sat, 21 Sep 2019 21:59:41 +0100 Subject: [PATCH] Fixed vouchers not working with a white name --- .../epicvouchers/listeners/PlayerInteractListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java index 28d2170..4c0b553 100644 --- a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java +++ b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java @@ -3,6 +3,8 @@ package com.songoda.epicvouchers.listeners; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.menus.ConfirmMenu; import com.songoda.epicvouchers.voucher.Voucher; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -39,7 +41,9 @@ public class PlayerInteractListener implements Listener { else { // material matches - verify the name + lore final ItemMeta meta = item.getItemMeta(); - if (meta == null || !meta.hasDisplayName() || !meta.hasLore() || !meta.getDisplayName().equals(voucher.getName(true)) || !meta.getLore().equals(voucher.getLore(true))) + if (meta == null || !meta.hasDisplayName() || !meta.hasLore() + || !ChatColor.stripColor(meta.getDisplayName()).equals(ChatColor.stripColor(voucher.getName(true))) + || !meta.getLore().equals(voucher.getLore(true))) continue; }