mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Break Block's dependence on ItemFactory, and item legacy IDs
let's GOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
This commit is contained in:
@@ -47,7 +47,10 @@ class ItemIdentifier{
|
||||
public static function fromBlock(Block $block) : self{
|
||||
//negative item type IDs are treated as block IDs
|
||||
//TODO: maybe an ItemBlockIdentifier is in order?
|
||||
return new self(-$block->getTypeId(), $block->getLegacyItemId(), $block->getLegacyItemMeta());
|
||||
//TODO: this isn't vanilla-compliant, but it'll do for now - we only use the "legacy" item ID/meta for full type
|
||||
//indexing right now, because item type IDs aren't granular enough
|
||||
//this should be removed once that's addressed
|
||||
return new self(-$block->getTypeId(), -$block->getTypeId(), $block->computeTypeData());
|
||||
}
|
||||
|
||||
public function getTypeId() : int{ return $this->typeId; }
|
||||
|
Reference in New Issue
Block a user