mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-06 19:50:40 +00:00
use nmp 0.15.0
This commit is contained in:
parent
4b7acbf00e
commit
587ce76f27
3 changed files with 6 additions and 16 deletions
|
|
@ -26,7 +26,7 @@
|
||||||
"buffers": "0.1.1",
|
"buffers": "0.1.1",
|
||||||
"chai": "~3.2.0",
|
"chai": "~3.2.0",
|
||||||
"minecraft-data": "0.7.0",
|
"minecraft-data": "0.7.0",
|
||||||
"minecraft-protocol": "^0.14.0",
|
"minecraft-protocol": "^0.15.0",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
"mocha": "~2.2.5",
|
"mocha": "~2.2.5",
|
||||||
"moment": "^2.10.6",
|
"moment": "^2.10.6",
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,6 @@ var Vec3=require("vec3");
|
||||||
|
|
||||||
module.exports=inject;
|
module.exports=inject;
|
||||||
|
|
||||||
function transformUuid(s)
|
|
||||||
{
|
|
||||||
return s.split("-").map(function(item) { return parseInt(item, 16); });
|
|
||||||
}
|
|
||||||
|
|
||||||
function inject(serv,player)
|
function inject(serv,player)
|
||||||
{
|
{
|
||||||
function addPlayer()
|
function addPlayer()
|
||||||
|
|
@ -155,7 +150,7 @@ function inject(serv,player)
|
||||||
player._writeOthers('player_info',{
|
player._writeOthers('player_info',{
|
||||||
action: 0,
|
action: 0,
|
||||||
data: [{
|
data: [{
|
||||||
UUID: transformUuid(player._client.uuid),
|
UUID: player._client.uuid,
|
||||||
name: player.username,
|
name: player.username,
|
||||||
properties: [],
|
properties: [],
|
||||||
gamemode: player.gameMode,
|
gamemode: player.gameMode,
|
||||||
|
|
@ -170,7 +165,7 @@ function inject(serv,player)
|
||||||
data: serv.players
|
data: serv.players
|
||||||
.map(function (otherPlayer) {
|
.map(function (otherPlayer) {
|
||||||
return {
|
return {
|
||||||
UUID: transformUuid(otherPlayer._client.uuid),
|
UUID: otherPlayer._client.uuid,
|
||||||
name: otherPlayer.username,
|
name: otherPlayer.username,
|
||||||
properties: [],
|
properties: [],
|
||||||
gamemode: otherPlayer.gameMode,
|
gamemode: otherPlayer.gameMode,
|
||||||
|
|
@ -188,7 +183,7 @@ function inject(serv,player)
|
||||||
player.getOthers().forEach(function (otherPlayer) {
|
player.getOthers().forEach(function (otherPlayer) {
|
||||||
player._client.write('named_entity_spawn', {
|
player._client.write('named_entity_spawn', {
|
||||||
entityId: otherPlayer.entity.id,
|
entityId: otherPlayer.entity.id,
|
||||||
playerUUID: transformUuid(otherPlayer._client.uuid),
|
playerUUID: otherPlayer._client.uuid,
|
||||||
x: otherPlayer.entity.position.x,
|
x: otherPlayer.entity.position.x,
|
||||||
y: otherPlayer.entity.position.y,
|
y: otherPlayer.entity.position.y,
|
||||||
z: otherPlayer.entity.position.z,
|
z: otherPlayer.entity.position.z,
|
||||||
|
|
@ -205,7 +200,7 @@ function inject(serv,player)
|
||||||
{
|
{
|
||||||
player._writeOthers('named_entity_spawn',{
|
player._writeOthers('named_entity_spawn',{
|
||||||
entityId: player.entity.id,
|
entityId: player.entity.id,
|
||||||
playerUUID: transformUuid(player._client.uuid),
|
playerUUID: player._client.uuid,
|
||||||
x: player.entity.position.x,
|
x: player.entity.position.x,
|
||||||
y: player.entity.position.y,
|
y: player.entity.position.y,
|
||||||
z: player.entity.position.z,
|
z: player.entity.position.z,
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
module.exports=inject;
|
module.exports=inject;
|
||||||
|
|
||||||
function transformUuid(s)
|
|
||||||
{
|
|
||||||
return s.split("-").map(function(item) { return parseInt(item, 16); });
|
|
||||||
}
|
|
||||||
|
|
||||||
function inject(serv,player)
|
function inject(serv,player)
|
||||||
{
|
{
|
||||||
player._client.on('end', function () {
|
player._client.on('end', function () {
|
||||||
|
|
@ -13,7 +8,7 @@ function inject(serv,player)
|
||||||
player._writeOthers('player_info', {
|
player._writeOthers('player_info', {
|
||||||
action: 4,
|
action: 4,
|
||||||
data: [{
|
data: [{
|
||||||
UUID: transformUuid(player._client.uuid)
|
UUID: player._client.uuid
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
player._writeOthers('entity_destroy', {'entityIds': [player.entity.id]});
|
player._writeOthers('entity_destroy', {'entityIds': [player.entity.id]});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue