diff options
Diffstat (limited to 'patches/server/0581-Prevent-AFK-kick-while-watching-end-credits.patch')
-rw-r--r-- | patches/server/0581-Prevent-AFK-kick-while-watching-end-credits.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0581-Prevent-AFK-kick-while-watching-end-credits.patch b/patches/server/0581-Prevent-AFK-kick-while-watching-end-credits.patch new file mode 100644 index 0000000000..92d95bf1df --- /dev/null +++ b/patches/server/0581-Prevent-AFK-kick-while-watching-end-credits.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Noah van der Aa <[email protected]> +Date: Sat, 24 Jul 2021 16:54:11 +0200 +Subject: [PATCH] Prevent AFK kick while watching end credits + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 5ba7340d3860975b826dc878385e0879a9f07957..40d2c7bfc8ba8b8b366f23e53cf37f331e19ccf7 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -397,7 +397,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + --this.dropSpamTickCount; + } + +- if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) { ++ if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits + this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 + this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause + } |