swimming tweaks, fall damage tweaks

This commit is contained in:
GameHerobrine 2023-02-23 20:07:02 +03:00
parent 6b68b88572
commit db8b221c02
5 changed files with 34 additions and 4 deletions

View file

@ -568,6 +568,10 @@ class Entity extends Position
$y1 = ceil($aABB->maxY);
$z0 = floor($aABB->minZ);
$z1 = ceil($aABB->maxZ);
$ywMin = floor($aABB->minY + 0.4);
$ywMax = ceil($aABB->maxY - 0.4);
$x0 = $x0 < 0 ? 0 : $x0;
$y0 = $y0 < 0 ? 0 : $y0;
$z0 = $z0 < 0 ? 0 : $z0;
@ -579,8 +583,9 @@ class Entity extends Position
for($z = $z0; $z < $z1; ++$z){
$pos = new Vector3($x, $y, $z);
$b = $this->level->getBlock($pos);
if($b->y == ($y1 - 1) && ($b->getID() === WATER || $b->getID() === STILL_WATER)){
$water = true;
if(($b->getID() === WATER || $b->getID() === STILL_WATER)){
$water = $b->y == ($y1 - 1);
$this->fallDistance = 0;
}
if($b != false && $b->isSolid){
$this->speedY = $b->boundingBox->calculateYOffset($this->boundingBox, $this->speedY);
@ -729,7 +734,6 @@ class Entity extends Position
$this->needsUpdate = $hasUpdate;
$this->lastUpdate = $now;
}
public function fall(){}
public function updateFallState($fallTick){