Fix say in /npc command

This commit is contained in:
fullwall 2022-06-30 16:10:16 +08:00
parent 58da8489e4
commit 55f8a1f75c

View File

@ -474,8 +474,8 @@ 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 ((cmd.startsWith("npc ") || cmd.startsWith("waypoints ") || cmd.startsWith("wp "))
&& !command.contains("--id ")) { && !cmd.contains("--id ")) {
cmd += " --id <id>"; cmd += " --id <id>";
} }
String interpolatedCommand = Placeholders.replace(cmd, clicker, npc); String interpolatedCommand = Placeholders.replace(cmd, clicker, npc);