mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
very bad fix of invalid client ent position while it is on half blocks
This commit is contained in:
parent
236f641d6c
commit
73a36a1ea2
2 changed files with 14 additions and 8 deletions
|
|
@ -8,7 +8,8 @@ class Entity extends Position
|
|||
const MIN_POSSIBLE_SPEED = 1/8000; //anything below will send 0 to player
|
||||
|
||||
public $searchForClosestPlayers = false;
|
||||
|
||||
public $modifySpeedY = false;
|
||||
public $modifedSpeedY = 0.0;
|
||||
public $counter = 0;
|
||||
public $fallDistance = 0;
|
||||
public static $updateOnTick, $allowedAI;
|
||||
|
|
@ -631,18 +632,15 @@ class Entity extends Position
|
|||
}
|
||||
$this->boundingBox->offset(0, 0, $dz);
|
||||
|
||||
$dy = -$this->stepHeight;
|
||||
foreach($aaBBs as $bb){
|
||||
$dy = $bb->calculateYOffset($this->boundingBox, $dy);
|
||||
}
|
||||
$this->boundingBox->offset(0, $dy, 0);
|
||||
|
||||
if ($cx*$cx + $cz*$cz >= $dx*$dx + $dz*$dz)
|
||||
{
|
||||
$dx = $cx;
|
||||
$dy = $cy;
|
||||
$dz = $cz;
|
||||
$this->boundingBox->setBB($aabb1);
|
||||
}else{
|
||||
$this->modifySpeedY = true;
|
||||
$this->modifedSpeedY = 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue