From ab5c9e3ea67ba73cd0c2970973de3e1355e74f0f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 28 Jun 2018 20:09:50 +0200 Subject: [PATCH] A F K - chat counts as activity --- src/main/java/buttondevteam/chat/ChatProcessing.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/buttondevteam/chat/ChatProcessing.java b/src/main/java/buttondevteam/chat/ChatProcessing.java index 7a00f2a..59e64a8 100644 --- a/src/main/java/buttondevteam/chat/ChatProcessing.java +++ b/src/main/java/buttondevteam/chat/ChatProcessing.java @@ -15,6 +15,7 @@ import buttondevteam.lib.player.ChromaGamerBase; import buttondevteam.lib.player.TBMCPlayer; import buttondevteam.lib.player.TBMCPlayerBase; import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; import com.google.common.collect.Lists; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -93,9 +94,13 @@ public class ChatProcessing { if (PluginMain.essentials == null) PluginMain.essentials = (Essentials) (Bukkit.getPluginManager().getPlugin("Essentials")); Player player = (sender instanceof Player ? (Player) sender : null); + User user = PluginMain.essentials.getUser(player); - if (player != null && PluginMain.essentials.getUser(player).isMuted()) - return true; + if (player != null) { + user.updateActivity(true); //Could talk in a private channel, so broadcast + if (user.isMuted()) + return true; + } doFunStuff(sender, e, message); -- 2.30.2