Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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")) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is trivial to bypass by simply using unicode character escapes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either the unicode character escapes can be resolved or (probably, new dep or much code) better, probably just parse snbt

// 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";
Expand Down