pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.28k stars 1.55k forks source link

PlayerMoveEvent negative position #5079

Closed Xiaoming0313883 closed 2 years ago

Xiaoming0313883 commented 2 years ago

Issue description

Cause

Format = "x" + "y" + "z"
string(22) "341.5119 + 66 + 1.0191" ---> when position z is 1
string(22) "341.5198 + 66 + 0.8899" ---> enter z in 0
string(22) "341.5585 + 66 + 0.2536"
string(22) "341.5573 + 66 + 0.2728"
string(21) "341.5591 + 66 + 0.243"
string(22) "341.5585 + 66 + 0.2536"
string(22) "341.5598 + 66 + 0.2325"
string(21) "341.5591 + 66 + 0.243"
string(22) "341.5599 + 66 + 0.2304"
string(22) "341.5598 + 66 + 0.2325"
string(21) "341.5612 + 66 + 0.201"
string(22) "341.5599 + 66 + 0.2304"
string(22) "341.5634 + 66 + 0.1556"
string(21) "341.5612 + 66 + 0.201"
string(22) "341.5659 + 66 + 0.1015"
string(22) "341.5634 + 66 + 0.1556"
string(23) "341.5775 + 66 + -0.1457" --> it suppose to become -1, but it rolling in -0.1 first after 0 ending
string(22) "341.5746 + 66 + -0.082"
string(23) "341.5792 + 66 + -0.1806"
string(23) "341.5775 + 66 + -0.1457"
string(23) "341.5801 + 66 + -0.1996"
string(23) "341.5988 + 66 + -0.5985"
string(23) "341.6049 + 66 + -0.7271"
string(23) "341.6018 + 66 + -0.6627"
string(23) "341.6079 + 66 + -0.7917"
string(23) "341.6049 + 66 + -0.7271"
string(23) "341.6109 + 66 + -0.8563"
string(23) "341.6079 + 66 + -0.7917"
string(22) "341.614 + 66 + -0.9209"
string(23) "341.6109 + 66 + -0.8563"
string(23) "341.6156 + 66 + -0.9562"
string(22) "341.614 + 66 + -0.9209"
string(23) "341.6165 + 66 + -0.9755"
string(23) "341.6156 + 66 + -0.9562"
string(21) "341.617 + 66 + -0.986"
string(23) "341.6165 + 66 + -0.9755"
string(23) "341.6176 + 66 + -0.9966"
string(21) "341.617 + 66 + -0.986"
string(21) "341.619 + 66 + -1.028" ---> the real position is 2 not 1
SOF3 commented 2 years ago

Please show the code you used to reproduce the above.

Xiaoming0313883 commented 2 years ago
$to = $event->getTo();
var_dump($to->getX() . " + " . $to->getY() . " + " . $to->getZ());

I check the real position by looking on coordinate tag, in vanilla it call showcoordinate.

Xiaoming0313883 commented 2 years ago

Honestly I dump to and from position also, but you can reduce it by using one of them.

dktapps commented 2 years ago

⚠️ This issue ticket doesn't have all the required information ⚠️ To make it as quick and easy as possible for maintainers to fix your problem, an issue template is provided which lists certain required information. This includes (but is not limited to):

Without this information, your problem cannot begin to be investigated, so the issue will be closed. You may amend this one, or create a new one, providing all the required information using one of the provided issue templates.

Help us to help you by providing the information we ask for.

Xiaoming0313883 commented 2 years ago

This server is running PocketMine-MP