2019-05-05 13:12:32 +02:00
From 4d4c344c62dfec481ac95bfa8bd8cc4eed268968 Mon Sep 17 00:00:00 2001
2018-09-29 04:40:04 +02:00
From: Aikar <aikar@aikar.co>
Date: Fri, 28 Sep 2018 22:27:33 -0400
Subject: [PATCH] Don't recheck type after setting a block
The server does a "Did my update succeed" check after setting
a blocks data to a chunk.
However, writes can not fail outside of a hard error or a
a race condition from multiple threads writing, which is
not something that should ever occur on the server.
So this check is pointless, as if it did occur, the server would
be having data corruption issues anyways.
This provides a small boost to all setType calls.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
2019-05-05 10:33:44 +02:00
index 21fae98c1..98ca253bd 100644
2018-09-29 04:40:04 +02:00
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
2019-05-05 10:33:44 +02:00
@@ -361,7 +361,7 @@ public class Chunk implements IChunkAccess {
this.world.removeTileEntity(blockposition);
2018-09-29 04:40:04 +02:00
}
- if (chunksection.getType(i, j & 15, k).getBlock() != block) {
+ if (false && chunksection.getType(i, j & 15, k).getBlock() != block) { // Paper - don't need to recheck this - this would only fail due to non main thread writes which are not supported
return null;
} else {
2019-05-05 10:33:44 +02:00
TileEntity tileentity;
2018-09-29 04:40:04 +02:00
--
2019-05-05 10:33:44 +02:00
2.20.1
2018-09-29 04:40:04 +02:00