Skip to content

Commit

Permalink
add pmmp#5095
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshy3282 committed Oct 1, 2024
1 parent b00f36b commit 18fa41c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/entity/object/ItemEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 18fa41c

Please sign in to comment.