mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-17 21:41:06 +00:00
Try number 42.
This commit is contained in:
parent
284cdc73fa
commit
3849de3aa3
2 changed files with 9 additions and 7 deletions
|
|
@ -17,19 +17,16 @@ module.exports.player = (player, serv) => {
|
|||
if(!(player_from = serv.getPlayer(args[0])) || !(player_to = serv.getPlayer(args[1])))
|
||||
return false;
|
||||
|
||||
player_from.position = new Vec3(player_to.position.x, player_to.position.y, player_to.position.z);
|
||||
player_from.sendPosition();
|
||||
player_from.teleport(player_to.position.clone());
|
||||
} else if(args.length === 3) {
|
||||
player.position = new Vec3(args[0]*32, args[1]*32, args[2]*32);
|
||||
player.sendPosition();
|
||||
player.teleport(new Vec3(args[0]*32, args[1]*32, args[2]*32));
|
||||
} else if(args.length === 4) {
|
||||
let player_from;
|
||||
|
||||
if(!(player_from = serv.getPlayer(args[0])))
|
||||
return false;
|
||||
|
||||
player_from.position = new Vec3(args[1]*32, args[2]*32, args[3]*32);
|
||||
player_from.sendPosition();
|
||||
player_from.teleport(new Vec3(args[1]*32, args[2]*32, args[3]*32));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -97,6 +97,11 @@ module.exports.player=function(player)
|
|||
flags: 0x00
|
||||
});
|
||||
};
|
||||
|
||||
player.teleport = (position) => {
|
||||
player.sendRelativePositionChange(position, false);
|
||||
player.sendPosition();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.entity=function(entity,serv){
|
||||
|
|
@ -157,4 +162,4 @@ module.exports.entity=function(entity,serv){
|
|||
else z = Math.max(-max.z, Math.min(max.z, current.z + newVel.z));
|
||||
return new Vec3(x, y, z);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue