Skip to content

Commit

Permalink
Fix encoding player hurt packet
Browse files Browse the repository at this point in the history
Signed-off-by: Seppe Volkaerts <seppevolkaerts@hotmail.com>
  • Loading branch information
Cybermaxke committed Nov 30, 2023
1 parent d543e46 commit 4b28e39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions proxy/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {
api(kotlin("stdlib-jdk8"))
api(kotlin("reflect"))

val coroutinesVersion = "1.6.4"
val coroutinesVersion = "1.7.1"
api(group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = coroutinesVersion)
api(group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-jdk8", version = coroutinesVersion)
api(group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json-jvm", version = "1.5.0")
Expand Down Expand Up @@ -68,12 +68,12 @@ dependencies {
implementation(group = "org.spongepowered", name = "plugin-spi", version = "0.3.0")

// Logging
val log4jVersion = "2.21.0"
val log4jVersion = "2.21.1"
implementation(group = "org.apache.logging.log4j", name = "log4j-core", version = log4jVersion)
implementation(group = "org.apache.logging.log4j", name = "log4j-jul", version = log4jVersion)
api(group = "org.apache.logging.log4j", name = "log4j-api", version = log4jVersion)
implementation(group = "org.apache.logging.log4j", name = "log4j-iostreams", version = log4jVersion)
implementation(group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version = "2.21.1")
implementation(group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version = log4jVersion)
implementation(group = "com.lmax", name = "disruptor", version = "3.4.4")
kapt(group = "org.apache.logging.log4j", name = "log4j-core", version = log4jVersion)
implementation(group = "org.slf4j", name = "slf4j-api", version = "2.0.9")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal data class PlayerHurtPacket(
val critical: Boolean,
val pvp: Boolean,
val cooldownCounter: Int,
val reason: PlayerDamageReason
val reason: PlayerDamageReason,
) : Packet

internal val PlayerHurtEncoder = PacketEncoder<PlayerHurtPacket> { buf, packet ->
Expand All @@ -53,6 +53,7 @@ internal val PlayerHurtEncoder = PacketEncoder<PlayerHurtPacket> { buf, packet -
flags += 0x1
if (packet.pvp)
flags += 0x2
buf.writeByte(flags)
buf.writeByte(packet.cooldownCounter)
}

Expand Down

0 comments on commit 4b28e39

Please sign in to comment.