mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
Prevent AFK kick while watching end credits
This commit is contained in:
@@ -195,8 +195,9 @@
|
|||||||
+ this.tabSpamThrottler.tick(); // Paper - configurable tab spam limits
|
+ this.tabSpamThrottler.tick(); // Paper - configurable tab spam limits
|
||||||
+ this.recipeSpamPackets.tick(); // Paper - auto recipe limit
|
+ this.recipeSpamPackets.tick(); // Paper - auto recipe limit
|
||||||
this.dropSpamThrottler.tick();
|
this.dropSpamThrottler.tick();
|
||||||
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.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"));
|
- this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"));
|
||||||
|
+ 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.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
|
||||||
+ this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
|
+ this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
|
||||||
}
|
}
|
||||||
@@ -317,7 +318,7 @@
|
|||||||
boolean flag1 = entity.verticalCollisionBelow;
|
boolean flag1 = entity.verticalCollisionBelow;
|
||||||
|
|
||||||
if (entity instanceof LivingEntity) {
|
if (entity instanceof LivingEntity) {
|
||||||
@@ -449,19 +594,72 @@
|
@@ -449,20 +594,73 @@
|
||||||
d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||||
boolean flag2 = false;
|
boolean flag2 = false;
|
||||||
|
|
||||||
@@ -336,8 +337,8 @@
|
|||||||
+ this.player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
|
+ this.player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
|
||||||
this.send(ClientboundMoveVehiclePacket.fromEntity(entity));
|
this.send(ClientboundMoveVehiclePacket.fromEntity(entity));
|
||||||
return;
|
return;
|
||||||
+ }
|
}
|
||||||
+
|
|
||||||
+ // CraftBukkit start - fire PlayerMoveEvent
|
+ // CraftBukkit start - fire PlayerMoveEvent
|
||||||
+ Player player = this.getCraftPlayer();
|
+ Player player = this.getCraftPlayer();
|
||||||
+ if (!this.hasMoved) {
|
+ if (!this.hasMoved) {
|
||||||
@@ -386,11 +387,12 @@
|
|||||||
+ this.justTeleported = false;
|
+ this.justTeleported = false;
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
}
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
+
|
||||||
this.player.serverLevel().getChunkSource().move(this.player);
|
this.player.serverLevel().getChunkSource().move(this.player);
|
||||||
entity.recordMovementThroughBlocks(new Vec3(d0, d1, d2), entity.position());
|
entity.recordMovementThroughBlocks(new Vec3(d0, d1, d2), entity.position());
|
||||||
|
Vec3 vec3d = new Vec3(entity.getX() - d0, entity.getY() - d1, entity.getZ() - d2);
|
||||||
@@ -489,16 +687,17 @@
|
@@ -489,16 +687,17 @@
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
if (packet.getId() == this.awaitingTeleport) {
|
if (packet.getId() == this.awaitingTeleport) {
|
||||||
|
Reference in New Issue
Block a user