Skip to content

Instantly share code, notes, and snippets.

@krakjoe
krakjoe / example.php
Last active October 11, 2023 19:07
Executor Service with Parallel and Channels
<?php
use \parallel\{Runtime, Channel};
class ExecutorService {
public function __construct(int $workers, string $channel = __CLASS__, int $backlog = Channel::Infinite) {
if ($backlog == 0) {
/*
* execute() will block until a worker is ready
*/
@beito123
beito123 / blockstate_protocol.md
Last active May 8, 2020 17:01 — forked from Tomcc/blockstate_protocol.md
Block Changes in Beta 1.2.13 (For Japanese)

ブロックストレージ & ネットワークプロトコルの変更

This text is translated for Japanese developers.
If it has any problems, please tell me.
Translator: beito (Twitter: https://twitter.com/bei_203)

Original(by Tomcc): https://gist.github.com/Tomcc/a96af509e275b1af483b25c543cfbf37

Thank you :)
@beito123
beito123 / .txt
Last active February 2, 2021 10:11
mcpe用のleveldbの参考リンク
leveldbのブロックの解凍処理の箇所:
https://github.com/Mojang/leveldb-mcpe/blob/aac9314ae2800a203e1be5102fa00ca972f3449c/table/format.cc#L106
mcpeワールド用のleveldbの設定(一部):
https://github.com/Mojang/leveldb-mcpe/blob/8fb685effc48819cb54b2f353871fbc80b8c67ed/mcpe_sample_setup.cpp
leveldb用のzlib圧縮のヘッダー:
https://github.com/Mojang/leveldb-mcpe/blob/8fb685effc48819cb54b2f353871fbc80b8c67ed/include/leveldb/zlib_compressor.h#L48
leveldb用のzlib圧縮の実装部分:
@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

@shoghicp
shoghicp / run.php
Last active September 26, 2020 10:33
Header Extractor - Usage: php run.php --input libminecraftpe.so --output headers/ --pointer-size 4 --asm
<?php
/**
* Minecraft: Pocket Edition header extractor
*
* This tool needs objdump (and objdump-multiarch + arm variants) installed on the current system
*
*/
const VERSION = "0.0.1";
@voluntas
voluntas / shiguredo_recruit.rst
Last active February 28, 2026 14:59
時雨堂を支える採用
@shoghicp
shoghicp / Comparator.php
Last active July 26, 2020 21:36
Minecraft PE .lst Information Extractor to obtain Protocol Information and Compare Versions
<?php
define("COMPARATOR_VERSION", "0.1");
ini_set("memory_limit", "512M");
$node1 = json_decode(@file_get_contents($argv[1]), true);
if($node1 == ""){
echo "Provide a valid json file produced by the Extractor".PHP_EOL;
exit(1);
}
$node2 = json_decode(@file_get_contents($argv[2]), true);