From c13f2f34459db89e32fd07e970291687a3a907bb Mon Sep 17 00:00:00 2001 From: Moritz Zwerger Date: Sun, 29 Oct 2023 17:23:26 +0100 Subject: [PATCH] network legacy: properly use fixer to fix resource locations --- .../protocol/protocol/buffers/play/PlayInByteBuffer.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/bixilon/minosoft/protocol/protocol/buffers/play/PlayInByteBuffer.kt b/src/main/java/de/bixilon/minosoft/protocol/protocol/buffers/play/PlayInByteBuffer.kt index d90d56500..48b8a6276 100644 --- a/src/main/java/de/bixilon/minosoft/protocol/protocol/buffers/play/PlayInByteBuffer.kt +++ b/src/main/java/de/bixilon/minosoft/protocol/protocol/buffers/play/PlayInByteBuffer.kt @@ -274,7 +274,9 @@ class PlayInByteBuffer : InByteBuffer { } fun readLegacyRegistryItem(registry: Registry, fixer: ResourceLocationFixer? = null): T? { - return registry[readResourceLocation()] + var name = readResourceLocation() + fixer?.fix(name)?.let { name = it } + return registry[name] } fun > readEnum(registry: EnumRegistry): T? {