mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-18 22:11:07 +00:00
update position also on position_look, fix #2
This commit is contained in:
parent
a00082b57a
commit
34ca0aa788
1 changed files with 6 additions and 0 deletions
|
|
@ -15,6 +15,12 @@ function inject(serv,player)
|
|||
sendRelativePositionChange(toFixedPosition(position), onGround);
|
||||
});
|
||||
|
||||
player._client.on('position_look', function (packet) {
|
||||
var position = new vec3(packet.x, packet.y, packet.z);
|
||||
var onGround = packet.onGround;
|
||||
sendRelativePositionChange(toFixedPosition(position), onGround);
|
||||
});
|
||||
|
||||
function sendRelativePositionChange(newPosition, onGround) {
|
||||
if (player.entity.position.distanceTo(new vec3(0, 0, 0)) != 0) {
|
||||
var diff = newPosition.minus(player.entity.position);
|
||||
|
|
|
|||
Loading…
Reference in a new issue