mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 16:57:42 +01:00
SPIGOT-7498: ChunkSnapshot.getBlockEmittedLight() gets 64 blocks upper in Overworld
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
parent
7380cef545
commit
39de862c02
@ -316,14 +316,14 @@ public class CraftChunk implements Chunk {
|
|||||||
sectionBlockIDs[i] = ChunkRegionLoader.BLOCK_STATE_CODEC.parse(DynamicOpsNBT.INSTANCE, data.getCompound("block_states")).get().left().get();
|
sectionBlockIDs[i] = ChunkRegionLoader.BLOCK_STATE_CODEC.parse(DynamicOpsNBT.INSTANCE, data.getCompound("block_states")).get().left().get();
|
||||||
|
|
||||||
LevelLightEngine lightengine = worldServer.getLightEngine();
|
LevelLightEngine lightengine = worldServer.getLightEngine();
|
||||||
NibbleArray skyLightArray = lightengine.getLayerListener(EnumSkyBlock.SKY).getDataLayerData(SectionPosition.of(x, i, z));
|
NibbleArray skyLightArray = lightengine.getLayerListener(EnumSkyBlock.SKY).getDataLayerData(SectionPosition.of(x, chunk.getSectionYFromSectionIndex(i), z)); // SPIGOT-7498: Convert section index
|
||||||
if (skyLightArray == null) {
|
if (skyLightArray == null) {
|
||||||
sectionSkyLights[i] = emptyLight;
|
sectionSkyLights[i] = emptyLight;
|
||||||
} else {
|
} else {
|
||||||
sectionSkyLights[i] = new byte[2048];
|
sectionSkyLights[i] = new byte[2048];
|
||||||
System.arraycopy(skyLightArray.getData(), 0, sectionSkyLights[i], 0, 2048);
|
System.arraycopy(skyLightArray.getData(), 0, sectionSkyLights[i], 0, 2048);
|
||||||
}
|
}
|
||||||
NibbleArray emitLightArray = lightengine.getLayerListener(EnumSkyBlock.BLOCK).getDataLayerData(SectionPosition.of(x, i, z));
|
NibbleArray emitLightArray = lightengine.getLayerListener(EnumSkyBlock.BLOCK).getDataLayerData(SectionPosition.of(x, chunk.getSectionYFromSectionIndex(i), z)); // SPIGOT-7498: Convert section index
|
||||||
if (emitLightArray == null) {
|
if (emitLightArray == null) {
|
||||||
sectionEmitLights[i] = emptyLight;
|
sectionEmitLights[i] = emptyLight;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user