diff --git a/src/pocketmine/block/Bed.php b/src/pocketmine/block/Bed.php index ef02373d95..cf32837d1c 100644 --- a/src/pocketmine/block/Bed.php +++ b/src/pocketmine/block/Bed.php @@ -202,7 +202,7 @@ class Bed extends Transparent{ return []; } - public function getItem() : Item{ + public function asItem() : Item{ return ItemFactory::get($this->idInfo->getItemId(), $this->color->getMagicNumber()); } diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index 249502fced..fb1deb2469 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -107,7 +107,7 @@ class Block extends Position implements BlockIds, Metadatable{ return $this->idInfo->getBlockId(); } - public function getItem() : Item{ + public function asItem() : Item{ return ItemFactory::get($this->idInfo->getItemId(), $this->idInfo->getVariant()); } @@ -511,7 +511,7 @@ class Block extends Position implements BlockIds, Metadatable{ * @return Item[] */ public function getDropsForCompatibleTool(Item $item) : array{ - return [$this->getItem()]; + return [$this->asItem()]; } /** @@ -522,7 +522,7 @@ class Block extends Position implements BlockIds, Metadatable{ * @return Item[] */ public function getSilkTouchDrops(Item $item) : array{ - return [$this->getItem()]; + return [$this->asItem()]; } /** @@ -564,7 +564,7 @@ class Block extends Position implements BlockIds, Metadatable{ * @return Item */ public function getPickedItem() : Item{ - return $this->getItem(); + return $this->asItem(); } /** diff --git a/src/pocketmine/block/NetherWartPlant.php b/src/pocketmine/block/NetherWartPlant.php index fb2f9cb5ed..f0027de2a9 100644 --- a/src/pocketmine/block/NetherWartPlant.php +++ b/src/pocketmine/block/NetherWartPlant.php @@ -82,7 +82,7 @@ class NetherWartPlant extends Flowable{ public function getDropsForCompatibleTool(Item $item) : array{ return [ - $this->getItem()->setCount($this->age === 3 ? mt_rand(2, 4) : 1) + $this->asItem()->setCount($this->age === 3 ? mt_rand(2, 4) : 1) ]; } diff --git a/src/pocketmine/block/Skull.php b/src/pocketmine/block/Skull.php index 78df03dc68..da62c2c26d 100644 --- a/src/pocketmine/block/Skull.php +++ b/src/pocketmine/block/Skull.php @@ -95,7 +95,7 @@ class Skull extends Flowable{ return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player); } - public function getItem() : Item{ + public function asItem() : Item{ return ItemFactory::get(Item::SKULL, $this->type); } diff --git a/src/pocketmine/block/Slab.php b/src/pocketmine/block/Slab.php index 75e3b6c7e8..dd7599972f 100644 --- a/src/pocketmine/block/Slab.php +++ b/src/pocketmine/block/Slab.php @@ -136,6 +136,6 @@ abstract class Slab extends Transparent{ } public function getDropsForCompatibleTool(Item $item) : array{ - return [$this->getItem()->setCount($this->slabType === SlabType::DOUBLE() ? 2 : 1)]; + return [$this->asItem()->setCount($this->slabType === SlabType::DOUBLE() ? 2 : 1)]; } } diff --git a/src/pocketmine/block/Stem.php b/src/pocketmine/block/Stem.php index 8201085c4c..295f6e7185 100644 --- a/src/pocketmine/block/Stem.php +++ b/src/pocketmine/block/Stem.php @@ -66,7 +66,7 @@ abstract class Stem extends Crops{ public function getDropsForCompatibleTool(Item $item) : array{ return [ - $this->getItem()->setCount(mt_rand(0, 2)) + $this->asItem()->setCount(mt_rand(0, 2)) ]; } } diff --git a/src/pocketmine/entity/object/FallingBlock.php b/src/pocketmine/entity/object/FallingBlock.php index c90c9c36eb..d13a588024 100644 --- a/src/pocketmine/entity/object/FallingBlock.php +++ b/src/pocketmine/entity/object/FallingBlock.php @@ -110,7 +110,7 @@ class FallingBlock extends Entity{ $block = $this->level->getBlock($pos); if($block->getId() > 0 and $block->isTransparent() and !$block->canBeReplaced()){ //FIXME: anvils are supposed to destroy torches - $this->getLevel()->dropItem($this, $this->block->getItem()); + $this->getLevel()->dropItem($this, $this->block->asItem()); }else{ $ev = new EntityBlockChangeEvent($this, $block, $blockTarget ?? $this->block); $ev->call();