Skip to content

Commit

Permalink
[6.1.0][dev] 更新 UI 模块
Browse files Browse the repository at this point in the history
  • Loading branch information
Bkm016 committed Jan 28, 2024
1 parent 85ebb26 commit 316f659
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ abstract class InventoryHandler {
@Ghost
@SubscribeEvent
private fun onReceive(e: PacketReceiveEvent) {
// 如果没有正在开启的页面则不处理
if (playerRemoteInventoryMap.isEmpty()) {
return
}
when (e.packet.name) {
// 关闭窗口
"PacketPlayInCloseWindow" -> {
// 如果没有正在开启的页面则不处理
if (playerRemoteInventoryMap.isEmpty()) {
return
}
val id = e.packet.read<Int>(if (MinecraftVersion.isUniversal) "containerId" else "id")!!
val player = e.player
val remoteInventory = playerRemoteInventoryMap[player.name]
Expand All @@ -93,6 +93,10 @@ abstract class InventoryHandler {
}
// 点击
"PacketPlayInWindowClick" -> {
// 如果没有正在开启的页面则不处理
if (playerRemoteInventoryMap.isEmpty()) {
return
}
val id = e.packet.read<Int>(if (MinecraftVersion.isUniversal) "containerId" else "a")!!
val player = e.player
val remoteInventory = playerRemoteInventoryMap[player.name]
Expand Down

0 comments on commit 316f659

Please sign in to comment.