Fix #6305 lighting optimization using the wrong method

This commit is contained in:
tterrag 2019-11-07 16:56:54 -05:00
parent 7332bf91d5
commit 124c78b926
3 changed files with 3 additions and 11 deletions

View file

@ -1,14 +1,6 @@
--- a/net/minecraft/world/lighting/BlockLightEngine.java
+++ b/net/minecraft/world/lighting/BlockLightEngine.java
@@ -4,6 +4,7 @@
import net.minecraft.block.BlockState;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.SectionPos;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
@@ -117,4 +118,11 @@
@@ -117,4 +117,11 @@
this.field_215627_c.func_215532_c();
this.func_215469_a(Long.MAX_VALUE, p_215623_1_.func_218275_a(), 15 - p_215623_2_, true);
}

View file

@ -11,7 +11,7 @@
+ return field_215488_c.size();
+ }
+
+ public void bulkCancel(java.util.function.LongPredicate pred) {
+ public final void bulkCancel(java.util.function.LongPredicate pred) {
+ ((Long2ByteOpenHashMap)field_215488_c).keySet().forEach((long l) -> {
+ if (pred.test(l)) {
+ func_215479_e(l);

View file

@ -6,7 +6,7 @@
+ // FORGE: Optimize loop when lighting update count is lower than section size
+ if (p_215528_1_.queuedUpdateSize() < 16 * 16 * 16) {
+ p_215528_1_.bulkCancel(l -> SectionPos.func_218169_f(l) == p_215528_2_);
+ p_215528_1_.bulkCancel(l -> SectionPos.func_218162_e(l) == p_215528_2_);
+ return;
+ }
for(int l = 0; l < 16; ++l) {