Fix occasional light gen issues for neighbor blocks (#5500)

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
MiniDigger | Martin 2021-04-16 17:55:10 +02:00 committed by GitHub
parent a08be1ec7c
commit 0a9b89c7a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -472,7 +472,7 @@ index b82420e9a5d42a4383d24921614fe613c640edb9..0fec15e141051863dbf51a2b3e1ace50
private static final int nibbleBucketSizeMultiplier = Integer.getInteger("Paper.nibbleBucketSize", 3072);
private static final int maxPoolSize = Integer.getInteger("Paper.maxNibblePoolSize", (int) Math.min(6, Math.max(1, Runtime.getRuntime().maxMemory() / 1024 / 1024 / 1024)) * (nibbleBucketSizeMultiplier * 8));
diff --git a/src/main/java/net/minecraft/world/level/lighting/LightEngineBlock.java b/src/main/java/net/minecraft/world/level/lighting/LightEngineBlock.java
index f6198069e3ca421b4f551939263c7cf8bd5b754e..e8d2415033c5db3c27e10a38e1ea75e60ebd693e 100644
index f6198069e3ca421b4f551939263c7cf8bd5b754e..29e98864209c51368a91fa9e530c33cbf9830b51 100644
--- a/src/main/java/net/minecraft/world/level/lighting/LightEngineBlock.java
+++ b/src/main/java/net/minecraft/world/level/lighting/LightEngineBlock.java
@@ -23,9 +23,11 @@ public final class LightEngineBlock extends LightEngineLayer<LightEngineStorageB
@ -551,7 +551,7 @@ index f6198069e3ca421b4f551939263c7cf8bd5b754e..e8d2415033c5db3c27e10a38e1ea75e6
- long j1 = BlockPosition.a(i, enumdirection);
- long k1 = SectionPosition.e(j1);
+ long j1 = BlockPosition.getAdjacent(x, y, z, enumdirection); // Paper
+ long k1 = SectionPosition.getAdjacentFromBlockPos(x, y, z, enumdirection); // Paper
+ long k1 = SectionPosition.blockToSection(j1); // Paper
if (k == k1 || ((LightEngineStorageBlock) this.c).g(k1)) {
this.b(i, j1, j, flag);