From c0ac50971ddc0d55df7de0a9b09e27f021472f7c Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 26 Apr 2024 11:12:19 +0200 Subject: [PATCH] Fix light setting in protochunk --- patches/server/MC-Dev-fixes.patch | 13 +++++++++++++ patches/server/Rewrite-chunk-system.patch | 16 ++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/patches/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch index 24c2b66005..32a454c921 100644 --- a/patches/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -84,3 +84,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public static SortedArraySet create(Comparator comparator) { +diff --git a/src/main/java/net/minecraft/world/entity/monster/Pillager.java b/src/main/java/net/minecraft/world/entity/monster/Pillager.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Pillager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Pillager.java +@@ -0,0 +0,0 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(0, new FloatGoal(this)); +- this.goalSelector.addGoal(2, new Raider.HoldGroundAttackGoal(this, this, 10.0F)); ++ this.goalSelector.addGoal(2, new Raider.HoldGroundAttackGoal(this, 10.0F)); // Paper - what? + this.goalSelector.addGoal(3, new RangedCrossbowAttackGoal<>(this, 1.0D, 8.0F)); + this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6D)); + this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 15.0F, 1.0F)); diff --git a/patches/server/Rewrite-chunk-system.patch b/patches/server/Rewrite-chunk-system.patch index b7d0d19653..e9010267b3 100644 --- a/patches/server/Rewrite-chunk-system.patch +++ b/patches/server/Rewrite-chunk-system.patch @@ -20410,19 +20410,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 static CompletableFuture generateStructureStarts(WorldGenContext context, ChunkStatus status, Executor executor, ToFullChunk fullChunkConverter, List chunks, ChunkAccess chunk) { @@ -0,0 +0,0 @@ public class ChunkStatusTasks { - } + ((ProtoChunk) chunk).setLightEngine(lightingProvider); + boolean flag = ChunkStatusTasks.isLighted(chunk); - static CompletableFuture generateInitializeLight(WorldGenContext context, ChunkStatus status, Executor executor, ToFullChunk fullChunkConverter, List chunks, ChunkAccess chunk) { -- return ChunkStatusTasks.initializeLight(context.lightEngine(), chunk); +- return lightingProvider.initializeLight(chunk, flag); + return CompletableFuture.completedFuture(chunk); // Paper - rewrite chunk system } - static CompletableFuture loadInitializeLight(WorldGenContext context, ChunkStatus status, ToFullChunk fullChunkConverter, ChunkAccess chunk) { -- return ChunkStatusTasks.initializeLight(context.lightEngine(), chunk); + static CompletableFuture generateLight(WorldGenContext context, ChunkStatus status, Executor executor, ToFullChunk fullChunkConverter, List chunks, ChunkAccess chunk) { +@@ -0,0 +0,0 @@ public class ChunkStatusTasks { + private static CompletableFuture lightChunk(ThreadedLevelLightEngine lightingProvider, ChunkAccess chunk) { + boolean flag = ChunkStatusTasks.isLighted(chunk); + +- return lightingProvider.lightChunk(chunk, flag); + return CompletableFuture.completedFuture(chunk); // Paper - rewrite chunk system } - private static CompletableFuture initializeLight(ThreadedLevelLightEngine lightingProvider, ChunkAccess chunk) { + static CompletableFuture generateSpawn(WorldGenContext context, ChunkStatus status, Executor executor, ToFullChunk fullChunkConverter, List chunks, ChunkAccess chunk) { diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java