From 107a60eb2e3758c57a19cce5e1ed1a5863bebacc Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 3 Aug 2017 22:24:56 +0200 Subject: [PATCH] Fixed chat channel MC scores --- src/main/java/buttondevteam/chat/ChatProcessing.java | 3 ++- .../buttondevteam/chat/formatting/ChatFormatterBuilder.java | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/buttondevteam/chat/ChatProcessing.java b/src/main/java/buttondevteam/chat/ChatProcessing.java index a606686..ea35b01 100644 --- a/src/main/java/buttondevteam/chat/ChatProcessing.java +++ b/src/main/java/buttondevteam/chat/ChatProcessing.java @@ -133,7 +133,8 @@ public class ChatProcessing { Objective obj = PluginMain.SB.getObjective(channel.ID); int score = -1; for (Player p : Bukkit.getOnlinePlayers()) - obj.getScore(p.getName()).setScore(score = e.getMCScore(p)); + obj.getScore(p.getName()) + .setScore(p.getUniqueId().equals(player) ? score = e.getMCScore(p) : e.getMCScore(p)); PluginMain.Instance.getServer().dispatchCommand(PluginMain.Console, String.format( "tellraw @a[score_%s=%d,score_%s_min=%d] %s", channel.ID, score, channel.ID, score, jsonstr)); } else diff --git a/src/main/java/buttondevteam/chat/formatting/ChatFormatterBuilder.java b/src/main/java/buttondevteam/chat/formatting/ChatFormatterBuilder.java index d7a7726..4772180 100644 --- a/src/main/java/buttondevteam/chat/formatting/ChatFormatterBuilder.java +++ b/src/main/java/buttondevteam/chat/formatting/ChatFormatterBuilder.java @@ -1,9 +1,5 @@ package buttondevteam.chat.formatting; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.function.BiFunction; import java.util.regex.Pattern;