Match npc commands slightly more safely

This commit is contained in:
fullwall 2022-06-25 16:47:48 +08:00
parent 1cdeda5d5d
commit 659a5b17ad

View File

@ -474,7 +474,7 @@ public class CommandTrait extends Trait {
if (command.startsWith("say")) { if (command.startsWith("say")) {
cmd = "npc speak " + command.replaceFirst("say", "").trim() + " --target <p>"; cmd = "npc speak " + command.replaceFirst("say", "").trim() + " --target <p>";
} }
if ((command.startsWith("npc") || command.startsWith("waypoints") || command.startsWith("wp")) if ((command.startsWith("npc ") || command.startsWith("waypoints ") || command.startsWith("wp "))
&& !command.contains("--id <id>")) { && !command.contains("--id <id>")) {
cmd += " --id <id>"; cmd += " --id <id>";
} }