aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0946-Treat-sequence-violations-like-they-should-be.patch
blob: 16cb47268c963ea5f0598f676b30869888890b85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 c0bb5da1426257e8726583c20abc173755b842a3..cc71cfed227b1e233473e8accc501647aad56b31 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2127,6 +2127,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
 
     public void ackBlockChangesUpTo(int sequence) {
         if (sequence < 0) {
+            this.disconnect("Expected packet sequence nr >= 0", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper
             throw new IllegalArgumentException("Expected packet sequence nr >= 0");
         } else {
             this.ackBlockChangesUpTo = Math.max(sequence, this.ackBlockChangesUpTo);