Skip to content

Instantly share code, notes, and snippets.

View NiclasOlofsson's full-sized avatar

Niclas Olofsson NiclasOlofsson

View GitHub Profile
@Tomcc
Tomcc / client_blob_cache.md
Last active April 9, 2024 08:46
A description of the new Client Cache for server developers

Client Blob Cache

What's the Client Blob Cache

The Client Blob Cache is a new Bedrock optimization - it allows blocks and biomes to be cached on Clients to avoid resending identical chunks over and over. Chunks and biomes make up the vast majority of network traffic in a lot of common cases (eg. login, teleport or dimension switches) but at the same time, they rarely change. Allowing the Client to reuse chunks it has seen in the past can save a ton of traffic and latency!

The Client Cache is a Content Addressed Storage (a bit like git) that stores Blobs and retrieves them based on their full hashes (BlobIds). This means that the cache doesn't actually know about Chunks - in the future, we might start using it for more types of data, like skins or data driven entities.

A nice thing we get from the CAS approach is that the cache is persistent: returning players will be able to reuse content that was sent them in previous sessions or even previous sessions in different servers as long as tha

@dktapps
dktapps / blockstate_protocol.md
Last active December 4, 2020 05:20 — forked from Tomcc/blockstate_protocol.md
Block Changes in Beta 1.2.13

Block Storage & Network Protocol Changes

Paletted chunks & removing BlockIDs brings a few big changes to how blocks are represented. In Bedrock, Blocks used to be represented by their 8 bit ID and 4 bit data; this means that we can only represent 256 blocks and 16 variants for each block. As it happens we ran out of IDs in Update Aquatic, so we had to do something about it :)

After this change, we can represent infinite types of Blocks and infinite BlockStates, just like in Java. BlockStates are what is sent over the network as they are roughly equivalent to the old ID+data information, eg. they're all the information attached to a block.

BlockStates are serialized in two ways:

PersistentID: a PersistentID is a NBT tag containing the BlockState name and its variant number; for example

@Tomcc
Tomcc / runtimeid_table.json
Last active August 20, 2021 23:57
RuntimeID temporary static lookup table
[
{
"data": 0,
"id": 0,
"name": "minecraft:air",
"runtimeID": 0
},
{
"data": 0,
"id": 1,
@Tomcc
Tomcc / blockstate_protocol.md
Last active April 9, 2024 08:42
Block Changes in Beta 1.2.13

Block Storage & Network Protocol Changes

Paletted chunks & removing BlockIDs brings a few big changes to how blocks are represented. In Bedrock, Blocks used to be represented by their 8 bit ID and 4 bit data; this means that we can only represent 256 blocks and 16 variants for each block. As it happens we ran out of IDs in Update Aquatic, so we had to do something about it :)

After this change, we can represent infinite types of Blocks and infinite BlockStates, just like in Java. BlockStates are what is sent over the network as they are roughly equivalent to the old ID+data information, eg. they're all the information attached to a block.

BlockStates are serialized in two ways:

PersistentID: a PersistentID is a NBT tag containing the BlockState name and its variant number; for example

{
"geometry.humanoid": {
"bones": [
{
"name": "body",
"pivot": [ 0.0, 24.0, 0.0 ],
"cubes": [
{
"origin": [ -4.0, 12.0, -2.0 ],
"size": [ 8, 12, 4 ],
INFO UNKNOWN InventoryTransaction log:
INFO UNKNOWN |- InventorySource #3 [-1]
INFO UNKNOWN | * InventoryAction [InventorySource $3] #0 [1 x Wool(35)@0] -> [0 x (0)@0]
INFO UNKNOWN | * InventoryAction [InventorySource $3] #0 [1 x Wool(35)@0] -> [0 x (0)@0]
INFO UNKNOWN | * InventoryAction [InventorySource $3] #0 [1 x Dark Oak Wood Planks(5)@5] -> [0 x (0)@0]
INFO UNKNOWN | * InventoryAction [InventorySource $3] #0 [1 x Raw Chicken(365)@0] -> [0 x (0)@0]
INFO UNKNOWN | * InventoryAction [InventorySource $3] #0 [1 x Raw Chicken(365)@0] -> [0 x (0)@0]
INFO UNKNOWN | * InventoryAction [InventorySource $3] #0 [1 x Dirt(3)@0] -> [0 x (0)@0]
INFO UNKNOWN | * InventoryAction [InventorySource $3] #0 [1 x Raw Porkchop(319)@0] -> [0 x (0)@0]
INFO UNKNOWN | * InventoryAction [InventorySource $3] #0 [1 x Raw Porkchop(319)@0] -> [0 x (0)@0]
Metadata id Object Description Type Checked
1 Wolf Tail angle int
Boat Health int
Minecart Health int
2 Entity Variant int 👍
FallingBlock fall damage int 👍
Slime size int 👍
3 Entity Color (for sheep in particular) byte 👍
4 Entity name string 👍
@jocopa3
jocopa3 / MCPE_1.1.0.1_Ids.txt
Last active December 20, 2023 07:15
List of all Blocks/Items/Entity Id's in MCPE/Win10 1.1.0.1 and EDU Edition
For advanced users, a syntax highlighter for sublime text and
textmate which makes reading the list easier can be found here:
https://gist.github.com/jocopa3/e4a35921e4f978572e7f45360d231f37
============ Blocks ============
All blocks as found in the 1.1.0.0 Block::initBlocks function.
Block names are the same names used in the /give command.
Name Id Data
@rodneyrehm
rodneyrehm / gist:40e7946c0cff68a31cea
Last active November 7, 2022 09:11
Diagrams for Documentation

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII