ItemFrame: fixed a phpstan level 8 error

This commit is contained in:
Dylan K. Taylor 2020-06-27 00:46:53 +01:00
parent 45b4e3cd7a
commit f039a077cd
2 changed files with 1 additions and 6 deletions

View File

@ -142,7 +142,7 @@ class ItemFrame extends Flowable{
return false;
}
if(lcg_value() <= $this->itemDropChance){
$this->pos->getWorldNonNull()->dropItem($this->pos->add(0.5, 0.5, 0.5), $this->getFramedItem());
$this->pos->getWorldNonNull()->dropItem($this->pos->add(0.5, 0.5, 0.5), clone $this->framedItem);
}
$this->setFramedItem(null);
$this->pos->getWorldNonNull()->setBlock($this->pos, $this);

View File

@ -20,11 +20,6 @@ parameters:
count: 1
path: ../../../src/block/Block.php
-
message: "#^Parameter \\#2 \\$item of method pocketmine\\\\world\\\\World\\:\\:dropItem\\(\\) expects pocketmine\\\\item\\\\Item, pocketmine\\\\item\\\\Item\\|null given\\.$#"
count: 1
path: ../../../src/block/ItemFrame.php
-
message: "#^Parameter \\#2 \\$value of method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:setInt\\(\\) expects int, int\\|null given\\.$#"
count: 4