Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit b816e46

Browse files
JackNoordhuisdktapps
authored andcommitted
Fix hopper item duplication (#2052)
This prevents items being pulled/sucked into multiple hoppers on the same tick.
1 parent 3ca6654 commit b816e46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pocketmine/tile/Hopper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function onUpdate(){
9999
$area = clone $this->getBlock()->getBoundingBox(); //Area above hopper to draw items from
100100
$area->maxY = ceil($area->maxY) + 1; //Account for full block above, not just 1 + 5/8
101101
foreach($this->getLevel()->getChunkEntities($this->getBlock()->x >> 4, $this->getBlock()->z >> 4) as $entity){
102-
if(!($entity instanceof DroppedItem)){
102+
if(!($entity instanceof DroppedItem) or !$entity->isAlive()){
103103
continue;
104104
}
105105
if(!$entity->boundingBox->intersectsWith($area)){

0 commit comments

Comments
 (0)