Skip to content

Commit

Permalink
map LightEngine in indev
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceWalkerRS committed Dec 18, 2024
1 parent c894d75 commit 4f56276
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 82 deletions.
3 changes: 2 additions & 1 deletion mappings/in-20091223-1459#c0.30-c-renew.tinydiff
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ c net/minecraft/unmapped/C_3906126 net/minecraft/world/World
f I f_8212213 sizeZ
f I f_4184003 sizeY
f [B f_4249554 blocks
f [B f_3132715 blockMetadata
f [B f_3132715 blockData
c Contains light in the 4 least significant bits and block metadata in the next 4 least significant bits.
f I f_3926541 spawnX
f I f_2923303 spawnY
f I f_8500813 spawnZ
Expand Down
51 changes: 29 additions & 22 deletions mappings/in-20100212-1210#in-20100207-1703.tinydiff
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ c net/minecraft/unmapped/C_3906126
p 1 tickDelta
m ()I m_1560346 getSunLight
m ()V m_8798715 close
m (I)V m_9809636 m_9809636
p 1 p_1
m (I)V m_9809636 notifySunLightChanged
p 1 sunLight
m (III)Z m_2029997 hasSkyAccess
p 1 x
p 2 y
Expand Down Expand Up @@ -336,7 +336,7 @@ c net/minecraft/unmapped/C_9232749
p 1 entity
m (Lnet/minecraft/unmapped/C_6385858;)V m_5011830 notifyEntityRemoved
p 1 entity
m ()V m_5371592 m_5371592
m ()V m_5371592 notifySunLightChanged
c net/minecraft/unmapped/C_1051907
m (ILnet/minecraft/unmapped/C_6385858;Lnet/minecraft/unmapped/C_2411117;)I m_6963744 m_6963744
p 1 p_1
Expand Down Expand Up @@ -409,46 +409,53 @@ c net/minecraft/unmapped/C_5376418
p 1 p_1
m ()V m_9060872 m_9060872
c net/minecraft/unmapped/C_7079324 net/minecraft/world/LightEngine
f I f_1773705 f_1773705
f Ljava/util/List; f_4303376 f_4303376
f I f_1773705 dirtyPositionsRemaining
f Ljava/util/List; f_4303376 pendingPositions
c A queue of position arrays, where each position is marked dirty.\nThese arrays are used to limit the number of light changes that can happen at once.
f Lnet/minecraft/unmapped/C_3906126; f_5385225 world
f I f_1592440 sizeX
f I f_8834387 sizeY
f I f_6808223 sizeZ
f I f_8834387 sizeZ
f I f_6808223 sizeY
f [B f_2498169 blocks
f [B f_4192636 blockMetadata
f [B f_4192636 blockData
c Contains light in the 4 least significant bits and block metadata in the next 4 least significant bits.
f [I f_7568118 heightMap
f [I f_5882030 f_5882030
f Lnet/minecraft/unmapped/C_8401487; f_4421655 f_4421655
f I f_6849912 f_6849912
f [I f_5882030 dirtyPositions
c Array of ositions that are marked dirty, i.e. needing a re-calculation of the light value.\n<p>\nThis array is limited to 2^15 (~32k) positions. If any more needed, this array is added\nto the {@link pendingPositions} queue, and a new array is created. This limits the number\nof light calculations that can happen at once.
f Lnet/minecraft/unmapped/C_8401487; f_4421655 sunLightUpdate
c The remaining region that requires light updates after a change in sun light.
f I f_6849912 prevSunLightChange
c The change in the sun light value due to the last change in sun light.
f Ljava/util/List; f_6458992 f_6458992
f Ljava/util/List; f_8250784 f_8250784
f Ljava/util/List; f_7800333 f_7800333
f I f_9134686 f_9134686
m (Lnet/minecraft/unmapped/C_3906126;)V <init> <init>
p 1 world
m (IIII)V m_0087345 updateSkyLight
m (IIII)V m_0087345 updateHeightMap
p 1 x
p 2 z
p 3 rangeX
p 4 rangeZ
m (I)V m_4616966 m_4616966
p 1 p_1
m (IIIIII)V m_8976691 updateBlockLight
m (I)V m_4616966 onSunLightChanged
p 1 sunLight
m (IIIIII)V m_8976691 updateLight
p 1 minX
p 2 minY
p 3 minZ
p 4 maxX
p 5 maxY
p 6 maxZ
m (IIIIII)V m_2928521 markDirty
c Mark all positions in the given region as dirty, i.e. requiring a re-calculation of the light value.
p 1 minX
p 2 minY
p 3 minZ
p 4 maxX
p 5 maxY
p 6 maxZ
m (IIIIII)V m_2928521 m_2928521
p 1 p_1
p 2 p_2
p 3 p_3
p 4 p_4
p 5 p_5
p 6 p_6
m ()V m_4706545 update
c Work through the next batch of light calculations.\n<p>\nFirst, the light engine handles any pending regionChanged updates. These are queued\nafter light values have changed.\n<p>\nIf there is a pending sun light update, that will be handled next. Otherwise, the\nnext pending light update region is marked as dirty. The positions in this region will\nbe queued for light calculations later on in the method.\n<br> Then, the height map will be re-calculated for the next pending height map update\nregion. If the height for any column changes, the entire column will be marked dirty.\n<p>\nThen, the light engine will work through up to 1024 passes over the {@link dirtyPositions}\nand {@link pendingPositions} queues. If the {@link dirtyPositions} queue is empty,\nit will be replaced by the next queue in {@link pendingPositions}.\n<br> For each position in the {@link dirtyPositions} queue, the light value at that\nposition is recalculated based on the sun light, neighboring light values, and the\nopacity and light emission of the block at the position.\n<br> If the light value at the position changed, each of the 6 neighboring positions\nchecks if its light value needs updating, and if so, is marked dirty.\n<p>\nLastly, the region containing all positions where the light value changed is added\nto the {@link regionChangedUpdates} queue.
m ()Ljava/lang/String; m_3359335 getDebugInfo
c net/minecraft/unmapped/C_8401487 net/minecraft/world/LightUpdate
f I f_9889018 minX
Expand Down
33 changes: 20 additions & 13 deletions mappings/in-20100213#in-20100212-1622.tinydiff
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ c net/minecraft/unmapped/C_3624347
p 1 id
p 2 volume
p 3 pitch
m (FFF)V m_0086779 m_0086779
p 1 p_1
p 2 p_2
p 3 p_3
m (FFF)V m_0086779 playMusic
p 1 x
p 2 y
p 3 z
c net/minecraft/unmapped/C_4237166
m (Lnet/minecraft/unmapped/C_5009044;)V m_1312357 m_1312357
p 1 p_1
Expand All @@ -52,16 +52,23 @@ c net/minecraft/unmapped/C_5376418
p 0 world
m ()V m_0011421 placeUndergroundLakes
c net/minecraft/unmapped/C_7079324
f Ljava/util/List; f_7934904 f_7934904
f Ljava/util/List; f_8550703 blockLightUpdates
f Ljava/util/List; f_7031750 skyLightUpdates
f Ljava/util/List; f_0914494 f_0914494
f [B f_6713571 f_6713571
f I f_6635454 f_6635454
f Ljava/util/List; f_7934904 regionChangedUpdates
c Queue of regions that require calls to {@link WorldEventListener#notifyRegionChanged}.
f Ljava/util/List; f_8550703 lightUpdates
c Queue of regions that require re-calculations of light values.
f Ljava/util/List; f_7031750 heightMapUpdates
c Queue of regions that require re-calculations of height map values.
f Ljava/util/List; f_0914494 positionsArrayCache
c A cache of {@code int} arrays to be used as the value for the {@link dirtyPositions} field.
f [B f_6713571 dirtyPositionsData
c This array holds information about whether each position is marked as dirty.\nEach bit is flipped if the corresponding position is marked dirty.\nChecking through this array is much quicker than iterating over the {@link dirtyPositions}\narray to check if a position is present in it.
f I f_6635454 prevSunLight
c The sun light value prior to the last change in sun light.
f Ljava/util/List; f_6458992 f_6458992
f Ljava/util/List; f_8250784 f_8250784
f Ljava/util/List; f_7800333 f_7800333
f I f_9134686 f_9134686
m ()[I m_8109616 m_8109616
m (I)V m_3452050 m_3452050
p 1 p_1
m ()[I m_8109616 newPositionsArray
c Grab a positions array from the cache or create a new one if the cache is empty.
m (I)V m_3452050 updateSunLight
p 1 max
2 changes: 1 addition & 1 deletion mappings/in-20100218-0016#in-20100214.tinydiff
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ c net/minecraft/unmapped/C_3906126
p 2 sizeZ
p 3 sizeY
p 4 blocks
p 5 blockMetadata
p 5 blockData
m (III[B)V m_2817546 assemble
p 1 sizeX
p 2 sizeZ
Expand Down
89 changes: 52 additions & 37 deletions mappings/inf-20100227-1433#in-20100223.tinydiff
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ c net/minecraft/unmapped/C_3906126
f I f_8212213 sizeZ
f I f_4184003 sizeY
f [B f_4249554 blocks
f [B f_3132715 blockMetadata
f [B f_3132715 blockData
c Contains light in the 4 least significant bits and block metadata in the next 4 least significant bits.
f Ljava/lang/String; f_6269457 name
f Ljava/lang/String; f_1523144 author
f J f_6464955 timeOfCreation
Expand Down Expand Up @@ -566,7 +567,7 @@ c net/minecraft/unmapped/C_3906126
p 2 sizeZ
p 3 sizeY
p 4 blocks
p 5 blockMetadata
p 5 blockData
m ()V m_9594040 findSpawnPoint
m ()V finalize finalize
m (Lnet/minecraft/unmapped/C_1414550;)Ljava/util/ArrayList; m_1845335 getCollisions
Expand Down Expand Up @@ -746,8 +747,8 @@ c net/minecraft/unmapped/C_3906126
p 2 centerY
p 3 centerZ
m ()V m_8798715 close
m (I)V m_9809636 m_9809636
p 1 p_1
m (I)V m_9809636 notifySunLightChanged
p 1 sunLight
m (III)Z m_2029997 hasSkyAccess
p 1 x
p 2 y
Expand Down Expand Up @@ -1384,10 +1385,10 @@ c net/minecraft/unmapped/C_3604011
p 5 p_5
p 6 p_6
c net/minecraft/unmapped/C_3624347
m (FFF)V m_0086779 m_0086779
p 1 p_1
p 2 p_2
p 3 p_3
m (FFF)V m_0086779 playMusic
p 1 x
p 2 y
p 3 z
c net/minecraft/unmapped/C_3705866
m (Lnet/minecraft/unmapped/C_3906126;DDD)V <init> <init>
p 1 p_1
Expand Down Expand Up @@ -1757,7 +1758,7 @@ c net/minecraft/unmapped/C_9232749
p 1 entity
m (Lnet/minecraft/unmapped/C_6385858;)V m_5011830 notifyEntityRemoved
p 1 entity
m ()V m_5371592 m_5371592
m ()V m_5371592 notifySunLightChanged
c net/minecraft/unmapped/C_6542415
f I f_5521096 id
f Z f_4641727 uploaded
Expand Down Expand Up @@ -2091,51 +2092,65 @@ c net/minecraft/unmapped/C_6372142 net/minecraft/client/ClientWorldStorage
p 1 p_1
p 2 p_2
c net/minecraft/unmapped/C_7079324 net/minecraft/world/LightEngine
f I f_1773705 f_1773705
f Ljava/util/List; f_4303376 f_4303376
f I f_1773705 dirtyPositionsRemaining
f Ljava/util/List; f_4303376 pendingPositions
c A queue of position arrays, where each position is marked dirty.\nThese arrays are used to limit the number of light changes that can happen at once.
f Lnet/minecraft/unmapped/C_3906126; f_5385225 world
f I f_1592440 sizeX
f I f_8834387 sizeY
f I f_6808223 sizeZ
f I f_8834387 sizeZ
f I f_6808223 sizeY
f [B f_2498169 blocks
f [B f_4192636 blockMetadata
f [B f_4192636 blockData
c Contains light in the 4 least significant bits and block metadata in the next 4 least significant bits.
f [I f_7568118 heightMap
f Ljava/util/List; f_7934904 f_7934904
f Ljava/util/List; f_8550703 blockLightUpdates
f Ljava/util/List; f_7031750 skyLightUpdates
f Ljava/util/List; f_0914494 f_0914494
f [I f_5882030 f_5882030
f [B f_6713571 f_6713571
f Lnet/minecraft/unmapped/C_8401487; f_4421655 f_4421655
f I f_6635454 f_6635454
f I f_6849912 f_6849912
f Ljava/util/List; f_7934904 regionChangedUpdates
c Queue of regions that require calls to {@link WorldEventListener#notifyRegionChanged}.
f Ljava/util/List; f_8550703 lightUpdates
c Queue of regions that require re-calculations of light values.
f Ljava/util/List; f_7031750 heightMapUpdates
c Queue of regions that require re-calculations of height map values.
f Ljava/util/List; f_0914494 positionsArrayCache
c A cache of {@code int} arrays to be used as the value for the {@link dirtyPositions} field.
f [I f_5882030 dirtyPositions
c Array of ositions that are marked dirty, i.e. needing a re-calculation of the light value.\n<p>\nThis array is limited to 2^15 (~32k) positions. If any more needed, this array is added\nto the {@link pendingPositions} queue, and a new array is created. This limits the number\nof light calculations that can happen at once.
f [B f_6713571 dirtyPositionsData
c This array holds information about whether each position is marked as dirty.\nEach bit is flipped if the corresponding position is marked dirty.\nChecking through this array is much quicker than iterating over the {@link dirtyPositions}\narray to check if a position is present in it.
f Lnet/minecraft/unmapped/C_8401487; f_4421655 sunLightUpdate
c The remaining region that requires light updates after a change in sun light.
f I f_6635454 prevSunLight
c The sun light value prior to the last change in sun light.
f I f_6849912 prevSunLightChange
c The change in the sun light value due to the last change in sun light.
m (Lnet/minecraft/unmapped/C_3906126;)V <init> <init>
p 1 world
m ()[I m_8109616 m_8109616
m (IIII)V m_0087345 updateSkyLight
m ()[I m_8109616 newPositionsArray
c Grab a positions array from the cache or create a new one if the cache is empty.
m (IIII)V m_0087345 updateHeightMap
p 1 x
p 2 z
p 3 rangeX
p 4 rangeZ
m (I)V m_4616966 m_4616966
p 1 p_1
m (I)V m_3452050 m_3452050
p 1 p_1
m (IIIIII)V m_8976691 updateBlockLight
m (I)V m_4616966 onSunLightChanged
p 1 sunLight
m (I)V m_3452050 updateSunLight
p 1 max
m (IIIIII)V m_8976691 updateLight
p 1 minX
p 2 minY
p 3 minZ
p 4 maxX
p 5 maxY
p 6 maxZ
m (IIIIII)V m_2928521 markDirty
c Mark all positions in the given region as dirty, i.e. requiring a re-calculation of the light value.
p 1 minX
p 2 minY
p 3 minZ
p 4 maxX
p 5 maxY
p 6 maxZ
m (IIIIII)V m_2928521 m_2928521
p 1 p_1
p 2 p_2
p 3 p_3
p 4 p_4
p 5 p_5
p 6 p_6
m ()V m_4706545 update
c Work through the next batch of light calculations.\n<p>\nFirst, the light engine handles any pending regionChanged updates. These are queued\nafter light values have changed.\n<p>\nIf there is a pending sun light update, that will be handled next. Otherwise, the\nnext pending light update region is marked as dirty. The positions in this region will\nbe queued for light calculations later on in the method.\n<br> Then, the height map will be re-calculated for the next pending height map update\nregion. If the height for any column changes, the entire column will be marked dirty.\n<p>\nThen, the light engine will work through up to 1024 passes over the {@link dirtyPositions}\nand {@link pendingPositions} queues. If the {@link dirtyPositions} queue is empty,\nit will be replaced by the next queue in {@link pendingPositions}.\n<br> For each position in the {@link dirtyPositions} queue, the light value at that\nposition is recalculated based on the sun light, neighboring light values, and the\nopacity and light emission of the block at the position.\n<br> If the light value at the position changed, each of the 6 neighboring positions\nchecks if its light value needs updating, and if so, is marked dirty.\n<p>\nLastly, the region containing all positions where the light value changed is added\nto the {@link regionChangedUpdates} queue.
m ()Ljava/lang/String; m_3359335 getDebugInfo
c net/minecraft/unmapped/C_7667301 net/minecraft/nbt/NbtByte
f B f_7947180 value
Expand Down
8 changes: 4 additions & 4 deletions mappings/inf-20100313#inf-20100227-1433.tinydiff
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ c net/minecraft/unmapped/C_3906126
p 1 x
p 2 z
m (IIII)V m_3304116 setBlockMetadataQuietly
p 1 p_1
p 2 p_2
p 3 p_3
p 4 p_4
p 1 x
p 2 y
p 3 z
p 4 block
m (IIII)V m_7664607 onHeightMapChanged
p 1 x
p 2 z
Expand Down
8 changes: 4 additions & 4 deletions mappings/inf-20100320#inf-20100316.tinydiff
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ c net/minecraft/unmapped/C_3906126
p 1 x
p 2 z
m (IIII)V m_3304116 setBlockMetadataQuietly
p 1 p_1
p 2 p_2
p 3 p_3
p 4 p_4
p 1 x
p 2 y
p 3 z
p 4 block
c net/minecraft/unmapped/C_4078372
f Ljava/util/Random; f_9316266 random
f Lnet/minecraft/unmapped/C_6205974; f_9290433 forestNoise
Expand Down

0 comments on commit 4f56276

Please sign in to comment.