From 0d495243e545d115402a181a89484466b0fb1253 Mon Sep 17 00:00:00 2001 From: youpaishidifu <1@ypshidifu.cn> Date: Thu, 19 Nov 2026 12:35:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC125=E6=89=B9=E7=BB=AD5:=20showDialog?= =?UTF-8?q?=20=E6=94=B9=E4=B8=BA=20player.showDialog(dialog)=20=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=BC=B9=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ClickEvent.showDialog 只是创建点击事件组件(需玩家点聊天才触发) - 改为直接调用 player.showDialog(dialog)(Paper 服务端运行时实现, 发送 Dialog 包给客户端,自动弹出对话框) - 编译通过 EXIT=0 --- src/main/java/Sdf1_login/CustomScreenManager.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/Sdf1_login/CustomScreenManager.java b/src/main/java/Sdf1_login/CustomScreenManager.java index a9f914c..2a1b3a3 100644 --- a/src/main/java/Sdf1_login/CustomScreenManager.java +++ b/src/main/java/Sdf1_login/CustomScreenManager.java @@ -489,10 +489,8 @@ public class CustomScreenManager implements Listener { .type(type) ); - // 发送对话框(通过 ClickEvent.showDialog 触发) - p.sendMessage(Component.empty().clickEvent( - net.kyori.adventure.text.event.ClickEvent.showDialog(dialog) - )); + // 直接调用 player.showDialog(dialog)(Paper 服务端运行时实现,发送 Dialog 包给客户端) + p.showDialog(dialog); plugin.getLogger().info("[自定义屏幕] " + p.getName() + " Java版自定义屏幕已弹出: " + new File(pendingFile).getName());