aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0626-Ensure-disconnect-for-book-edit-is-called-on-main.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0626-Ensure-disconnect-for-book-edit-is-called-on-main.patch')
-rw-r--r--patches/server/0626-Ensure-disconnect-for-book-edit-is-called-on-main.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0626-Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/0626-Ensure-disconnect-for-book-edit-is-called-on-main.patch
new file mode 100644
index 0000000000..6d154d7e68
--- /dev/null
+++ b/patches/server/0626-Ensure-disconnect-for-book-edit-is-called-on-main.patch
@@ -0,0 +1,19 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shane Freeder <[email protected]>
+Date: Tue, 22 Jun 2021 19:58:53 +0100
+Subject: [PATCH] Ensure disconnect for book edit is called on main
+
+
+diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+index 7f030cac8b3bc7d2d4b1c32ef5edc360473881f2..a1de622805f31e6de771b62cce94ad78dd8a526f 100644
+--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+@@ -1095,7 +1095,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+ // Paper end
+ // CraftBukkit start
+ if (this.lastBookTick + 20 > MinecraftServer.currentTick) {
+- this.disconnect("Book edited too quickly!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
++ server.scheduleOnMain(() -> this.disconnect("Book edited too quickly!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause // Paper - Also ensure this is called on main
+ return;
+ }
+ this.lastBookTick = MinecraftServer.currentTick;