fix uuid and start fixing entity id

This commit is contained in:
Romain Beaumont 2015-08-25 21:35:49 +02:00
parent 38934cb05e
commit 2d70dcca0d

7
app.js
View file

@ -26,6 +26,8 @@ for (var x = 0; x < 16;x++) {
}
}
var entityMaxId=0;
var server = mc.createServer(options);
if(settings.logging == true) {
@ -33,14 +35,15 @@ var server = mc.createServer(options);
}
server.on('login', function(client) {
entityMaxId++;
client.id=entityMaxId;
playersConnected.push(client);
playersConnected.forEach(function(entry) {
if(entry != client) {
client.write('named_entity_spawn', {
entityId: entry.id,
playerUUID: entry.uuid,
playerUUID: entry.uuid.split("-").map(function(item) { return parseInt(item, 16); }),
x: playerMoveData[entry.uuid].x,
y: playerMoveData[entry.uuid].y,
z: playerMoveData[entry.uuid].z,