Skip to content

Commit 18f7474

Browse files
committed
Fix lambda issue
1 parent d05d039 commit 18f7474

File tree

1 file changed

+6
-10
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/player

1 file changed

+6
-10
lines changed

common/src/main/kotlin/com/lambda/module/modules/player/AutoReply.kt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,14 @@ object AutoReply : Module(
1414
defaultTags = setOf(ModuleTag.PLAYER)
1515
){
1616
init{
17-
listener<PacketEvent.Receive.Post>{ event ->
18-
val packet = event.packet;
17+
listener<PacketEvent.Receive.Pre>{ event ->
18+
val packet = event.packet
1919
if (packet !is GameMessageS2CPacket) return@listener
20-
if (!packet.content.string.contains("Coords", true)) return@listener
21-
if (!packet.content.string.contains(" whispers: ", true)) return@listener
22-
var msg = packet.content.string
20+
val msg = packet.content.string
21+
if (!msg.contains("Coords", true)) return@listener
22+
if (!msg.contains(" whispers: ")) return@listener
2323
val sender = msg.split(" whispers: ").first()
24-
connection.sendChatCommand("w $sender ${player.pos.string} [${world.dimension.toString()}]")
25-
26-
27-
24+
connection.sendChatCommand("w $sender ${player.pos.string} [${world.dimension}]")
2825
}
2926
}
30-
3127
}

0 commit comments

Comments
 (0)