From 408fe7c90d85e9da746043776ec7f683cf8165ef Mon Sep 17 00:00:00 2001 From: Aust1n46 Date: Fri, 30 Jul 2021 22:35:41 -0400 Subject: [PATCH] Don't display JSON hover if it doesn't exist. --- src/main/java/mineverse/Aust1n46/chat/utilities/Format.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/mineverse/Aust1n46/chat/utilities/Format.java b/src/main/java/mineverse/Aust1n46/chat/utilities/Format.java index 1f31093..f841739 100644 --- a/src/main/java/mineverse/Aust1n46/chat/utilities/Format.java +++ b/src/main/java/mineverse/Aust1n46/chat/utilities/Format.java @@ -163,8 +163,10 @@ public class Format { hover += Format.FormatStringAll(st) + "\n"; } } - hover = Format.FormatStringAll( - PlaceholderAPI.setBracketPlaceholders(icp.getPlayer(), hover.substring(0, hover.length() - 1))); + if(!hover.isEmpty()) { + hover = Format.FormatStringAll( + PlaceholderAPI.setBracketPlaceholders(icp.getPlayer(), hover.substring(0, hover.length() - 1))); + } temp += convertToJsonColors(lastCode + placeholder, ",\"clickEvent\":{\"action\":\"" + action + "\",\"value\":\"" + text + "\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":["