mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Assign auto-generated runtime type IDs to all items
This commit is contained in:
@ -91,11 +91,19 @@ class Block{
|
||||
|
||||
public function asItem() : Item{
|
||||
return ItemFactory::getInstance()->get(
|
||||
$this->idInfo->getLegacyItemId(),
|
||||
$this->idInfo->getLegacyVariant() | $this->writeStateToItemMeta()
|
||||
$this->getLegacyItemId(),
|
||||
$this->getLegacyItemMeta()
|
||||
);
|
||||
}
|
||||
|
||||
public function getLegacyItemId() : int{
|
||||
return $this->idInfo->getLegacyItemId();
|
||||
}
|
||||
|
||||
public function getLegacyItemMeta() : int{
|
||||
return $this->idInfo->getLegacyVariant() | $this->writeStateToItemMeta();
|
||||
}
|
||||
|
||||
protected function writeStateToItemMeta() : int{
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user