mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
swimming tweaks, fall damage tweaks
This commit is contained in:
parent
6b68b88572
commit
db8b221c02
5 changed files with 34 additions and 4 deletions
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue