Break Block's dependence on ItemFactory, and item legacy IDs

let's GOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
This commit is contained in:
Dylan K. Taylor
2022-07-02 17:29:28 +01:00
parent 9740891a2f
commit 323c563684
9 changed files with 113 additions and 73 deletions

View File

@@ -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; }