From 781d0eaa564cae464255f5d911c980db409f836e Mon Sep 17 00:00:00 2001 From: Suisuroru Date: Fri, 24 Jan 2025 14:49:02 +0800 Subject: [PATCH 1/3] [skip]feat(tab): add /kill command for item completion -Added completion of the 'items' option in the KillTab class -Improved the user experience of the/kill command --- .../java/fun/suya/suisuroru/commands/tab/vanilla/KillTab.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/fun/suya/suisuroru/commands/tab/vanilla/KillTab.java b/src/main/java/fun/suya/suisuroru/commands/tab/vanilla/KillTab.java index 20b8c92..3f133e0 100644 --- a/src/main/java/fun/suya/suisuroru/commands/tab/vanilla/KillTab.java +++ b/src/main/java/fun/suya/suisuroru/commands/tab/vanilla/KillTab.java @@ -23,6 +23,7 @@ public List onTabComplete(@NotNull CommandSender sender, @NotNull Comman completions.add("@a"); completions.add("@p"); completions.add("@r"); + completions.add("items"); } else if (args.length == 2) { if (args[0].matches("@[earp]")) { completions.add("sort="); From 6e870b546eda48d29868bbe2bfbb8eb0c6bea677 Mon Sep 17 00:00:00 2001 From: Suisuroru Date: Fri, 24 Jan 2025 14:51:06 +0800 Subject: [PATCH 2/3] [skip] fix(commands): optimize the entity selection logic of the/kill command - modified the processing logic for the @ e selector and added type=! The inspection -Optimized the display of error messages and improved the accuracy of user feedback -Adjusted the code structure, improved readability and maintainability --- .../commands/execute/vanilla/Kill.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/fun/suya/suisuroru/commands/execute/vanilla/Kill.java b/src/main/java/fun/suya/suisuroru/commands/execute/vanilla/Kill.java index 03b6442..8db7753 100644 --- a/src/main/java/fun/suya/suisuroru/commands/execute/vanilla/Kill.java +++ b/src/main/java/fun/suya/suisuroru/commands/execute/vanilla/Kill.java @@ -13,16 +13,16 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command sender.sendMessage("您没有权限这么做"); return true; } - switch (args[0]) { - case "@e" -> { - if (args[1].isEmpty()) { - Command.broadcastCommandMessage(sender, "§c拒绝执行清除全部实体,请指定具体实体类型"); - return true; - } else if (args[1].contains("type=!")) { - Command.broadcastCommandMessage(sender, "§c拒绝执行清除多类型全部实体,请指定具体实体类型"); - return true; - } + if (args[0].startsWith("@e")) { + if (args[0].equals("@e")) { + Command.broadcastCommandMessage(sender, "§c拒绝执行清除全部实体,请指定具体实体类型"); + return true; + } else if (String.join(" ", args).matches(".*?\\btype\\s*=\\s*!.*")) { + Command.broadcastCommandMessage(sender, "§c拒绝执行清除多类型全部实体,请指定具体实体类型"); + return true; } + } + switch (args[0]) { case "@a" -> { Command.broadcastCommandMessage(sender, "§c拒绝执行清除全部玩家,请选择其他具体实体类型"); return true; @@ -38,6 +38,5 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command return Bukkit.dispatchCommand(sender, "minecraft:kill " + String.join(" ", args)); } } - return true; } } From a1c5a6101a3ad69d4ca7ac7fd16f5af4671bf567 Mon Sep 17 00:00:00 2001 From: Suisuroru Date: Fri, 24 Jan 2025 14:53:18 +0800 Subject: [PATCH 3/3] [skip]ci: modify Skip Publishing Logic - Rename SKIP_UPLOAD variable to SKIP_LEASE to more accurately reflect its functionality -Update condition judgment, use the new SKIP_LEASE variable to determine whether to create a pre release version --- .github/workflows/auto_build_jar.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto_build_jar.yml b/.github/workflows/auto_build_jar.yml index f02c2fa..0d8ba7e 100644 --- a/.github/workflows/auto_build_jar.yml +++ b/.github/workflows/auto_build_jar.yml @@ -56,9 +56,9 @@ jobs: run: | COMMIT_MESSAGE=$(git log -1 --pretty=%B) if [[ "$COMMIT_MESSAGE" == "[skip]"* ]]; then - echo "SKIP_UPLOAD=true" >> $GITHUB_ENV + echo "SKIP_RELEASE=true" >> $GITHUB_ENV else - echo "SKIP_UPLOAD=false" >> $GITHUB_ENV + echo "SKIP_RELEASE=false" >> $GITHUB_ENV fi - name: Update version in plugin.yml @@ -86,7 +86,7 @@ jobs: path: ${{ env.FINAL_JAR_NAME }}.jar - name: Create Pre-Release and Upload JAR file - if: env.SKIP_UPLOAD == 'false' && env.SKIP_BUILD == 'false' + if: env.SKIP_RELEASE == 'false' && env.SKIP_BUILD == 'false' uses: ncipollo/release-action@v1.15.0 with: tag: ${{ env.VERSION }}