mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-05 11:10:44 +00:00
fix uuid and start fixing entity id
This commit is contained in:
parent
38934cb05e
commit
2d70dcca0d
1 changed files with 5 additions and 2 deletions
7
app.js
7
app.js
|
|
@ -26,6 +26,8 @@ for (var x = 0; x < 16;x++) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var entityMaxId=0;
|
||||||
|
|
||||||
var server = mc.createServer(options);
|
var server = mc.createServer(options);
|
||||||
|
|
||||||
if(settings.logging == true) {
|
if(settings.logging == true) {
|
||||||
|
|
@ -33,14 +35,15 @@ var server = mc.createServer(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
server.on('login', function(client) {
|
server.on('login', function(client) {
|
||||||
|
entityMaxId++;
|
||||||
|
client.id=entityMaxId;
|
||||||
playersConnected.push(client);
|
playersConnected.push(client);
|
||||||
|
|
||||||
playersConnected.forEach(function(entry) {
|
playersConnected.forEach(function(entry) {
|
||||||
if(entry != client) {
|
if(entry != client) {
|
||||||
client.write('named_entity_spawn', {
|
client.write('named_entity_spawn', {
|
||||||
entityId: entry.id,
|
entityId: entry.id,
|
||||||
playerUUID: entry.uuid,
|
playerUUID: entry.uuid.split("-").map(function(item) { return parseInt(item, 16); }),
|
||||||
x: playerMoveData[entry.uuid].x,
|
x: playerMoveData[entry.uuid].x,
|
||||||
y: playerMoveData[entry.uuid].y,
|
y: playerMoveData[entry.uuid].y,
|
||||||
z: playerMoveData[entry.uuid].z,
|
z: playerMoveData[entry.uuid].z,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue