Skip to content

Instantly share code, notes, and snippets.

Niclas Olofsson NiclasOlofsson

  • Malmö, Sweden
Block or report user

Report or block NiclasOlofsson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Tomcc
Tomcc / client_blob_cache.md
Last active Dec 20, 2019
A description of the new Client Cache for server developers
View client_blob_cache.md

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 Jan 2, 2020 — forked from Tomcc/blockstate_protocol.md
Block Changes in Beta 1.2.13
View blockstate_protocol.md

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 May 26, 2019
RuntimeID temporary static lookup table
View runtimeid_table.json
[
{
"data": 0,
"id": 0,
"name": "minecraft:air",
"runtimeID": 0
},
{
"data": 0,
"id": 1,
@Tomcc
Tomcc / blockstate_protocol.md
Last active May 26, 2019
Block Changes in Beta 1.2.13
View blockstate_protocol.md

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

View geometry-dump.json
{
"geometry.humanoid": {
"bones": [
{
"name": "body",
"pivot": [ 0.0, 24.0, 0.0 ],
"cubes": [
{
"origin": [ -4.0, 12.0, -2.0 ],
"size": [ 8, 12, 4 ],
View inventoryTransactionLog.log
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]
View mcpe_0.16_metadata.md
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 Jan 22, 2020
List of all Blocks/Items/Entity Id's in MCPE/Win10 1.1.0.1 and EDU Edition
View MCPE_1.1.0.1_Ids.txt
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 May 25, 2020
Diagrams for Documentation
View gist:40e7946c0cff68a31cea

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

You can’t perform that action at this time.