25 Commits

Author SHA1 Message Date
Dylan K. Taylor
aea124af74
Fix inconsistent class name 2021-11-30 19:17:26 +00:00
Dylan K. Taylor
8620e67d88
Protocol changes for 1.18.0 2021-11-30 19:16:38 +00:00
Dylan K. Taylor
c6c992a1f0
Preparations for negative Y support 2021-11-08 17:28:22 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
8e2d06a880
ChunkSerializer: support writing 0 bpb palettes on the wire
these are now supported as of 1.17.30.
2021-09-25 01:17:32 +01:00
Dylan K. Taylor
11d2e1ef08
Require ext-chunkutils ^0.3.0 2021-09-07 22:53:50 +01:00
Dylan K. Taylor
17d0767db5
ChunkSerializer: implement support for persistent network chunk format 2021-07-17 18:45:04 +01:00
Dylan K. Taylor
e5327a0f3e
ChunkSerializer: Extract serializeSubChunk() from main serialize() routine
this will be used in the future for cache-based chunk sends.
2021-07-17 18:29:14 +01:00
Dylan K. Taylor
1ad38d499c
Deglobalize ItemTypeDictionary usage, at least for the protocol
while this is a bit hacky outside of the protocol namespace, it makes it much easier to use the protocol library for alternative purposes, such as for a client or MITM proxy.
It also removes all but one remaining core dependency of the protocol library, making it very close to being able to be separated from the server core entirely.
2021-07-14 14:26:32 +01:00
Dylan K. Taylor
4549522289 Rename Chunk::getSubChunkChecked() -> getSubChunk() 2020-10-31 23:12:03 +00:00
Dylan K. Taylor
01001dca74 Use Chunk::getSubChunkChecked() in places where we know that an invalid coordinate cannot be requested 2020-10-31 22:48:41 +00:00
Dylan K. Taylor
5661d0496f RuntimeBlockMapping::toRuntimeId() now accepts a single integer instead of id/meta
the expectation is that eventually this will receive arbitrary internal runtime IDs instead of static id/meta, and RuntimeBlockMapping doesn't really care about this crap anyway.
2020-09-20 12:16:11 +01:00
Dylan K. Taylor
ad99dc5884 ChunkSerializer micro optimisation: reduce indirections when writing runtime IDs 2020-07-05 22:00:42 +01:00
Dylan K. Taylor
6c096c44aa Rename NetworkBinaryStream -> PacketSerializer 2020-06-17 11:31:13 +01:00
Dylan K. Taylor
6b037d6a4c RuntimeBlockMapping: these IDs are not static any more 2020-05-11 12:40:55 +01:00
Dylan K. Taylor
a73c54bdd0 making tile spawn compound cache use CacheableNbt instead of strings 2020-05-04 12:35:13 +01:00
Dylan K. Taylor
c2857a91bd [Network]ChunkSerializer: allow injecting RuntimeBlockMapping
this will allow the same serializer to be reused with different mapping tables (will be needed for multi version).
2020-05-04 12:14:27 +01:00
Dylan K. Taylor
a97cafd4f6 moving serializers into protocol namespace 2020-04-27 13:54:39 +01:00
Dylan K. Taylor
287bf4274f move RuntimeBlockMapping to convert package 2020-04-24 12:42:43 +01:00
Dylan K. Taylor
aa1828aa98 RuntimeBlockMapping is now a singleton instead of static class
this prepares for a fully dynamic block mapper, as well as allowing a small performance improvement to chunk encoding by eliding the constant lazy-init checks.
2020-04-23 21:09:58 +01:00
Dylan K. Taylor
d930abce2d ChunkSerializer: improve palette writing performance with one weird trick
this optimization relies on the fact that palette entries are always unsigned, and positive zigzag varints are just the same as their non-zigzag counterparts, except shifted left by 1 bit. This eliminates some function call overhead, making the encoding slightly less agonizingly slow.
2020-03-17 21:16:43 +00:00
Dylan K. Taylor
04a3e71047 ChunkSerializer: avoid using loop vars outside loop scope 2020-02-07 22:10:23 +00:00
Dylan K. Taylor
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
Dylan K. Taylor
eedc9eaee1 Chunk: move protocol-specific getSubChunkSendCount() to network chunk serializer 2019-10-23 18:34:47 +01:00
Dylan K. Taylor
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00