diff --git a/lophine-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StartCommand.java b/lophine-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StartCommand.java index 402e9b0..ef2df9c 100644 --- a/lophine-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StartCommand.java +++ b/lophine-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StartCommand.java @@ -56,11 +56,13 @@ public class StartCommand extends LiteralNode { ServerBot bot = getBot(context); CommandSender sender = context.getSender(); - action.loadCommand(context); - if (bot.addBotAction(action, sender)) { + // Create a new instance of the action to avoid sharing state between multiple actions + AbstractBotAction newAction = action.create(); + newAction.loadCommand(context); + if (bot.addBotAction(newAction, sender)) { sender.sendMessage(join(spaces(), text("Action", GRAY), - text(action.getName(), AQUA).hoverEvent(showText(text(action.getActionDataString()))), + text(newAction.getName(), AQUA).hoverEvent(showText(text(newAction.getActionDataString()))), text("has been issued to", GRAY), asAdventure(bot.getDisplayName()) )); diff --git a/lophine-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StopCommand.java b/lophine-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StopCommand.java index 4f9b0fc..c236a0f 100644 --- a/lophine-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StopCommand.java +++ b/lophine-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StopCommand.java @@ -141,13 +141,13 @@ public class StopCommand extends LiteralNode { if (canceled.isEmpty()) { sender.sendMessage(join(spaces(), asAdventure(bot.getDisplayName()).append(text("'s", GRAY)), - text("'s action list cleared", GRAY) + text("action list cleared", GRAY) )); } else { sender.sendMessage(join(spaces(), text("Tried to clear", GRAY), asAdventure(bot.getDisplayName()).append(text("'s", GRAY)), - text("'s action list, but following actions' stop was canceled by plugin:", GRAY) + text("action list, but following actions' stop was canceled by plugin:", GRAY) )); for (AbstractBotAction action : canceled) { context.getSender().sendMessage(