From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 10 Jun 2023 14:05:26 -0700 Subject: [PATCH] Remove unused skyLightSources Starlight does not use the sky light sources, and there appear to be issues with TE access on Folia when initializing them. So, we can just delete it entirely. diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java index 8b96d1b7548d354fbcabe6d1b5e9d6c3e2a5cb9d..e8fb179c5f443efd70293f31cdf00ca2eaf05006 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java @@ -74,7 +74,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom @Nullable protected BlendingData blendingData; public final Map heightmaps = Maps.newEnumMap(Heightmap.Types.class); - protected ChunkSkyLightSources skyLightSources; + // Folia - remove unused skyLightSources private final Map structureStarts = Maps.newHashMap(); private final Map structuresRefences = Maps.newHashMap(); protected final Map pendingBlockEntities = Maps.newHashMap(); @@ -137,7 +137,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom this.inhabitedTime = inhabitedTime; this.postProcessing = new ShortList[heightLimitView.getSectionsCount()]; this.blendingData = blendingData; - this.skyLightSources = new ChunkSkyLightSources(heightLimitView); + // Folia - remove unused skyLightSources if (sectionArray != null) { if (this.sections.length == sectionArray.length) { System.arraycopy(sectionArray, 0, this.sections, 0, this.sections.length); @@ -549,12 +549,12 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom } public void initializeLightSources() { - this.skyLightSources.fillFrom(this); + // Folia - remove unused skyLightSources } @Override public ChunkSkyLightSources getSkyLightSources() { - return this.skyLightSources; + return null; // Folia - remove unused skyLightSources } public static record TicksToSave(SerializableTickContainer blocks, SerializableTickContainer fluids) { diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java index e270816f5bbdfcfeaaaf647beb2298a314569a93..94edc970f64a2c0f89eb6666de21f0f01d1c1c9d 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -306,7 +306,7 @@ public class LevelChunk extends ChunkAccess { } } - this.skyLightSources = protoChunk.skyLightSources; + // Folia - remove unused skyLightSources this.setLightCorrect(protoChunk.isLightCorrect()); this.unsaved = true; this.needsDecoration = true; // CraftBukkit @@ -498,7 +498,7 @@ public class LevelChunk extends ChunkAccess { ProfilerFiller gameprofilerfiller = this.level.getProfiler(); gameprofilerfiller.push("updateSkyLightSources"); - this.skyLightSources.update(this, j, i, l); + // Folia - remove unused skyLightSources gameprofilerfiller.popPush("queueCheckLight"); this.level.getChunkSource().getLightEngine().checkBlock(blockposition); gameprofilerfiller.pop(); diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java index 6c72eb36020bc05104b21e52cea89de09b85f2d7..d361975826247a85a6aa5989814b525c2d1cbbc7 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java @@ -140,7 +140,7 @@ public class ProtoChunk extends ChunkAccess { } if (LightEngine.hasDifferentLightProperties(this, pos, blockState, state)) { - this.skyLightSources.update(this, m, j, o); + // Folia - remove unused skyLightSources this.lightEngine.checkBlock(pos); } }