mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-19 12:25:12 -04:00
deprecate some array reading methods in byte buffers
This commit is contained in:
parent
8c8eb2338b
commit
8f7c8efd88
@ -237,6 +237,7 @@ open class InByteBuffer {
|
||||
return string
|
||||
}
|
||||
|
||||
@Deprecated("Use readArray")
|
||||
fun readStringArray(length: Int = readVarInt()): Array<String> {
|
||||
return readArray(length) { readString() }
|
||||
}
|
||||
@ -254,6 +255,7 @@ open class InByteBuffer {
|
||||
return UUID(readLong(), readLong())
|
||||
}
|
||||
|
||||
@Deprecated("Use readArray")
|
||||
fun readUUIDArray(length: Int = readVarInt()): Array<UUID> {
|
||||
return readArray(length) { readUUID() }
|
||||
}
|
||||
@ -262,6 +264,7 @@ open class InByteBuffer {
|
||||
return readString().toUUID()
|
||||
}
|
||||
|
||||
@Deprecated("Use readArray")
|
||||
fun readUUIDStringArray(length: Int = readVarInt()): Array<UUID> {
|
||||
return readArray(length) { readUUIDString() }
|
||||
}
|
||||
@ -271,6 +274,7 @@ open class InByteBuffer {
|
||||
return Jackson.MAPPER.readValue(readString(), Jackson.JSON_MAP_TYPE)
|
||||
}
|
||||
|
||||
@Deprecated("Use readArray")
|
||||
fun readJsonArray(length: Int = readVarInt()): Array<Map<String, Any>> {
|
||||
return readArray(length) { readJson() }
|
||||
}
|
||||
@ -279,6 +283,7 @@ open class InByteBuffer {
|
||||
return ChatComponent.of(readString(), restrictedMode = true)
|
||||
}
|
||||
|
||||
@Deprecated("Use readArray")
|
||||
fun readChatComponentArray(length: Int = readVarInt()): Array<ChatComponent> {
|
||||
return readArray(length) { readChatComponent() }
|
||||
}
|
||||
@ -410,6 +415,7 @@ open class InByteBuffer {
|
||||
return Pair(resourceLocation, Tag(items.toSet()))
|
||||
}
|
||||
|
||||
@Deprecated("Use readArray")
|
||||
fun <T> readTagArray(length: Int = readVarInt(), idResolver: (Int) -> T): Map<ResourceLocation, Tag<T>> {
|
||||
return mapOf(*(readArray(length) { readTag(idResolver) }))
|
||||
}
|
||||
|
@ -88,6 +88,7 @@ class PlayInByteBuffer : InByteBuffer {
|
||||
return readParticleData(type)
|
||||
}
|
||||
|
||||
@Deprecated("Should be makde with factories")
|
||||
fun readParticleData(type: ParticleType): ParticleData {
|
||||
// ToDo: Replace with dynamic particle type calling
|
||||
if (this.versionId < V_17W45A) {
|
||||
@ -141,6 +142,7 @@ class PlayInByteBuffer : InByteBuffer {
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Use readArray")
|
||||
fun readItemStackArray(length: Int = readVarInt()): Array<ItemStack?> {
|
||||
return readArray(length) { readItemStack() }
|
||||
}
|
||||
@ -200,7 +202,7 @@ class PlayInByteBuffer : InByteBuffer {
|
||||
return Ingredient(readItemStackArray())
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
@Deprecated("Use readArray")
|
||||
fun readIngredientArray(length: Int = readVarInt()): Array<Ingredient> {
|
||||
return readArray(length) { readIngredient() }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user