From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: montlikadani <montlikada@gmail.com>
Date: Thu, 12 Nov 2020 11:02:50 +0100
Subject: [PATCH] Add tablist suffix option for afk


diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index dbc7ca05503dd3de6d4ffe50433d9f2284016191..6071e5f141c04813d0f8af07d82d80bec7f0c194 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1991,7 +1991,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
         }
 
         if (world.purpurConfig.idleTimeoutUpdateTabList) {
-            getBukkitEntity().setPlayerListName((setAfk ? net.pl3x.purpur.PurpurConfig.afkTabListPrefix : "") + getName());
+            if (setAfk) {
+                getBukkitEntity().setPlayerListName(net.pl3x.purpur.PurpurConfig.afkTabListPrefix + getName() + net.pl3x.purpur.PurpurConfig.afkTabListSuffix);
+            } else {
+                getBukkitEntity().setPlayerListName(getName());
+            }
         }
 
         ((WorldServer) world).everyoneSleeping();
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index a20d7ac486a915fae2c6c7d42aa07d44f42438db..767715963a79b06c8a0988b65bc589dc9c351138 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -135,12 +135,14 @@ public class PurpurConfig {
     public static String afkBroadcastAway = "§e§o%s is now AFK";
     public static String afkBroadcastBack = "§e§o%s is no longer AFK";
     public static String afkTabListPrefix = "[AFK] ";
+    public static String afkTabListSuffix = "";
     public static String pingCommandOutput = "§a%s's ping is %sms";
     public static String cannotRideMob = "§cYou cannot mount that mob";
     private static void messages() {
         afkBroadcastAway = getString("settings.messages.afk-broadcast-away", afkBroadcastAway);
         afkBroadcastBack = getString("settings.messages.afk-broadcast-back", afkBroadcastBack);
         afkTabListPrefix = getString("settings.messages.afk-tab-list-prefix", afkTabListPrefix);
+        afkTabListSuffix = getString("settings.messages.afk-tab-list-suffix", afkTabListSuffix);
         pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
         cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
     }
