aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0570-Ensure-disconnect-for-book-edit-is-called-on-main.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-05-29 13:58:57 -0700
committerGitHub <[email protected]>2024-05-29 22:58:57 +0200
commita31dc90741ed9c121a13a3c124c9ebf5bafd0da7 (patch)
tree81963bd94fe7772ee08bd21710230de21b6b25da /patches/server/0570-Ensure-disconnect-for-book-edit-is-called-on-main.patch
parented85aac53cfd93d29fa24e6071dbdddd0e49624b (diff)
downloadPaper-a31dc90741ed9c121a13a3c124c9ebf5bafd0da7.tar.gz
Paper-a31dc90741ed9c121a13a3c124c9ebf5bafd0da7.zip
Several fixes and new api for experience merging/stacking (#9242)
Diffstat (limited to 'patches/server/0570-Ensure-disconnect-for-book-edit-is-called-on-main.patch')
-rw-r--r--patches/server/0570-Ensure-disconnect-for-book-edit-is-called-on-main.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0570-Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/0570-Ensure-disconnect-for-book-edit-is-called-on-main.patch
new file mode 100644
index 0000000000..09e73af027
--- /dev/null
+++ b/patches/server/0570-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 1f6e123fbd146129e5460631fdd88de9dd60bdca..66d6bd361edfb04eeed4076feb20cb8861d48874 100644
+--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+@@ -1115,7 +1115,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+ // Paper end - Book size limits
+ // 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;