From e6ea79437ccbaf59aa408f152aef59a6841d0394 Mon Sep 17 00:00:00 2001 From: zhangyuheng Date: Sun, 9 Jun 2024 23:31:56 +0800 Subject: [PATCH] =?UTF-8?q?cui=E6=96=B0=E5=A2=9E=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lunadeer/minecraftpluginutils/scui/CuiTextInput.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiTextInput.java b/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiTextInput.java index 64b755d..3e13791 100644 --- a/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiTextInput.java +++ b/src/main/java/cn/lunadeer/minecraftpluginutils/scui/CuiTextInput.java @@ -29,6 +29,7 @@ public class CuiTextInput implements CuiView { private final Map buttons = new HashMap<>(); private InputCallback callback_handle_input; private AnvilInventory inv; + private String suggest_command = null; public static CuiTextInput create(InputCallback callback_handle_input) { CuiTextInput cuiTextInput = new CuiTextInput(); @@ -40,6 +41,9 @@ public class CuiTextInput implements CuiView { public void open(Player audience) { if (!isPaper()) { Notification.error(audience, "CUI TextInput 功能在非 Paper 系的服务端上不可用,请使用指令执行对应操作。"); + if (suggest_command != null) { + Notification.info(audience, "参考指令: " + suggest_command); + } return; } // open anvil inventory @@ -138,4 +142,9 @@ public class CuiTextInput implements CuiView { } + public CuiTextInput setSuggestCommand(String command) { + this.suggest_command = command; + return this; + } + }