Skip to content

Commit

Permalink
fix: try to fix proxy packet error
Browse files Browse the repository at this point in the history
  • Loading branch information
jimchen5209 committed Jun 16, 2024
1 parent 21539d8 commit e2e3db6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/kotlin/one/oktw/galaxy/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ class Main : DedicatedServerModInitializer, CoroutineScope {
eventManager = EventManager(server)

// Register Proxy packet receiver
// For Sending Packet to Proxy
PayloadTypeRegistry.playC2S().register(ProxyAPIPayload.ID, ProxyAPIPayload.CODEC)
// For Receiving Packet to Proxy
PayloadTypeRegistry.playS2C().register(ProxyAPIPayload.ID, ProxyAPIPayload.CODEC)
// Register Event
ServerPlayNetworking.registerGlobalReceiver(ProxyAPIPayload.ID) { payload, context ->
eventManager.emit(ProxyResponseEvent(context.player(), payload.packet))
}
Expand Down

0 comments on commit e2e3db6

Please sign in to comment.