From 99b91b8bf29c7ecb1b716c7e7d283eec962a9883 Mon Sep 17 00:00:00 2001 From: mirkoa Date: Wed, 23 Sep 2026 15:26:49 +0200 Subject: [PATCH 1/2] feat: disallow can_close_with_escape in dialogs --- .factorypath | 55 +++++++++++++++++++ .../extras/modules/server/ServerCommand.java | 8 +++ 2 files changed, 63 insertions(+) create mode 100644 .factorypath diff --git a/.factorypath b/.factorypath new file mode 100644 index 0000000..75a95c0 --- /dev/null +++ b/.factorypath @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java b/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java index 8ee6455..5b5cc9e 100644 --- a/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java +++ b/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java @@ -1,6 +1,7 @@ package pw.kaboom.extras.modules.server; import com.google.common.collect.ImmutableSet; + import org.bukkit.block.CommandBlock; import org.bukkit.command.BlockCommandSender; import org.bukkit.command.CommandSender; @@ -137,6 +138,13 @@ public static String checkCommand(final CommandSender sender, final String comma "/me" -> { return checkSelectors(arr, 1); } + case "/minecraft:dialog", "/dialog" -> { + if (command.contains("can_close_with_escape")) { + // you can put whatever in the snbt string it if's a correct dialog + // TODO: in the future possibly parse the NBT and limit other things + return command.replaceAll("can_close_with_escape", "can_close_with_escaqe"); + } + } case "/minecraft:spreadplayers", "/spreadplayers" -> { if (arr.length == 7 && (arr[6].contains("@e") || arr[6].contains("@a"))) { return "cancel"; From 08a130f538ea1b3a336f06723fb8c7bd323309a8 Mon Sep 17 00:00:00 2001 From: mirkoa Date: Thu, 24 Sep 2026 18:49:13 +0200 Subject: [PATCH 2/2] remove .factorypath --- .factorypath | 55 ---------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 .factorypath diff --git a/.factorypath b/.factorypath deleted file mode 100644 index 75a95c0..0000000 --- a/.factorypath +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -