mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-18 22:11:07 +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",
|
||||
"chai": "~3.2.0",
|
||||
"minecraft-data": "0.7.0",
|
||||
"minecraft-protocol": "^0.14.0",
|
||||
"minecraft-protocol": "^0.15.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"mocha": "~2.2.5",
|
||||
"moment": "^2.10.6",
|
||||
|
|
|
|||
|
|
@ -4,11 +4,6 @@ var Vec3=require("vec3");
|
|||
|
||||
module.exports=inject;
|
||||
|
||||
function transformUuid(s)
|
||||
{
|
||||
return s.split("-").map(function(item) { return parseInt(item, 16); });
|
||||
}
|
||||
|
||||
function inject(serv,player)
|
||||
{
|
||||
function addPlayer()
|
||||
|
|
@ -155,7 +150,7 @@ function inject(serv,player)
|
|||
player._writeOthers('player_info',{
|
||||
action: 0,
|
||||
data: [{
|
||||
UUID: transformUuid(player._client.uuid),
|
||||
UUID: player._client.uuid,
|
||||
name: player.username,
|
||||
properties: [],
|
||||
gamemode: player.gameMode,
|
||||
|
|
@ -170,7 +165,7 @@ function inject(serv,player)
|
|||
data: serv.players
|
||||
.map(function (otherPlayer) {
|
||||
return {
|
||||
UUID: transformUuid(otherPlayer._client.uuid),
|
||||
UUID: otherPlayer._client.uuid,
|
||||
name: otherPlayer.username,
|
||||
properties: [],
|
||||
gamemode: otherPlayer.gameMode,
|
||||
|
|
@ -188,7 +183,7 @@ function inject(serv,player)
|
|||
player.getOthers().forEach(function (otherPlayer) {
|
||||
player._client.write('named_entity_spawn', {
|
||||
entityId: otherPlayer.entity.id,
|
||||
playerUUID: transformUuid(otherPlayer._client.uuid),
|
||||
playerUUID: otherPlayer._client.uuid,
|
||||
x: otherPlayer.entity.position.x,
|
||||
y: otherPlayer.entity.position.y,
|
||||
z: otherPlayer.entity.position.z,
|
||||
|
|
@ -205,7 +200,7 @@ function inject(serv,player)
|
|||
{
|
||||
player._writeOthers('named_entity_spawn',{
|
||||
entityId: player.entity.id,
|
||||
playerUUID: transformUuid(player._client.uuid),
|
||||
playerUUID: player._client.uuid,
|
||||
x: player.entity.position.x,
|
||||
y: player.entity.position.y,
|
||||
z: player.entity.position.z,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
module.exports=inject;
|
||||
|
||||
function transformUuid(s)
|
||||
{
|
||||
return s.split("-").map(function(item) { return parseInt(item, 16); });
|
||||
}
|
||||
|
||||
function inject(serv,player)
|
||||
{
|
||||
player._client.on('end', function () {
|
||||
|
|
@ -13,7 +8,7 @@ function inject(serv,player)
|
|||
player._writeOthers('player_info', {
|
||||
action: 4,
|
||||
data: [{
|
||||
UUID: transformUuid(player._client.uuid)
|
||||
UUID: player._client.uuid
|
||||
}]
|
||||
});
|
||||
player._writeOthers('entity_destroy', {'entityIds': [player.entity.id]});
|
||||
|
|
|
|||
Loading…
Reference in a new issue