Fixed different woodtype boats being missing

This commit is contained in:
Dylan K. Taylor 2019-03-23 14:51:58 +00:00
parent 034bd716c8
commit 53bb05a6a7
2 changed files with 20 additions and 3 deletions

View File

@ -23,9 +23,22 @@ declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\block\utils\TreeType;
class Boat extends Item{
public function __construct(){
parent::__construct(self::BOAT, 0, "Boat");
/** @var TreeType */
private $woodType;
public function __construct(TreeType $woodType){
parent::__construct(self::BOAT, $woodType->getMagicNumber(), $woodType->getDisplayName() . " Boat");
$this->woodType = $woodType;
}
/**
* @return TreeType
*/
public function getWoodType() : TreeType{
return $this->woodType;
}
public function getFuelTime() : int{

View File

@ -27,6 +27,7 @@ use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\utils\DyeColor;
use pocketmine\block\utils\SkullType;
use pocketmine\block\utils\TreeType;
use pocketmine\entity\EntityFactory;
use pocketmine\entity\Living;
use pocketmine\nbt\tag\CompoundTag;
@ -65,7 +66,6 @@ class ItemFactory{
self::register(new BeetrootSeeds());
self::register(new BeetrootSoup());
self::register(new BlazeRod());
self::register(new Boat());
self::register(new Book());
self::register(new Boots(Item::CHAIN_BOOTS, 0, "Chainmail Boots", new ArmorTypeInfo(1, 196)));
self::register(new Boots(Item::DIAMOND_BOOTS, 0, "Diamond Boots", new ArmorTypeInfo(3, 430)));
@ -260,6 +260,10 @@ class ItemFactory{
}
}
foreach(TreeType::getAll() as $type){
self::register(new Boat($type));
}
//TODO: minecraft:acacia_sign
//TODO: minecraft:armor_stand
//TODO: minecraft:balloon