From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Noah van der Aa 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 eabdaf85e904224f936154d415d183ba65e4dbbf..43e9f9ce338bd1cf803ad707d318cd2435231426 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -388,7 +388,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 }