Entity: shift BB back down after trying to auto-step

this fixes bugs where the entity would jump in the air when walking on blocks like carpet. It also fixes a lot of the issues with stepping in the anti-cheat, allowing to reduce the error tolerance on movement processing.
This commit is contained in:
Dylan K. Taylor 2020-08-23 17:54:48 +01:00
parent 2d77b1e364
commit 89fe8f7f10

View File

@ -1637,13 +1637,20 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
$this->boundingBox->offset(0, 0, $dz);
$reverseDY = -$dy;
foreach($list as $bb){
$reverseDY = $bb->calculateYOffset($this->boundingBox, $reverseDY);
}
$dy += $reverseDY;
$this->boundingBox->offset(0, $reverseDY, 0);
if(($cx ** 2 + $cz ** 2) >= ($dx ** 2 + $dz ** 2)){
$dx = $cx;
$dy = $cy;
$dz = $cz;
$this->boundingBox->setBB($axisalignedbb1);
}else{
$this->ySize += 0.5; //FIXME: this should be the height of the block it walked up, not fixed 0.5
$this->ySize += $dy;
}
}
}