mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Strip all remaining legacy item ID/meta stuff from blocks
the doors are now finally open, we can: - make all the wood types dynamic - fix glazed terracotta - add all the new blocks LET'S GOOOOOOOOOOOO
This commit is contained in:
@ -23,12 +23,27 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\data\runtime\block\BlockDataReader;
|
||||
use pocketmine\data\runtime\block\BlockDataWriter;
|
||||
use pocketmine\item\Item;
|
||||
|
||||
class UnknownBlock extends Transparent{
|
||||
|
||||
public function __construct(BlockIdentifier $idInfo, BlockBreakInfo $breakInfo){
|
||||
private int $stateData;
|
||||
|
||||
public function __construct(BlockIdentifier $idInfo, BlockBreakInfo $breakInfo, int $stateData){
|
||||
parent::__construct($idInfo, "Unknown", $breakInfo);
|
||||
$this->stateData = $stateData;
|
||||
}
|
||||
|
||||
protected function decodeType(BlockDataReader $r) : void{
|
||||
//use type instead of state, so we don't lose any information like colour
|
||||
//this might be an improperly registered plugin block
|
||||
$this->stateData = $r->readInt(Block::INTERNAL_STATE_DATA_BITS);
|
||||
}
|
||||
|
||||
protected function encodeType(BlockDataWriter $w) : void{
|
||||
$w->writeInt(Block::INTERNAL_STATE_DATA_BITS, $this->stateData);
|
||||
}
|
||||
|
||||
public function canBePlaced() : bool{
|
||||
|
Reference in New Issue
Block a user