mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 14:33:09 +01:00
Ensure xray does not perform non MT-Safe operations (#2361)
This commit is contained in:
parent
61b8600730
commit
561f77a904
1 changed files with 8 additions and 3 deletions
|
@ -133,7 +133,7 @@ index 0000000000..f7e376ce6a
|
|||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
||||
new file mode 100644
|
||||
index 0000000000..9d8bee5cac
|
||||
index 0000000000..23626bef3a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -536,13 +536,18 @@ index 0000000000..9d8bee5cac
|
|||
+
|
||||
+ } finally {
|
||||
+ if (chunkPacketInfoAntiXray.ticketHold != null) {
|
||||
+ MCUtil.ensureMain(null, (Runnable) () -> {
|
||||
+ Runnable runnable = () -> {
|
||||
+ Chunk chunk = chunkPacketInfoAntiXray.getChunk();
|
||||
+ ChunkCoordIntPair chunkPos = chunk.getPos();
|
||||
+
|
||||
+ ChunkPacketBlockControllerAntiXray.this.removeXrayTickets(chunkPos.x, chunkPos.z, (ChunkProviderServer) chunk.world.getChunkProvider(),
|
||||
+ chunkPacketInfoAntiXray.ticketHold);
|
||||
+ });
|
||||
+ };
|
||||
+ if (MinecraftServer.getServer().isMainThread()) {
|
||||
+ runnable.run();
|
||||
+ } else {
|
||||
+ MinecraftServer.getServer().scheduleOnMain(runnable);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
|
Loading…
Reference in a new issue