mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 23:22:10 -07:00
Ensure xray does not perform non MT-Safe operations (#2361)
This commit is contained in:
@@ -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
|
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
|
new file mode 100644
|
||||||
index 0000000000..9d8bee5cac
|
index 0000000000..23626bef3a
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
||||||
@@ -0,0 +0,0 @@
|
@@ -0,0 +0,0 @@
|
||||||
@@ -536,13 +536,18 @@ index 0000000000..9d8bee5cac
|
|||||||
+
|
+
|
||||||
+ } finally {
|
+ } finally {
|
||||||
+ if (chunkPacketInfoAntiXray.ticketHold != null) {
|
+ if (chunkPacketInfoAntiXray.ticketHold != null) {
|
||||||
+ MCUtil.ensureMain(null, (Runnable) () -> {
|
+ Runnable runnable = () -> {
|
||||||
+ Chunk chunk = chunkPacketInfoAntiXray.getChunk();
|
+ Chunk chunk = chunkPacketInfoAntiXray.getChunk();
|
||||||
+ ChunkCoordIntPair chunkPos = chunk.getPos();
|
+ ChunkCoordIntPair chunkPos = chunk.getPos();
|
||||||
+
|
+
|
||||||
+ ChunkPacketBlockControllerAntiXray.this.removeXrayTickets(chunkPos.x, chunkPos.z, (ChunkProviderServer) chunk.world.getChunkProvider(),
|
+ ChunkPacketBlockControllerAntiXray.this.removeXrayTickets(chunkPos.x, chunkPos.z, (ChunkProviderServer) chunk.world.getChunkProvider(),
|
||||||
+ chunkPacketInfoAntiXray.ticketHold);
|
+ chunkPacketInfoAntiXray.ticketHold);
|
||||||
+ });
|
+ };
|
||||||
|
+ if (MinecraftServer.getServer().isMainThread()) {
|
||||||
|
+ runnable.run();
|
||||||
|
+ } else {
|
||||||
|
+ MinecraftServer.getServer().scheduleOnMain(runnable);
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
Reference in New Issue
Block a user