From 0469550ca20f3631fdfa64f3ff20d35b1c700492 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Thu, 15 Feb 2024 06:43:36 +0300 Subject: [PATCH] fixed mob physics on ice --- src/entity/Entity.php | 1 - src/entity/Living.php | 5 +---- src/material/block/StairBlock.php | 4 +++- src/world/Level.php | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/entity/Entity.php b/src/entity/Entity.php index be9a3016..0d11f209 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -667,7 +667,6 @@ class Entity extends Position $dz = $cz; $this->boundingBox->setBB($aabb1); } - } $this->x = ($this->boundingBox->minX + $this->boundingBox->maxX) / 2; diff --git a/src/entity/Living.php b/src/entity/Living.php index 3828711c..826a55c7 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -225,7 +225,7 @@ abstract class Living extends Entity implements Pathfindable{ //{ // $var5 = $this->landMovementFactor; //} - //$var5 *= $var8; + $var5 *= $var8; }else{ $var5 = $this->jumpMovementFactor; } @@ -255,9 +255,6 @@ abstract class Living extends Entity implements Pathfindable{ $this->ai->mobController->setJumping(true); //non vanilla } } - - //TODO limbYaw - is it even needed? - } public function sendMoveUpdate(){ diff --git a/src/material/block/StairBlock.php b/src/material/block/StairBlock.php index 326de6a3..88d0a0ae 100644 --- a/src/material/block/StairBlock.php +++ b/src/material/block/StairBlock.php @@ -171,8 +171,10 @@ class StairBlock extends TransparentBlock{ $metaNearby = $level->level->getBlockDamage($x + 1, $y, $z); if(self::isBlocksStairsID($idNearby) && ($meta & 4) == ($metaNearby & 4)){ + $minX = 0.5; + $maxX = 1.0; $metaNearbyAnd3 = $metaNearby & 3; - + if($metaNearbyAnd3 == 3 && !self::isStairsAtXYZAndAreTheirMetadataSame($level, $x, $y, $z - 1, $meta)){ $minZ = 0; $maxZ = 0.5; diff --git a/src/world/Level.php b/src/world/Level.php index 5e2e2859..6b8fa9f3 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -389,9 +389,9 @@ class Level{ for($c = 0; $c <= 20; ++$c){ $xyz = mt_rand(0, 0xffffffff) >> 2; $x = $xyz & 0xf; - $z = ($xyz >> 8) & 0xf; //TODO might be possible to make some micro optmizations + $z = ($xyz >> 8) & 0xf; $y = ($xyz >> 16) & 0x7f; - $id = $this->level->fastGetBlockID($cX, $y >> 4, $cZ, $x, $y & 0xf, $z, $index); //$this->level->getBlockID(($cX << 4) + $x, $y, $z + ($cZ << 4)); + $id = $this->level->fastGetBlockID($cX, $y >> 4, $cZ, $x, $y & 0xf, $z, $index); if(isset(self::$randomUpdateBlocks[$id])){ $cl = Block::$class[$id]; $cl::onRandomTick($this, ($cX << 4) + $x, $y, $z + ($cZ << 4));