TypeConverter: fixed crash on unknown blockitems (#5729)

morton2d_encode is 64-bit function when NBT int tag is 32-bit only, resulting in crash
This commit is contained in:
kenzeve 2023-04-30 05:11:07 -06:00 committed by GitHub
parent 728e0bc869
commit 17fe894229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,7 +188,7 @@ class TypeConverter{
if($nbt === null){
$nbt = new CompoundTag();
}
$nbt->setInt(self::PM_ID_TAG, morton2d_encode($itemStack->getTypeId(), $itemStack->computeTypeData()));
$nbt->setLong(self::PM_ID_TAG, morton2d_encode($itemStack->getTypeId(), $itemStack->computeTypeData()));
}else{
[$id, $meta, $blockRuntimeId] = $idMeta;
}