mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-02 14:38:57 +00:00
Upto date
This commit is contained in:
1 parent
0e26cfd80f
commit
1980cfe14b
2 files changed
+4
-4
No files matched your search
@@ -179,7 +179,7 @@ public class TownyChatFormatter {
|
||||
|
||||
public static String getChatFormat(TownyChatEvent event) {
|
||||
// Replace the {msg} here so it's not regex parsed.
|
||||
return replacer.replaceAll(event.getFormat(), event).replace("{msg}", event.getMessage());
|
||||
return replacer.replaceAll(event.getFormat(), event).replace("{msg}", "%2$s");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -116,7 +116,7 @@ public class TownyPlayerHighestListener extends PlayerListener {
|
||||
TownyChatEvent chatEvent = new TownyChatEvent(event, resident);
|
||||
event.setFormat(TownyChatFormatter.getChatFormat(chatEvent));
|
||||
|
||||
TownyMessaging.sendTownMessage(town, chatEvent.getFormat());
|
||||
TownyMessaging.sendTownMessage(town, chatEvent.getFormat().replace("%2$s", event.getMessage()));
|
||||
} catch (NotRegisteredException x) {
|
||||
TownyMessaging.sendErrorMsg(player, x.getError());
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class TownyPlayerHighestListener extends PlayerListener {
|
||||
|
||||
TownyChatEvent chatEvent = new TownyChatEvent(event, resident);
|
||||
event.setFormat(TownyChatFormatter.getChatFormat(chatEvent));
|
||||
TownyMessaging.sendNationMessage(nation, chatEvent.getFormat());
|
||||
TownyMessaging.sendNationMessage(nation, chatEvent.getFormat().replace("%2$s", event.getMessage()));
|
||||
} catch (NotRegisteredException x) {
|
||||
TownyMessaging.sendErrorMsg(player, x.getError());
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class TownyPlayerHighestListener extends PlayerListener {
|
||||
|
||||
for (Player test : plugin.getTownyUniverse().getOnlinePlayers()) {
|
||||
if (!plugin.isPermissions() || (plugin.isPermissions() && TownyUniverse.getPermissionSource().hasPermission(test, TownySettings.getChatChannelPermission(command))))
|
||||
TownyMessaging.sendMessage(test, chatEvent.getFormat());
|
||||
TownyMessaging.sendMessage(test, chatEvent.getFormat().replace("%2$s", event.getMessage()));
|
||||
}
|
||||
|
||||
// TownyMessaging.sendNationMessage(nation, chatEvent.getFormat());
|
||||
|
||||
Reference in new issue
Block a user