Conversation
|
Thanks for taking a first look at a ChunkListener‑based approach, this is very interesting work. As I mentioned in #8, this library will stay event‑based and focused on being simple and beginner‑friendly, so I’m not planning to adopt a more complex chunk‑tracking system in the main API. I’d like to keep this PR as an experimental idea for now rather than merge it, and anyone interested in more advanced block tracking can also look at Cosmoverse’s BlockData for a more powerful alternative. |
Yeah, I'll just leave this here - maybe someone will be interested and share their ideas or suggestions. |
- Change BlockDataWorld::get() to only cache non-null values - Prevent unbounded growth of null entries when getAt() is called frequently on empty blocks - Clarify cache phpdoc to reflect the new behavior - Closes NhanAZ-Libraries#10
Problems
At the moment, there are several issues that do not yet have a clear solution:
Do we actually need multiple instances ofBlockDataChunkListener, one per world?BlockDataChunkListener: if a developer tries to update a block (for example, set the same block to its current position), the listener removes the associated data.Tests
This feature has not been tested yet.