diff --git a/patches/server/0072-Improve-Purpur-AFK-system.patch b/patches/server/0072-Improve-Purpur-AFK-system.patch index a6a433654..4ed61a31d 100644 --- a/patches/server/0072-Improve-Purpur-AFK-system.patch +++ b/patches/server/0072-Improve-Purpur-AFK-system.patch @@ -56,19 +56,19 @@ index 9950580f3d0387b142576bfdb6a8f74365c12878..4270b24734affdeff0cd49ab494b7fad } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 42885c7f374f619fe63d9fe22a4b7f88d68008c3..a3285a1981a45d19b7b751a3b87e9de4dfb3e47d 100644 +index 42885c7f374f619fe63d9fe22a4b7f88d68008c3..66dfd4fc717a47ec2583f51500f4e923403a93d8 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2264,8 +2264,26 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2264,8 +2264,32 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } -+ private final Map cooldown = new java.util.concurrent.ConcurrentHashMap<>(); // Purpur ++ private Map cooldown = new java.util.concurrent.ConcurrentHashMap<>(); // Purpur + @Override public void handleChatCommand(ServerboundChatCommandPacket packet) { + // Purpur start -+ if (packet.command().equals("afk")) { ++ if (this.server.getPlayerIdleTimeout() > 0 && packet.command().equals("afk")) { + player.commandAfkStatus = player.isAfk(); + player.isCommandAfk = true; + if (org.purpurmc.purpur.PurpurConfig.afkCommandCooldown > 0) { @@ -80,6 +80,12 @@ index 42885c7f374f619fe63d9fe22a4b7f88d68008c3..a3285a1981a45d19b7b751a3b87e9de4 + } else { + cooldown.put(player, currentTime); + } ++ // Dreeam - is this necessary? ++ /* ++ if (cooldown.size() > 200) { ++ cooldown = new java.util.concurrent.ConcurrentHashMap<>(); ++ } ++ */ + } + } + // Purpur end