aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0016-Starlight.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0016-Starlight.patch')
-rw-r--r--patches/server/0016-Starlight.patch52
1 files changed, 18 insertions, 34 deletions
diff --git a/patches/server/0016-Starlight.patch b/patches/server/0016-Starlight.patch
index 9af642c40d..7387fbaf57 100644
--- a/patches/server/0016-Starlight.patch
+++ b/patches/server/0016-Starlight.patch
@@ -4922,7 +4922,7 @@ index 2b8e88a75e9a974e1ecafe0360a9d69b79326d11..6c171199dcc30f56a6d0ab7ecf398b50
this.legacySolid = this.calculateSolid();
}
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 e5e562f75e7d4b6a750f192842940c5e3af81e7d..a2658f3bd45b28478f3d3c4fe5dfef92d7b3b39c 100644
+index e5e562f75e7d4b6a750f192842940c5e3af81e7d..3e5addb60ae8f466dad09edb3ae1fc88fe2681e9 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
@@ -4934,7 +4934,7 @@ index e5e562f75e7d4b6a750f192842940c5e3af81e7d..a2658f3bd45b28478f3d3c4fe5dfef92
private final Map<Structure, StructureStart> structureStarts = Maps.newHashMap();
private final Map<Structure, LongSet> structuresRefences = Maps.newHashMap();
protected final Map<BlockPos, CompoundTag> pendingBlockEntities = Maps.newHashMap();
-@@ -86,6 +86,47 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
+@@ -86,8 +86,55 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
private static final org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry();
public org.bukkit.craftbukkit.persistence.DirtyCraftPersistentDataContainer persistentDataContainer = new org.bukkit.craftbukkit.persistence.DirtyCraftPersistentDataContainer(ChunkAccess.DATA_TYPE_REGISTRY);
// CraftBukkit end
@@ -4981,8 +4981,16 @@ index e5e562f75e7d4b6a750f192842940c5e3af81e7d..a2658f3bd45b28478f3d3c4fe5dfef92
+ // Paper end - rewrite light engine
public ChunkAccess(ChunkPos pos, UpgradeData upgradeData, LevelHeightAccessor heightLimitView, Registry<Biome> biomeRegistry, long inhabitedTime, @Nullable LevelChunkSection[] sectionArray, @Nullable BlendingData blendingData) {
++ // Paper start - rewrite light engine
++ if (!(this instanceof ImposterProtoChunk)) {
++ this.setBlockNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(heightLimitView));
++ this.setSkyNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(heightLimitView));
++ }
++ // Paper end - rewrite light engine
this.locX = pos.x; this.locZ = pos.z; // Paper - reduce need for field lookups
-@@ -96,7 +137,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
+ this.chunkPos = pos; this.coordinateKey = ChunkPos.asLong(locX, locZ); // Paper - cache long key
+ this.upgradeData = upgradeData;
+@@ -96,7 +143,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
this.inhabitedTime = inhabitedTime;
this.postProcessing = new ShortList[heightLimitView.getSectionsCount()];
this.blendingData = blendingData;
@@ -4991,7 +4999,7 @@ index e5e562f75e7d4b6a750f192842940c5e3af81e7d..a2658f3bd45b28478f3d3c4fe5dfef92
if (sectionArray != null) {
if (this.sections.length == sectionArray.length) {
System.arraycopy(sectionArray, 0, this.sections, 0, this.sections.length);
-@@ -507,12 +548,12 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
+@@ -507,12 +554,12 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
}
public void initializeLightSources() {
@@ -5127,21 +5135,10 @@ index 6bb508105641b5729572736c5c3f9bd6711e309a..60e760b42dd6471a229dfd45490dcf8c
@Override
public BlockEntity getBlockEntity(BlockPos pos) {
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 1e434faaf56f7d1501367c4371131a8da30c0421..f225a51d284a64d5a962256ab5d7b2d07544dc88 100644
+index 1e434faaf56f7d1501367c4371131a8da30c0421..f75d37091018d5544099861e2fe7d3fd04870750 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -90,6 +90,10 @@ public class LevelChunk extends ChunkAccess {
-
- public LevelChunk(Level world, ChunkPos pos, UpgradeData upgradeData, LevelChunkTicks<Block> blockTickScheduler, LevelChunkTicks<Fluid> fluidTickScheduler, long inhabitedTime, @Nullable LevelChunkSection[] sectionArrayInitializer, @Nullable LevelChunk.PostLoadProcessor entityLoader, @Nullable BlendingData blendingData) {
- super(pos, upgradeData, world, world.registryAccess().registryOrThrow(Registries.BIOME), inhabitedTime, sectionArrayInitializer, blendingData);
-+ // Paper start - rewrite light engine
-+ this.setBlockNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world));
-+ this.setSkyNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world));
-+ // Paper end - rewrite light engine
- this.tickersInLevel = Maps.newHashMap();
- this.level = (ServerLevel) world; // CraftBukkit - type
- this.gameEventListenerRegistrySections = new Int2ObjectOpenHashMap();
-@@ -219,6 +223,12 @@ public class LevelChunk extends ChunkAccess {
+@@ -219,6 +219,12 @@ public class LevelChunk extends ChunkAccess {
public LevelChunk(ServerLevel world, ProtoChunk protoChunk, @Nullable LevelChunk.PostLoadProcessor entityLoader) {
this(world, protoChunk.getPos(), protoChunk.getUpgradeData(), protoChunk.unpackBlockTicks(), protoChunk.unpackFluidTicks(), protoChunk.getInhabitedTime(), protoChunk.getSections(), entityLoader, protoChunk.getBlendingData());
@@ -5154,7 +5151,7 @@ index 1e434faaf56f7d1501367c4371131a8da30c0421..f225a51d284a64d5a962256ab5d7b2d0
Iterator iterator = protoChunk.getBlockEntities().values().iterator();
while (iterator.hasNext()) {
-@@ -245,7 +255,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -245,7 +251,7 @@ public class LevelChunk extends ChunkAccess {
}
}
@@ -5163,7 +5160,7 @@ index 1e434faaf56f7d1501367c4371131a8da30c0421..f225a51d284a64d5a962256ab5d7b2d0
this.setLightCorrect(protoChunk.isLightCorrect());
this.unsaved = true;
this.needsDecoration = true; // CraftBukkit
-@@ -409,7 +419,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -409,7 +415,7 @@ public class LevelChunk extends ChunkAccess {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
gameprofilerfiller.push("updateSkyLightSources");
@@ -5186,23 +5183,10 @@ index b8fb6d1d85e07f5165bfaf7d80807e069b595851..1219200cd915d6239a32a2bd09d325cd
return data.palette.valueFor(data.storage.get(index));
}
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 38ec21faaa16df5485a81a581506700a5ab0a440..54db27af1a55539e86c775a78d30a3afa7be7f9c 100644
+index 38ec21faaa16df5485a81a581506700a5ab0a440..7da1ed9640211b0e064162dcdb0000538e7b30f3 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
-@@ -53,6 +53,12 @@ public class ProtoChunk extends ChunkAccess {
-
- public ProtoChunk(ChunkPos pos, UpgradeData upgradeData, @Nullable LevelChunkSection[] sections, ProtoChunkTicks<Block> blockTickScheduler, ProtoChunkTicks<Fluid> fluidTickScheduler, LevelHeightAccessor world, Registry<Biome> biomeRegistry, @Nullable BlendingData blendingData) {
- super(pos, upgradeData, world, biomeRegistry, 0L, sections, blendingData);
-+ // Paper start - rewrite light engine
-+ if (!(this instanceof ImposterProtoChunk)) {
-+ this.setBlockNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world));
-+ this.setSkyNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world));
-+ }
-+ // Paper end - rewrite light engine
- this.blockTicks = blockTickScheduler;
- this.fluidTicks = fluidTickScheduler;
- }
-@@ -130,7 +136,7 @@ public class ProtoChunk extends ChunkAccess {
+@@ -130,7 +130,7 @@ public class ProtoChunk extends ChunkAccess {
}
if (LightEngine.hasDifferentLightProperties(this, pos, blockState, state)) {