Dylan K. Taylor
817372c55b
SkyLightUpdate: make heightmap calculation routines pure
2020-10-31 23:42:32 +00:00
Dylan K. Taylor
c39a1407a2
Move heightmap calculation logic to SkyLightUpdate
2020-10-31 23:34:04 +00:00
Dylan K. Taylor
4549522289
Rename Chunk::getSubChunkChecked() -> getSubChunk()
2020-10-31 23:12:03 +00:00
Dylan K. Taylor
b270029161
Rename Chunk::getWritableSubChunk() -> Chunk::getSubChunkChecked()
...
this is not specific to 'writable', it's just an opt-in to checked bounds so that an EmptySubChunk will never be received.
2020-10-31 22:46:33 +00:00
Dylan K. Taylor
ddda2d1e64
Remove $create parameter from ChunkManager::getChunk()
...
this restores SimpleChunkManager's behaviour to PM3, removing the need for GeneratorChunkManager (although I'm dubious whether SubChunkExplorer makes any sense in there any more now that we have morton in the mix).
2020-10-31 21:54:51 +00:00
Dylan K. Taylor
1859dac789
Implemented self-contained (pass 1) chunk relighting
...
this doesn't handle propagating light across chunk borders yet, since that's much more complex to implement.
2020-10-27 18:29:32 +00:00
Dylan K. Taylor
0ecd68e4a7
LightUpdate: remove premature optimisation which breaks when mass-update lighting is used
...
when setBlockSkyLightArray/setBlockLightArray was used, currentLightArray would retain a reference to the old light array, which would cause false readings if SubChunkExplorer didn't move away from that subchunk and back.
This causes a small degradation of performance, but I think it can be implemented differently anyway.
This also fixes #3816 .
2020-10-27 18:01:31 +00:00
Dylan K. Taylor
31c2c3abb5
SubChunkExplorer::moveTo() now returns a status
...
this can be used by SubChunkExplorer subclasses to implement specialized logic.
2020-10-26 16:25:21 +00:00
Dylan K. Taylor
c9d2edcb4d
Rename SubChunkIteratorManager -> SubChunkExplorer
2020-09-20 12:47:44 +01:00
Dylan K. Taylor
4879df626d
Reduced LightUpdate dependency on ChunkManager to indirect
...
this opens the gateway for alternative SubChunkIteratorManager implementations which don't use ChunkManager at all.
2020-09-20 12:41:53 +01:00
Dylan K. Taylor
03de2bcc67
Chunk: simplify heightmap calculation
2020-09-08 23:03:52 +01:00
Dylan K. Taylor
c7070788f9
Rename and repurpose Block->diffusesSkyLight to blocksDirectSkyLight
...
this new form allows skipping some useless checks during sky light calculation and also allows getting rid of the last hard dependency on core Block classes.
We're getting real close to native light now.
2020-09-08 22:40:05 +01:00
Dylan K. Taylor
205617f29e
Untether LightUpdate and children from BlockFactory
2020-09-08 18:14:35 +01:00
Dylan K. Taylor
13d784cd0c
Convert BlockFactory to singleton
2020-04-23 23:45:13 +01:00
Dylan K. Taylor
accc0da0cb
Chunk no longer depends on BlockFactory
...
really this light population crap shouldn't be in the chunk to begin with, but that's a bit more complicated.
2020-04-23 21:31:28 +01:00
Dylan K. Taylor
a3b73d95a7
LightUpdate: allow providing effective light levels for propagation, fix #2999
2019-10-23 21:01:19 +01:00
Dylan K. Taylor
5499ac620c
Removed pocketmine subdirectory, map PSR-4 style
2019-07-30 19:14:57 +01:00