Skip to content

Instantly share code, notes, and snippets.

View rom1504's full-sized avatar

Romain Beaumont rom1504

View GitHub Profile
@rom1504
rom1504 / protocol-diff.json
Created June 5, 2016 22:09
diff example between 1.8 and 1.9.4
{
"play": {
"toClient": {
"oldTypes": {
"packet_login": [
"container",
[
{
"name": "entityId",
"type": "i32"
@rom1504
rom1504 / protocol-diff.json
Created June 5, 2016 22:07
diff example between 16w20a and 1.10-pre1
{
"play": {
"toServer": {
"oldTypes": {
"packet_resource_pack_receive": [
"container",
[
{
"name": "hash",
"type": "string"
@rom1504
rom1504 / level.json
Created April 3, 2016 22:33
mcpe level.dat
{
"type": "compound",
"name": "",
"value": {
"DayCycleStopTime": {
"type": "int",
"value": -1
},
"GameType": {
"type": "int",
@rom1504
rom1504 / convert.js
Created March 28, 2016 20:05
big endian to little endian in protodef tests
var numeric=require("./test/numeric");
var le=numeric.map(n => ({
"type":"l"+n.type,
"values":n.values.map(v => ({
"description":v.description,
"buffer":v.buffer.slice().reverse(),
"value":v.value
}))
}));
@rom1504
rom1504 / datapacket_4.json
Created March 27, 2016 22:16
datapacket_4
{
"name": "data_packet_4",
"params": {
"seqNumber": 0,
"encapsulatedPackets": [
{
"reliability": 2,
"hasSplit": 0,
"length": 33,
"messageIndex": 0,
@rom1504
rom1504 / regex.js
Last active March 7, 2016 13:01
regex
/<([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1>/
/(<link[^>]*(?:\s(?:type=[\"']?(application\/rss\+xml|application\/atom\+xml|application\/rss|application\/atom|application\/rdf\+xml|application\/rdf|text\/rss\+xml|text\/atom\+xml|text\/rss|text\/atom|text\/rdf\+xml|text\/rdf|text\/xml|application\/xml)[\"']?|rel=[\"']?(?:alternate)[\"']?))[^>]*>)/
@rom1504
rom1504 / keybase.md
Created March 6, 2016 14:59
keybase.md

Keybase proof

I hereby claim:

  • I am rom1504 on github.
  • I am rom1504 (https://keybase.io/rom1504) on keybase.
  • I have a public key ASB1Z9sbI8JRLzgvFg_Unf0luj8-SK7QKOGrCcpLDyZF-Qo

To claim this, I am signing this object:

@rom1504
rom1504 / mojang_position.md
Last active March 6, 2016 13:42
All the mojang position format

This will contain all mojang position formats:

Name Description Provenance Implementation example
bitfield a bitfield of x,y,z with x and z being 26 bits, y being 13 bits mcpc modern 1.8 mcdata
3 f64 x,y,z in f64 mcpc modern 1.8 mcdata
3 i32 : fixed-point x,y,z in i32 mcpc modern 1.8 mcdata
2 i32 and 1 i16 x,z in i32 and y in i16 mcpc modern 1.7 mcdata
2 i32 and 1 i8 x,z in i32 and y in i8 mcpc modern 1.7 [mcdata](https://github.com/Prismar
@rom1504
rom1504 / protocol.json
Last active February 29, 2016 17:24
1.9
{
"handshaking": {
"toServer": {
"jj": {
"id": "0x00",
"fields": [
"ushort"
]
}
}
@rom1504
rom1504 / mcpe_convert_protocol.js
Last active October 22, 2023 15:17
mcpe json conv
var fs = require('fs');
var xml2js = require('xml2js');
var parser = new xml2js.Parser();
fs.readFile(__dirname + '/protocol.xml', function(err, data) {
parser.parseString(data, function (err, result) {
fs.writeFileSync('output.json', JSON.stringify(result, null, 2));
var protocol = JSON.parse(fs.readFileSync(__dirname + '/output.json'));