mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-05 11:10:44 +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);
|
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) {
|
function sendRelativePositionChange(newPosition, onGround) {
|
||||||
if (player.entity.position.distanceTo(new vec3(0, 0, 0)) != 0) {
|
if (player.entity.position.distanceTo(new vec3(0, 0, 0)) != 0) {
|
||||||
var diff = newPosition.minus(player.entity.position);
|
var diff = newPosition.minus(player.entity.position);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue