diff --git a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/bridge/protocollib/current/ProtocolLibHookImpl.java b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/bridge/protocollib/current/ProtocolLibHookImpl.java index bfc282b7..dfe5cc38 100644 --- a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/bridge/protocollib/current/ProtocolLibHookImpl.java +++ b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/bridge/protocollib/current/ProtocolLibHookImpl.java @@ -143,7 +143,7 @@ public class ProtocolLibHookImpl implements ProtocolLibHook { return; } - if (!hologramLine.hasRelativePlaceholders()) { + if (!hologramLine.getParent().isAllowPlaceholders() || !hologramLine.hasRelativePlaceholders()) { return; } @@ -182,7 +182,7 @@ public class ProtocolLibHookImpl implements ProtocolLibHook { return; } - if (!hologramLine.hasRelativePlaceholders()) { + if (!hologramLine.getParent().isAllowPlaceholders() || !hologramLine.hasRelativePlaceholders()) { return; } diff --git a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/commands/main/subs/EditCommand.java b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/commands/main/subs/EditCommand.java index c8922638..56e014c7 100644 --- a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/commands/main/subs/EditCommand.java +++ b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/commands/main/subs/EditCommand.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.HoverEvent; import net.md_5.bungee.api.chat.TextComponent; +import net.md_5.bungee.api.chat.ComponentBuilder.FormatRetention; public class EditCommand extends HologramSubCommand { @@ -93,6 +94,19 @@ public class EditCommand extends HologramSubCommand { HelpCommand.sendHoverTip((Player) sender); } } + + public static void sendQuickEditCommands(Player player, String hologramName) { + player.spigot().sendMessage(new ComponentBuilder("[Quick Edit]").color(ChatColor.YELLOW).bold(true) + .append(" ", FormatRetention.NONE) + .append("[Add Line]").event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/")) + .append("hover").color(ChatColor.WHITE).italic(true).underlined(true) + .event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(ChatColor.LIGHT_PURPLE + "Hover on the commands to get info about them."))) + .append(" or ", FormatRetention.NONE).color(ChatColor.GRAY) + .append("click").color(ChatColor.WHITE).italic(true).underlined(true) + .event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(ChatColor.LIGHT_PURPLE + "Click on the commands to insert them in the chat."))) + .append(" on the commands!", FormatRetention.NONE).color(ChatColor.GRAY) + .create()); + } @Override public List getTutorial() { diff --git a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/object/CraftHologram.java b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/object/CraftHologram.java index 66459a2c..1089bf74 100644 --- a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/object/CraftHologram.java +++ b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/object/CraftHologram.java @@ -234,21 +234,9 @@ public class CraftHologram implements Hologram, com.gmail.filoghost.holograms.ap if (this.allowPlaceholders == allowPlaceholders) { return; } - - for (CraftHologramLine line : lines) { - if (line instanceof CraftTextLine) { - CraftTextLine textLine = (CraftTextLine) line; - if (allowPlaceholders) { - // Now allowed, previously weren't - PlaceholdersManager.trackIfNecessary(textLine); - } else { - // Now not allowed - PlaceholdersManager.untrack(textLine); - } - } - } - + this.allowPlaceholders = allowPlaceholders; + refreshAll(); }