Skip to content

Instantly share code, notes, and snippets.

View dktapps's full-sized avatar

Dylan T. dktapps

View GitHub Profile
@dktapps
dktapps / message.txt
Last active January 6, 2022 15:38
Signed message listing my accounts relevant to the Minecraft community. You may verify the saltpack using the Keybase App or online verifier such as https://blackhole.dev/saltpack-verify/
I don't speak Russian, and I don't have an account on VK. There is someone on VK.com impersonating me.
I don't speak any language other than English.
My real accounts are:
@𝘥𝘺𝘭𝘢𝘯#2328 (Discord) (User ID: 242003500995837952)
https://github.com/dktapps
https://twitter.com/dktapps
https://keybase.io/dktapps
https://forums.pmmp.io/members/dktapps.3
https://forums.pocketmine.net/members/dktapps.50518/
@dktapps
dktapps / blocks.json
Last active August 15, 2021 02:42
Minecraft: PE legacy item/block magic numbers as of 1.9.0.15. For extended blocks (IDs >= 256) `itemID = 255 - blockID`
{
"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,
@dktapps
dktapps / README.md
Last active August 13, 2021 20:36
Minecraft PE Android crashdump decoder script

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.
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import frida
import sys
import json
import argparse
import subprocess
import base64
import time
@dktapps
dktapps / README.md
Last active January 14, 2021 11:32

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

<?php
$opts = getopt("", ["directed", "path:"]);
$directed = isset($opts["directed"]);
$nodes = [];
class Node{
public $name;
public function __construct(string $name){
@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

{
"geometry.humanoid": {
"bones": [
{
"name": "body",
"pivot": [ 0.0, 24.0, 0.0 ],
"cubes": [
{
"origin": [ -4.0, 12.0, -2.0 ],
"size": [ 8, 12, 4 ],
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'
}
}
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={
ByteTag: name='button_pressed_bit', value='0'