diff --git a/src/entity/Entity.php b/src/entity/Entity.php index bec78e66..5c68dff3 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -540,7 +540,7 @@ class Entity extends Position for($y = $y0; $y <= $y1; ++$y){ for($z = $z0; $z <= $z1; ++$z){ $b = $this->level->level->getBlockID($x, $y, $z); - if($b != 0){ //TODO might be better to use other method + if($b != 0){ $blockBounds = Block::$class[$b]::getCollisionBoundingBoxes($this->level, $x, $y, $z, $this); foreach($blockBounds as $blockBound){ $dy = $blockBound->calculateYOffset($this->boundingBox, $dy); @@ -1110,8 +1110,8 @@ class Entity extends Position public function updateAABB() { $this->boundingBox->setBounds( - $this->x - $this->radius, $this->y, $this->z - $this->radius, - $this->x + $this->radius, $this->y + $this->height, $this->z + $this->radius + $this->x - $this->radius, $this->y - $this->yOffset, $this->z - $this->radius, + $this->x + $this->radius, $this->y + $this->height - $this->yOffset, $this->z + $this->radius ); } diff --git a/src/entity/object/ItemEntity.php b/src/entity/object/ItemEntity.php index 1bf7ea01..4992d57f 100644 --- a/src/entity/object/ItemEntity.php +++ b/src/entity/object/ItemEntity.php @@ -57,9 +57,5 @@ class ItemEntity extends Entity{ if($this->onGround) $this->speedY *= -0.5; //TODO ++age; despawn after age >= 6000; - - if(abs($this->speedX) < self::MIN_POSSIBLE_SPEED) $this->speedX = 0; - if(abs($this->speedZ) < self::MIN_POSSIBLE_SPEED) $this->speedZ = 0; - if(abs($this->speedY) < self::MIN_POSSIBLE_SPEED) $this->speedY = 0; } }