network: 1.19.3-pre2, 1.19.3-pre3, 1.19.3-rc1, 1.19.3-rc2, 1.19.3-rc3, 1.19.3

This commit is contained in:
Bixilon 2022-12-07 21:02:05 +01:00
parent e2f90cb625
commit 7fa3d30bfd
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
10 changed files with 99 additions and 15 deletions

View File

@ -93,6 +93,10 @@ class PixLyzerLoadingTest {
ITUtil.loadPixlyzerData("1.19.2").test()
}
fun `1_19_3`() {
ITUtil.loadPixlyzerData("1.19.3").test()
}
fun latest() {
val version = Versions.getById(VersionSupport.LATEST_VERSION)!!
println("Latest version $version")

View File

@ -174,4 +174,9 @@ internal class ProtocolVersionIT {
fun `1_19_2`() {
assertEquals(ProtocolVersions.V_1_19_2, Versions["1.19.2"]!!.versionId)
}
@Test
fun `1_19_3`() {
assertEquals(ProtocolVersions.V_1_19_3, Versions["1.19.3"]!!.versionId)
}
}

View File

@ -32,7 +32,7 @@ class PlaySoundEvent(
val position: Vec3 = position
get() = Vec3(field)
constructor(connection: PlayConnection, packet: SoundEventS2CP) : this(connection, packet.category, Vec3(packet.position), packet.soundEvent, packet.volume, packet.pitch)
constructor(connection: PlayConnection, packet: SoundEventS2CP) : this(connection, packet.category, Vec3(packet.position), packet.sound, packet.volume, packet.pitch)
constructor(connection: PlayConnection, packet: NamedSoundS2CP) : this(connection, packet.category, packet.position, packet.soundEvent!!, packet.volume, packet.pitch)
}

View File

@ -45,7 +45,9 @@ class RespawnS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
private set
var isFlat = false
private set
var copyMetaData = false
var keepAttributes = false
private set
var keepFlags: Byte = 0
private set
var world: ResourceLocation? = null
private set
@ -61,9 +63,11 @@ class RespawnS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
buffer.readInt()
}].type
}
buffer.versionId < ProtocolVersions.V_1_16_2_PRE3 || buffer.versionId >= ProtocolVersions.V_22W19A -> {
buffer.readLegacyRegistryItem(buffer.connection.registries.dimensionRegistry)!!.type
}
else -> {
DimensionProperties.deserialize(buffer.readNBT().asJsonObject()) // current dimension data
}
@ -89,7 +93,11 @@ class RespawnS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
isFlat = buffer.readBoolean()
}
if (buffer.versionId >= ProtocolVersions.V_20W18A) {
copyMetaData = buffer.readBoolean()
if (buffer.versionId >= ProtocolVersions.V_1_19_3_RC3) {
keepFlags = buffer.readByte()
} else {
keepAttributes = buffer.readBoolean()
}
}
if (buffer.versionId >= ProtocolVersions.V_1_19_PRE2) {
lastDeathPosition = buffer.readPlayOptional { GlobalPositionEntityDataType.read(this) }

View File

@ -24,12 +24,27 @@ import de.bixilon.minosoft.util.logging.LogMessageType
@LoadPacket
class EntitySoundS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
val soundEvent: ResourceLocation = buffer.readRegistryItem(buffer.connection.registries.soundEventRegistry)
val soundEvent: ResourceLocation = buffer.readSound()
val category: SoundCategories = SoundCategories[buffer.readVarInt()]
val entityId: Int = buffer.readVarInt()
val volume: Float = buffer.readFloat()
val pitch: Float = buffer.readFloat()
val magicRandom: Long = if (buffer.versionId >= ProtocolVersions.V_22W14A) buffer.readLong() else 0L
val seed: Long = if (buffer.versionId >= ProtocolVersions.V_22W14A) buffer.readLong() else 0L
var attenuationDistance: Float? = null
private set
private fun PlayInByteBuffer.readSound(): ResourceLocation {
if (versionId < ProtocolVersions.V_1_19_3_RC1) {
return readRegistryItem(connection.registries.soundEventRegistry)
}
val id = readVarInt()
if (id == 0) {
return connection.registries.soundEventRegistry[id]
}
val name = readResourceLocation()
attenuationDistance = readOptional { readFloat() }
return name
}
override fun log(reducedLog: Boolean) {
Log.log(LogMessageType.NETWORK_PACKETS_IN, level = LogLevels.VERBOSE) { "Entity sound effect (soundEvent=$soundEvent, category=$category, entityId$entityId, volume=$volume, pitch=$pitch)" }

View File

@ -31,10 +31,12 @@ class SoundEventS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
var category: SoundCategories? = null
private set
val position: Vec3i
val soundEvent: ResourceLocation
val sound: ResourceLocation
val volume: Float
val pitch: Float
var magicRandom: Long = 0L
var seed: Long = 0L
private set
var attenuationDistance: Float? = null
private set
init {
@ -42,7 +44,18 @@ class SoundEventS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
// category was moved to the top
this.category = SoundCategories[buffer.readVarInt()]
}
soundEvent = buffer.readRegistryItem(buffer.connection.registries.soundEventRegistry)
if (buffer.versionId < ProtocolVersions.V_1_19_3_PRE3) {
sound = buffer.readRegistryItem(buffer.connection.registries.soundEventRegistry)
} else {
val id = buffer.readVarInt()
if (id == 0) {
sound = buffer.connection.registries.soundEventRegistry[id]
} else {
sound = buffer.readResourceLocation()
attenuationDistance = buffer.readOptional { readFloat() }
}
}
if (buffer.versionId >= ProtocolVersions.V_17W15A && buffer.versionId < ProtocolVersions.V_17W18A) {
buffer.readString() // parrot entity type
}
@ -58,7 +71,7 @@ class SoundEventS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
}
if (buffer.versionId >= ProtocolVersions.V_22W14A) {
magicRandom = buffer.readLong()
seed = buffer.readLong()
}
}
@ -70,6 +83,6 @@ class SoundEventS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
}
override fun log(reducedLog: Boolean) {
Log.log(LogMessageType.NETWORK_PACKETS_IN, level = LogLevels.VERBOSE) { "Sound event (category=$category, position=$position, soundEvent=$soundEvent, volume=$volume, pitch=$pitch)" }
Log.log(LogMessageType.NETWORK_PACKETS_IN, level = LogLevels.VERBOSE) { "Sound event (category=$category, position=$position, sound=$sound, volume=$volume, pitch=$pitch)" }
}
}

View File

@ -14,6 +14,12 @@ package de.bixilon.minosoft.protocol.protocol
@Suppress("UNUSED")
object ProtocolVersions {
const val V_1_19_3 = 874
const val V_1_19_3_RC3 = 873
const val V_1_19_3_RC2 = 872
const val V_1_19_3_RC1 = 871
const val V_1_19_3_PRE3 = 870
const val V_1_19_3_PRE2 = 869
const val V_1_19_3_PRE1 = 868
const val V_22W46A = 867
const val V_22W45A = 866

View File

@ -14,11 +14,10 @@
package de.bixilon.minosoft.protocol.protocol
import de.bixilon.minosoft.protocol.protocol.ProtocolVersions.V_13W41B
import de.bixilon.minosoft.protocol.protocol.ProtocolVersions.V_1_19_2
import de.bixilon.minosoft.protocol.protocol.ProtocolVersions.V_1_19_3_PRE1
import de.bixilon.minosoft.protocol.protocol.ProtocolVersions.V_1_19_3
object VersionSupport {
const val MINIMUM_VERSION = V_13W41B
const val LATEST_VERSION = V_1_19_3_PRE1
const val LATEST_RELEASE = V_1_19_2
const val LATEST_VERSION = V_1_19_3
const val LATEST_RELEASE = V_1_19_3
}

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,38 @@
{
"874": {
"name": "1.19.3",
"protocol_id": 761,
"packets": 870,
"type": "release"
},
"873": {
"name": "1.19.3-rc3",
"protocol_id": 1073741938,
"packets": 870
},
"872": {
"name": "1.19.3-rc2",
"protocol_id": 1073741937,
"packets": 870
},
"871": {
"name": "1.19.3-rc1",
"protocol_id": 1073741936,
"packets": 870
},
"870": {
"name": "1.19.3-pre3",
"protocol_id": 1073741935,
"packets": {
"c2s": ["confirm_teleport", "block_nbt", "difficulty", "message_acknowledgement", "command", "signed_chat_message", "client_action", "settings", "command_suggestions", "container_button", "container_click", "close_container", "plugin", "book", "entity_nbt", "entity_interact", "generate_structure", "heartbeat", "lock_difficulty", "position", "position_rotation", "rotation", "ground_change", "move_vehicle", "steer_boat", "item_pick", "crafting_recipe", "toggle_fly", "player_action", "entity_action", "steer_vehicle", "pong", "session_data", "displayed_recipe", "recipe_book", "anvil_item_name", "resourcepack", "advancement_tab", "trade", "beacon_effect", "hotbar_slot", "command_block", "minecart_command_block", "item_stack_create", "jigsaw_block", "structure_block", "sign_text", "swing_arm", "entity_spectate", "block_interact", "use_item"],
"s2c": ["entity_object_spawn", "entity_experience_orb", "entity_player", "entity_animation", "statistics", "block_break", "block_break_animation", "block_data", "block_action", "block", "bossbar", "difficulty", "clear_title", "command_suggestions", "commands", "close_container", "container_items", "container_properties", "container_item", "item_cooldown", "chat_suggestions", "plugin", "hide_message", "kick", "unsigned_chat_message", "entity_status", "explosion", "unload_chunk", "game_event", "open_horse_container", "initialize_world_border", "heartbeat", "chunk", "world_event", "particle", "chunk_light", "initialize", "map", "villager_trades", "relative_move", "movement_rotation", "rotation", "move_vehicle", "book", "open_container", "sign_editor", "ping", "crafting_recipe", "player_abilities", "signed_chat_message", "end_combat_event", "enter_combat_event", "kill_combat_event", "tab_list_remove", "tab_list", "player_face", "position_rotation", "unlock_recipes", "entity_destroy", "entity_remove_effect", "resourcepack", "respawn", "head_rotation", "blocks", "advancement_tab", "play_status", "hotbar_text", "center_world_border", "interpolate_world_border", "size_world_border", "warn_time_world_border", "warn_blocks_world_border", "camera", "hotbar_slot", "chunk_center", "view_distance", "compass_position", "objective_position", "entity_data", "entity_attach", "velocity", "entity_equipment", "experience", "health", "objective", "entity_passenger", "teams", "scoreboard_score", "simulation_distance", "subtitle", "time", "title_text", "title_times", "entity_sound", "sound_event", "stop_sound", "chat_message", "tab_list_text", "nbt_response", "entity_collect", "teleport", "advancements", "entity_attributes", "features", "entity_effect", "recipes", "tags"]
}
},
"869": {
"name": "1.19.3-pre2",
"protocol_id": 1073741934,
"packets": 864
},
"868": {
"name": "1.19.3-pre1",
"protocol_id": 1073741933,