mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Added various blocks made from mangrove, crimson and warped wood
This commit is contained in:
@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\block\utils\PillarRotationTrait;
|
||||
use pocketmine\block\utils\TreeType;
|
||||
use pocketmine\block\utils\WoodTypeTrait;
|
||||
use pocketmine\data\runtime\block\BlockDataReader;
|
||||
use pocketmine\data\runtime\block\BlockDataWriter;
|
||||
use pocketmine\item\Axe;
|
||||
@ -34,16 +34,10 @@ use pocketmine\player\Player;
|
||||
|
||||
class Wood extends Opaque{
|
||||
use PillarRotationTrait;
|
||||
|
||||
private TreeType $treeType;
|
||||
use WoodTypeTrait;
|
||||
|
||||
private bool $stripped = false;
|
||||
|
||||
public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $breakInfo, TreeType $treeType){
|
||||
parent::__construct($idInfo, $name, $breakInfo);
|
||||
$this->treeType = $treeType;
|
||||
}
|
||||
|
||||
public function getRequiredTypeDataBits() : int{ return 1; }
|
||||
|
||||
protected function decodeType(BlockDataReader $r) : void{
|
||||
@ -54,13 +48,6 @@ class Wood extends Opaque{
|
||||
$w->writeBool($this->stripped);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: this is ad hoc, but add an interface for this to all tree-related blocks
|
||||
*/
|
||||
public function getTreeType() : TreeType{
|
||||
return $this->treeType;
|
||||
}
|
||||
|
||||
public function isStripped() : bool{ return $this->stripped; }
|
||||
|
||||
/** @return $this */
|
||||
@ -74,11 +61,11 @@ class Wood extends Opaque{
|
||||
}
|
||||
|
||||
public function getFlameEncouragement() : int{
|
||||
return 5;
|
||||
return $this->woodType->isFlammable() ? 5 : 0;
|
||||
}
|
||||
|
||||
public function getFlammability() : int{
|
||||
return 5;
|
||||
return $this->woodType->isFlammable() ? 5 : 0;
|
||||
}
|
||||
|
||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||
|
Reference in New Issue
Block a user