mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 00:10:32 +01:00
89d51d5f29
Because this exploit has been widely known for years and has not been fixed by Mojang, we decided that it was worth allowing people to toggle it on/off due to how easy it is to make it configurable. It should be noted that this decision does not promise all future exploits will be configurable.
19 lines
1.2 KiB
Diff
19 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
Date: Thu, 30 Mar 2023 03:13:58 +0100
|
|
Subject: [PATCH] Treat sequence violations like they should be
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
index a1196f79968c950fd9d92123bb4018f8d29c3a82..c9dab47fe3db73b31b40e071d37f1be63401c19d 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
@@ -1964,6 +1964,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
|
|
public void ackBlockChangesUpTo(int sequence) {
|
|
if (sequence < 0) {
|
|
+ this.disconnect("Expected packet sequence nr >= 0", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - Treat sequence violations like they should be
|
|
throw new IllegalArgumentException("Expected packet sequence nr >= 0");
|
|
} else {
|
|
this.ackBlockChangesUpTo = Math.max(sequence, this.ackBlockChangesUpTo);
|