network legacy: properly use fixer to fix resource locations

This commit is contained in:
Moritz Zwerger 2023-10-29 17:23:26 +01:00
parent f04a2720ca
commit c13f2f3445
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -274,7 +274,9 @@ class PlayInByteBuffer : InByteBuffer {
}
fun <T : RegistryItem> readLegacyRegistryItem(registry: Registry<T>, fixer: ResourceLocationFixer? = null): T? {
return registry[readResourceLocation()]
var name = readResourceLocation()
fixer?.fix(name)?.let { name = it }
return registry[name]
}
fun <T : Enum<*>> readEnum(registry: EnumRegistry<T>): T? {