From 5fd646df4ae7add79a349a6d75f63eba18556511 Mon Sep 17 00:00:00 2001 From: Kah Date: Sun, 23 Jul 2017 13:26:24 +0200 Subject: [PATCH] Fix problem with spaces after TITLE --- src/main/java/com/arckenver/nations/ConfigHandler.java | 6 +++--- .../nations/cmdexecutor/nation/NationChatExecutor.java | 2 +- .../java/com/arckenver/nations/listener/ChatListener.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/arckenver/nations/ConfigHandler.java b/src/main/java/com/arckenver/nations/ConfigHandler.java index 3c1d290..cd00eeb 100644 --- a/src/main/java/com/arckenver/nations/ConfigHandler.java +++ b/src/main/java/com/arckenver/nations/ConfigHandler.java @@ -78,8 +78,8 @@ public static void load(CommandSource src) Utils.ensureBoolean(config.getNode("others", "enableNationTag"), true); Utils.ensureString(config.getNode("others", "gravestoneBlock"), "gravestone:gravestone"); Utils.ensureBoolean(config.getNode("others", "enableGoldenAxe"), true); - Utils.ensureString(config.getNode("others", "publicChatFormat"), " &r[&3{NATION}&r] &5{TITLE}&r"); - Utils.ensureString(config.getNode("others", "nationChatFormat"), " &r{&e{NATION}&r}"); + Utils.ensureString(config.getNode("others", "publicChatFormat"), " &r[&3{NATION}&r] &5{TITLE} &r"); + Utils.ensureString(config.getNode("others", "nationChatFormat"), " &r{&eNC&r} "); Utils.ensureString(config.getNode("others", "nationSpyChatTag"), " &r[&cSPY&r]"); @@ -87,7 +87,7 @@ public static void load(CommandSource src) Utils.ensureString(config.getNode("toast", "nation"), "&3{NATION}{FORMATPRESIDENT} &7- {FORMATPVP}"); Utils.ensureString(config.getNode("toast", "zone"), "&3{NATION}{FORMATPRESIDENT} &7~ {FORMATZONENAME}{FORMATZONEOWNER}{FORMATZONEPRICE}{FORMATPVP}"); - Utils.ensureString(config.getNode("toast", "formatPresident"), "&7 - &e{TITLE}{NAME}"); + Utils.ensureString(config.getNode("toast", "formatPresident"), "&7 - &e{TITLE} {NAME}"); Utils.ensureString(config.getNode("toast", "formatZoneName"), "&a{ARG} &7-"); Utils.ensureString(config.getNode("toast", "formatZoneOwner"), "&e{ARG} &7-"); Utils.ensureString(config.getNode("toast", "formatZonePrice"), "&e[{ARG}] &7-"); diff --git a/src/main/java/com/arckenver/nations/cmdexecutor/nation/NationChatExecutor.java b/src/main/java/com/arckenver/nations/cmdexecutor/nation/NationChatExecutor.java index 4a1d590..f2bb2e6 100644 --- a/src/main/java/com/arckenver/nations/cmdexecutor/nation/NationChatExecutor.java +++ b/src/main/java/com/arckenver/nations/cmdexecutor/nation/NationChatExecutor.java @@ -47,7 +47,7 @@ public CommandResult execute(CommandSource src, CommandContext ctx) throws Comma { Text header = TextSerializers.FORMATTING_CODE.deserialize(ConfigHandler.getNode("others", "nationChatFormat").getString().replaceAll("\\{NATION\\}", nation.getTag()).replaceAll("\\{TITLE\\}", DataHandler.getCitizenTitle(player.getUniqueId()))); - Text msg = Text.of(header, " ", TextColors.RESET, player.getName(), TextColors.WHITE, ": ", TextColors.YELLOW, ctx.getOne("msg").get()); + Text msg = Text.of(header, TextColors.RESET, player.getName(), TextColors.WHITE, ": ", TextColors.YELLOW, ctx.getOne("msg").get()); channel.send(player, msg); DataHandler.getSpyChannel().send(Text.of(TextSerializers.FORMATTING_CODE.deserialize(ConfigHandler.getNode("others", "nationSpyChatTag").getString()), TextColors.RESET, msg)); } diff --git a/src/main/java/com/arckenver/nations/listener/ChatListener.java b/src/main/java/com/arckenver/nations/listener/ChatListener.java index 416e4db..adcaf73 100644 --- a/src/main/java/com/arckenver/nations/listener/ChatListener.java +++ b/src/main/java/com/arckenver/nations/listener/ChatListener.java @@ -41,7 +41,7 @@ public void onPlayerChat(MessageChannelEvent.Chat e, @First Player p) } else if (chan instanceof NationMessageChannel) { - e.setMessage(TextSerializers.FORMATTING_CODE.deserialize(ConfigHandler.getNode("others", "nationChatFormat").getString().replaceAll("\\{NATION\\}", nation.getTag()).replaceAll("\\{TITLE\\}", DataHandler.getCitizenTitle(p.getUniqueId()))), Text.of(TextColors.YELLOW, e.getMessage())); + e.setMessage(Text.of(TextSerializers.FORMATTING_CODE.deserialize(ConfigHandler.getNode("others", "nationChatFormat").getString().replaceAll("\\{NATION\\}", nation.getTag()).replaceAll("\\{TITLE\\}", DataHandler.getCitizenTitle(p.getUniqueId()))), TextColors.YELLOW, e.getMessage())); DataHandler.getSpyChannel().send(p, Text.of(TextSerializers.FORMATTING_CODE.deserialize(ConfigHandler.getNode("others", "nationSpyChatTag").getString()), TextColors.RESET, e.getMessage())); } }