Skip to content

Commit

Permalink
Fixed issued with chat formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed May 16, 2019
1 parent df4e7bd commit 6c67ab2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.tnemc.tnc</groupId>
<artifactId>TheNewChat</artifactId>
<version>0.1.0.0</version>
<version>1.5.0.0</version>
<name>TheNewChat</name>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
5 changes: 3 additions & 2 deletions src/net/tnemc/tnc/core/ChatManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public void onChat(AsyncPlayerChatEvent event) {
if(!permission.equalsIgnoreCase("") && !event.getPlayer().hasPermission(permission)) {
event.setCancelled(true);
}
event.setFormat(formatMessage(event.getPlayer(), recipients, channel, event.getMessage()));
event.setMessage(formatMessage(event.getPlayer(), recipients, channel, event.getMessage()));
event.setFormat("%2$s");
}

public String formatMessage(final Player player, Collection<Player> recipients, final String channel, final String message) {
Expand All @@ -167,7 +168,7 @@ public String formatMessage(final Player player, Collection<Player> recipients,

if(handler.equalsIgnoreCase("") || channel.equalsIgnoreCase("general")) {
String format = parseCoreVariables(player, message, CoreConfigNodes.CORE_GENERAL_CHAT_FORMAT.getString());
if(Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
if(Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI") && PlaceholderAPI.containsPlaceholders(format)) {
format = PlaceholderAPI.setPlaceholders(player, format);
}
if(!generalHandler.equalsIgnoreCase("core") &&
Expand Down
2 changes: 1 addition & 1 deletion src/net/tnemc/tnc/core/TheNewChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class TheNewChat extends JavaPlugin {

private File chatsFile;
private FileConfiguration chatsConfiguration;
private String version = "0.0.1.0";
private String version = "1.5.0.0";

private SaveManager saveManager;

Expand Down

0 comments on commit 6c67ab2

Please sign in to comment.