ItemFactory: fixed bogus usage of BlockFactory::isRegistered()

ItemFactory IDs don't necessarily correspond to BlockFactory ones anymore.
This commit is contained in:
Dylan K. Taylor 2022-06-25 14:02:55 +01:00
parent e3a9324e8d
commit b268818eda
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -507,7 +507,7 @@ class ItemFactory{
*/
public function isRegistered(int $id, int $variant = 0) : bool{
if($id < 256){
return BlockFactory::getInstance()->isRegistered(self::itemToBlockId($id));
return GlobalBlockStateHandlers::getUpgrader()->upgradeIntIdMeta(self::itemToBlockId($id), $variant & 0xf) !== null;
}
return isset($this->list[self::getListOffset($id, $variant)]);