Item factory refactor and added capability to register custom items

This commit is contained in:
Dylan K. Taylor
2017-08-20 19:11:21 +01:00
parent 604d11a8fd
commit 876659cc73
66 changed files with 491 additions and 347 deletions

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
class Beetroot extends Crops{
@ -40,13 +41,13 @@ class Beetroot extends Crops{
public function getDrops(Item $item) : array{
if($this->meta >= 0x07){
return [
Item::get(Item::BEETROOT, 0, 1),
Item::get(Item::BEETROOT_SEEDS, 0, mt_rand(0, 3))
ItemFactory::get(Item::BEETROOT, 0, 1),
ItemFactory::get(Item::BEETROOT_SEEDS, 0, mt_rand(0, 3))
];
}
return [
Item::get(Item::BEETROOT_SEEDS, 0, 1)
ItemFactory::get(Item::BEETROOT_SEEDS, 0, 1)
];
}
}