Commit Graph

29 Commits

Author SHA1 Message Date
4d79aced07 Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +00:00
99996b62d6 Align PhpDoc @param tags according to PHP-CS-Fixer 2022-12-06 13:21:20 +00:00
1ff69136a3 Merge branch 'next-major' into modern-world-support 2022-06-07 20:01:40 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
0326c4964b Merge branch 'next-major' into modern-world-support 2022-04-28 21:06:44 +01:00
b88a47929f Modernize property declarations in src/world/* 2022-04-28 15:06:17 +01:00
334c9daa6a BlockFactory: change property cache arrays to use regular arrays instead of SplFixedArray
this does come at a performance cost, but is necessary for metadata expansion.

we finally concede that this is not going to happen without BC breaks, however small they might be ...
2022-03-23 15:22:57 +00:00
a6f6b60bed fix CS again 2021-11-08 18:02:24 +00:00
c6c992a1f0 Preparations for negative Y support 2021-11-08 17:28:22 +00:00
5b818827db Chunk: stop exposing SplFixedArray<SubChunk> to the API
this fixes a large number of PHPStan errors, and also brings us a step closer to negative-build-height readiness.
2021-10-01 22:17:28 +01:00
4111d92b98 Stop hardcoding chunk dimensions everywhere (#4443) 2021-09-10 16:13:25 +01:00
eb9a68edee Further refactors to prepare for y=-64 lower limit 2021-03-18 00:08:16 +00:00
817372c55b SkyLightUpdate: make heightmap calculation routines pure 2020-10-31 23:42:32 +00:00
c39a1407a2 Move heightmap calculation logic to SkyLightUpdate 2020-10-31 23:34:04 +00:00
4549522289 Rename Chunk::getSubChunkChecked() -> getSubChunk() 2020-10-31 23:12:03 +00:00
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
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
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
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
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
c9d2edcb4d Rename SubChunkIteratorManager -> SubChunkExplorer 2020-09-20 12:47:44 +01:00
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
03de2bcc67 Chunk: simplify heightmap calculation 2020-09-08 23:03:52 +01:00
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
205617f29e Untether LightUpdate and children from BlockFactory 2020-09-08 18:14:35 +01:00
13d784cd0c Convert BlockFactory to singleton 2020-04-23 23:45:13 +01:00
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
a3b73d95a7 LightUpdate: allow providing effective light levels for propagation, fix #2999 2019-10-23 21:01:19 +01:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00