Skip to content

Instantly share code, notes, and snippets.

Dylan T. dktapps

View GitHub Profile
View r13-to-r14-blockstates-diff.txt
calculating required block table diff
matched 3029 states
16 old states removed:
CompoundTag: value={
CompoundTag: name='block', value={
StringTag: name='name', value='minecraft:kelp'
CompoundTag: name='states', value={
IntTag: name='age', value='12'
}
}
View README.md

This tool is used to generate the data found in BedrockData.

Usage

Place the script in the root of a PocketMine-MP source code repository. Make sure the composer autoloader has been appropriately generated.

php decoder.php input_file.txt

Input file

View r12_to_current_block_map.nbt.txt
This file has been truncated, but you can view the full file.
ListTag: value={
CompoundTag: value={
CompoundTag: name='old', value={
StringTag: name='name', value='minecraft:acacia_button'
ShortTag: name='val', value='0'
}
CompoundTag: name='new', value={
StringTag: name='name', value='minecraft:acacia_button'
CompoundTag: name='states', value={
@dktapps
dktapps / pre-commit
Created Apr 10, 2019
pre-commit hook I use for PocketMine-MP
View pre-commit
#!/usr/bin/bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
@dktapps
dktapps / README.md
Created Feb 18, 2019
Simple way to make chemistry blocks work correctly on a PocketMine-MP server
View README.md

Enabling chemistry blocks on a PocketMine-MP server

Chemistry blocks (the ones that are implemented, that is) are already present OOB with PocketMine-MP unconditionally. Unfortunately, they don't render correctly due to weirdness in the way Mojang handles the resources.

TL;DR

  1. Download the manifest.json file from this gist.
  2. Add it to a zip file (on Windows, right click -> Send to -> Compressed (zipped) folder)
  3. Place the zip file in PocketMine-MP's resource pack folder and enable it like a normal resource pack.
  4. Profit!
@dktapps
dktapps / blocks.json
Last active Feb 15, 2019
Minecraft: PE legacy item/block magic numbers as of 1.9.0.15. For extended blocks (IDs >= 256) `itemID = 255 - blockID`
View blocks.json
{
"minecraft:air": 0,
"minecraft:stone": 1,
"minecraft:grass": 2,
"minecraft:dirt": 3,
"minecraft:cobblestone": 4,
"minecraft:planks": 5,
"minecraft:sapling": 6,
"minecraft:bedrock": 7,
"minecraft:flowing_water": 8,
View BUILDING.md

Building PocketMine-MP from source (Linux/Mac)

Pre-requisites

  • Install git
  • Download and install PHP >= 7.2.0 ZTS with the required extensions
    • PMMP-provided binaries
    • This document will not cover the process of compiling PHP with the required extensions manually, but if you do you will need to:
      • enable CLI (--enable-cli)
@dktapps
dktapps / README.md
Last active May 7, 2020
Minecraft PE Android crashdump decoder script
View README.md

Minecraft PE crashdump decoder

Setting up environment

Install depot_tools and make sure the tools are available in your PATH variable. You might need to add them to your path manually.

Getting a crashdump file

Requirements:

  • A rooted Android device with MCPE installed.
  1. Trigger the crash you want to debug. When your game crashes, DON'T RESTART IT.
@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

@dktapps
dktapps / SerializedNbtFixer.php
Created Apr 9, 2018
Class with utilities to unfuck serialized NBT objects from before PocketMine-MP API 3.0.0-ALPHA11
View SerializedNbtFixer.php
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
You can’t perform that action at this time.