diff --git a/examples/client.js b/examples/client.js index c13d3f8..d7ac65f 100644 --- a/examples/client.js +++ b/examples/client.js @@ -15,7 +15,7 @@ client.on('mcpe', packet => console.log(packet)); client.on('set_spawn_position', () => { client.writeMCPE('request_chunk_radius', { - chunk_radius:8 + chunkRadius:8 }); }); diff --git a/examples/server.js b/examples/server.js index 963098d..2cd0ae6 100644 --- a/examples/server.js +++ b/examples/server.js @@ -24,15 +24,15 @@ server.on('connection', function(client) { status:0 }); client.writeMCPE('move_player', { - entity_id: [0,0], + entityId: [0,0], x: 1, y: 64 + 1.62, z: 1, yaw: 0, - head_yaw: 0, + headYaw: 0, pitch: 0, mode: 0, - on_ground: 1 + onGround: 1 }); client.writeMCPE("start_game",{ @@ -40,17 +40,17 @@ server.on('connection', function(client) { dimension:0, generator:1, gamemode:1, - entity_id:[0,0], - spawn_x:1, - spawn_y:1, - spawn_z:1, + entityId:[0,0], + spawnX:1, + spawnY:1, + spawnZ:1, x:0, y:1+1.62, z:0, - unknown1:0, - unknown2:0, - unknown3:0, - unknown4:"" + isLoadedInCreative:false, + dayCycleStopTime:0, + eduMode:false, + unknown:"" }); client.writeMCPE('set_spawn_position', { @@ -72,14 +72,14 @@ server.on('connection', function(client) { client.on("request_chunk_radius",() => { client.writeMCPE('chunk_radius_update',{ - chunk_radius:1 + chunkRadius:1 }); for (let x = -1; x <=1; x++) { for (let z = -1; z <=1; z++) { client.writeBatch([{"name":"mcpe","params":{name:"full_chunk_data",params:{ - chunk_x: x, - chunk_z: z, + chunkX: x, + chunkZ: z, order: 1, chunk_data:fs.readFileSync(__dirname+"/chunk") }}}]); diff --git a/src/createClient.js b/src/createClient.js index cace13d..9833f33 100644 --- a/src/createClient.js +++ b/src/createClient.js @@ -35,10 +35,10 @@ function createClient(options) { username: client.username, protocol: 70, protocol2: 70, - client_id: [ -1, -697896776 ], - client_uuid: '86372ed8-d055-b23a-9171-5e3ac594d766', - server_address: client.host+":"+client.port, - client_secret: new Buffer('e8 88 db 7b 9f f2 f0 44 a3 51 08 18 4e 8c 7f 9a'.replace(/ /g,''),'hex'), + clientId: [ -1, -697896776 ], + clientUuid: '86372ed8-d055-b23a-9171-5e3ac594d766', + serverAddress: client.host+":"+client.port, + clientSecret: new Buffer('e8 88 db 7b 9f f2 f0 44 a3 51 08 18 4e 8c 7f 9a'.replace(/ /g,''),'hex'), skin: { skinType: 'Standard_Steve',