Fix multiplayer RecipeSerializer.codec

# Conflicts:
#	build.gradle.kts
This commit is contained in:
DBotThePony 2024-01-02 13:51:58 +07:00
parent ae544e8844
commit 1d68f32b19
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -21,7 +21,6 @@ fun <R : Recipe<*>> RecipeSerializer<R>.codec(context: Codec2RecipeSerializer<*>
val buffer = FriendlyByteBuf(UnpooledByteBufAllocator.DEFAULT.heapBuffer())
buffer.writeResourceLocation(input.recipe.id)
toNetwork(buffer, input.recipe)
buffer.writerIndex(0)
buffer.readerIndex(0)
val array = ByteBuffer.allocate(buffer.readableBytes())
buffer.readBytes(array)
@ -38,7 +37,6 @@ fun <R : Recipe<*>> RecipeSerializer<R>.codec(context: Codec2RecipeSerializer<*>
it.position(0)
val buffer = FriendlyByteBuf(UnpooledByteBufAllocator.DEFAULT.heapBuffer())
buffer.writeBytes(it)
buffer.writerIndex(0)
buffer.readerIndex(0)
Pair(RecipePair(fromNetwork(buffer.readResourceLocation(), buffer)!!, JsonObject()), ops.empty())
}