Exterminate legacy item IDs

This commit is contained in:
Dylan K. Taylor
2022-07-05 15:12:55 +01:00
parent c5282b059b
commit 68cbe46600
19 changed files with 375 additions and 1180 deletions

View File

@ -26,6 +26,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\VanillaBlocks;
use pocketmine\data\runtime\RuntimeDataWriter;
/**
* Class used for Items that directly represent blocks, such as stone, dirt, wood etc.
@ -43,6 +44,10 @@ final class ItemBlock extends Item{
$this->blockTypeData = $block->computeTypeData();
}
protected function encodeType(RuntimeDataWriter $w) : void{
$w->writeInt(Block::INTERNAL_STATE_DATA_BITS, $this->blockTypeData);
}
public function getBlock(?int $clickedFace = null) : Block{
//TODO: HACKY MESS, CLEAN IT UP
$factory = BlockFactory::getInstance();