diff --git a/src/entity/object/ItemEntity.php b/src/entity/object/ItemEntity.php index 90eeece67c7..caf6b9619be 100644 --- a/src/entity/object/ItemEntity.php +++ b/src/entity/object/ItemEntity.php @@ -212,6 +212,16 @@ protected function applyDragBeforeGravity() : bool{ return true; } + protected function onHitGround() : ?float{ + $fallBlockPos = $this->location->floor(); + $fallBlock = $this->getWorld()->getBlock($fallBlockPos); + if (count($fallBlock->getCollisionBoxes()) === 0) { + $fallBlockPos = $fallBlockPos->down(); + $fallBlock = $this->getWorld()->getBlock($fallBlockPos); + } + return $fallBlock->onEntityLand($this); + } + public function canSaveWithChunk() : bool{ return !$this->item->isNull() && parent::canSaveWithChunk(); }