TypeConverter: do not send useless meta to the client

This commit is contained in:
Dylan K. Taylor 2023-01-03 23:50:31 +00:00
parent 0e4b79ea77
commit db07976aab
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -175,6 +175,7 @@ class TypeConverter{
$nbt = new CompoundTag();
}
$nbt->setInt(self::DAMAGE_TAG, $itemStack->getDamage());
$meta = 0;
}elseif($isBlockItem && $itemStack->getMeta() !== 0){
//TODO HACK: This foul-smelling code ensures that we can correctly deserialize an item when the
//client sends it back to us, because as of 1.16.220, blockitems quietly discard their metadata
@ -183,6 +184,7 @@ class TypeConverter{
$nbt = new CompoundTag();
}
$nbt->setInt(self::PM_META_TAG, $itemStack->getMeta());
$meta = 0;
}
}