Skip to content

Instantly share code, notes, and snippets.

View dktapps's full-sized avatar

Dylan T. dktapps

View GitHub Profile
@dktapps
dktapps / pm-0.16-metadata-changes.md
Created November 5, 2016 21:01
Entity metadata changes in 0.16. PocketMine only, does not account for spoon changes.
Type Constant name Status Details
Property Ageable::DATA_AGEABLE_FLAGS Removed Ageable flags (Entity::DATA_FLAG_BABY) are now set on the generic entity status (Entity::DATA_FLAGS)
Property Entity::DATA_AIR Changed Value changed (1 -> 7) and default changed (300 -> 400)
Property Entity::DATA_FLAGS Changed Type changed (byte -> long)
Property Entity::DATA_LEAD_EID Changed/Removed Value changed (23 -> 38) and renamed with clearer name (DATA_LEAD_HOLDER_EID).
Property Entity::DATA_NAMETAG Changed Value changed (2 -> 4)
Property Entity::DATA_NO_AI Changed/Removed Changed to a data flag (DATA_FLAG_NO_AI)
Property Entity::DATA_POTION_AMBIENT Changed Value changed (8 -> 9)
Property Entity::DATA_POTION_COLOR Changed Value changed (7 -> 8)
@dktapps
dktapps / MCPE-1.0-NETWORK-CHUNK-SPEC.md
Last active September 29, 2019 11:52
Network chunk specification as of MCPE 1.0

MCPE 1.0 Network Chunk specification

Note: the accuracy of this specification may be flawed. This specification is believed to be correct as of beta 1.0.0.7, but its accuracy is by no means guaranteed.

Basic changes

Biome colour removal

The ability to set biome colours disappeared this update, which is a shame. The old method using biome IDs is back; colours and gradients are now handled automatically client side. While this is a bonus for PocketMine in the way that biome colours in Anvil worlds will now work correctly again, it's a shame to see that capability disappear.

@dktapps
dktapps / TransferPlugin.php
Created February 1, 2017 13:18
Proof of concept transfer plugin for PocketMine with MCPE 1.0.3
<?php
/**
* @name TransferPlugin
* @main dktapps\TransferPlugin\Main
* @api 3.0.0-ALPHA3
* @version 1.0.0
* @description Proof-of-concept for server transfer in MCPE 1.0.3
* @author dktapps
*/
@dktapps
dktapps / enable_strict_types.php
Created June 7, 2017 13:38
Hacked-together script to enable strict types in PHP files en masse. Primarily intended for PocketMine-MP.
<?php
declare(strict_types=1);
$startTime = microtime(true);
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR));
foreach($iterator as $file){
if($file->getExtension() === "php"){
$path = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename();
<?php
namespace dktapps\NoRak;
use pocketmine\plugin\PluginBase;
use pocketmine\command\CommandSender;
use pocketmine\command\Command;
use pocketmine\event\Listener;
use pocketmine\event\server\NetworkInterfaceRegisterEvent;
use pocketmine\network\mcpe\RakLibInterface;
@dktapps
dktapps / run.php
Last active February 15, 2023 04:52
A basic UDP proxy used to bypass client-side Xbox Live authentication in MCPE 1.2.
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
{
"geometry.humanoid": {
"bones": [
{
"name": "body",
"pivot": [ 0.0, 24.0, 0.0 ],
"cubes": [
{
"origin": [ -4.0, 12.0, -2.0 ],
"size": [ 8, 12, 4 ],

Keybase proof

I hereby claim:

  • I am dktapps on github.
  • I am dktapps (https://keybase.io/dktapps) on keybase.
  • I have a public key ASBSphcrMkK13kZqMlU-L8vaSunFR401CHjZloqdImcabgo

To claim this, I am signing this object:

@dktapps
dktapps / SerializedNbtFixer.php
Created April 9, 2018 18:32
Class with utilities to unfuck serialized NBT objects from before PocketMine-MP API 3.0.0-ALPHA11
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
@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