Avoid implicit ItemFactory reliance for blocks with special items

this hasn't yet been addressed for signs, since they are a bit of a pain in the ass.
This commit is contained in:
Dylan K. Taylor
2022-06-30 20:00:41 +01:00
parent db2b523762
commit ba079bd9aa
15 changed files with 56 additions and 33 deletions

View File

@ -30,6 +30,7 @@ use pocketmine\event\block\StructureGrowEvent;
use pocketmine\item\Bamboo as ItemBamboo;
use pocketmine\item\Fertilizer;
use pocketmine\item\Item;
use pocketmine\item\VanillaItems;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
@ -243,4 +244,8 @@ class Bamboo extends Transparent{
$world->setBlock($this->position, $this);
}
}
public function asItem() : Item{
return VanillaItems::BAMBOO();
}
}