2021-08-02 10:43:56 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Noah van der Aa <ndvdaa@gmail.com>
Date: Sat, 24 Jul 2021 16:54:11 +0200
2024-01-19 13:22:30 +01:00
Subject: [PATCH] Prevent AFK kick while watching end credits
2021-08-02 10:43:56 +02:00
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
2024-10-23 20:50:46 +02:00
index e9e5b35cd09fe50ce4f2116ca5c38137408105bf..74b21852d9346708a62033c78fac04050b98c80b 100644
2021-08-02 10:43:56 +02:00
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
2024-10-23 20:50:46 +02:00
@@ -394,7 +394,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.tabSpamThrottler.tick(); // Paper - configurable tab spam limits
this.recipeSpamPackets.tick(); // Paper - auto recipe limit
this.dropSpamThrottler.tick();
2023-06-08 04:04:01 +02:00
- if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) {
2024-01-19 13:22:30 +01:00
+ 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
2021-08-02 10:43:56 +02:00
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
2024-06-14 01:32:45 +02:00
this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
2021-08-02 10:43:56 +02:00
}