Skip to content

Commit

Permalink
The displayed itemname in the item info is now the long version of wh…
Browse files Browse the repository at this point in the history
…at should be written on the sign.
  • Loading branch information
Feli499 committed Jan 7, 2024
1 parent b92548e commit f8f87f0
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/main/java/com/Acrobot/ChestShop/Commands/ItemInfo.java
Expand Up @@ -8,7 +8,6 @@
import com.Acrobot.ChestShop.ChestShop;
import com.Acrobot.ChestShop.Configuration.Messages;
import com.Acrobot.ChestShop.Events.ItemInfoEvent;
import com.Acrobot.ChestShop.Utils.ComponentUtils;
import com.Acrobot.ChestShop.Utils.ItemNamingUtils;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.ChatColor;
Expand Down Expand Up @@ -51,20 +50,12 @@ public static void showItemInfo(CommandSender sender, ItemStack item) {
return;
}

TextComponent tc = new TextComponent(" ");
tc.setColor(net.md_5.bungee.api.ChatColor.WHITE);
tc.addExtra(ComponentUtils.getLocalizedItemName(item));

String fullName = ChatColor.stripColor(ItemNamingUtils.getDisplayName(item));
String signItemName = ChatColor.stripColor(ItemNamingUtils.getSignItemName(item));
TextComponent signNames = new TextComponent(" ");
signNames.setColor(net.md_5.bungee.api.ChatColor.DARK_GRAY);
signNames.addExtra(fullName);
if (!fullName.equals(signItemName))
signNames.addExtra(" (" + signItemName + ")");

TextComponent tc = new TextComponent(" ");
tc.setColor(net.md_5.bungee.api.ChatColor.WHITE);
tc.addExtra(fullName);
sender.spigot().sendMessage(tc);
sender.spigot().sendMessage(signNames);

ItemInfoEvent event = new ItemInfoEvent(sender, item);
ChestShop.callEvent(event);
Expand Down

0 comments on commit f8f87f0

Please sign in to comment.