From fcc1b80771b7bd2d17cb4e5eb770206e9b049320 Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Wed, 31 Jul 2024 02:28:04 -0400 Subject: [PATCH] Only replace Action player if online, fixes #2269 --- .../java/me/pikamug/quests/actions/BukkitAction.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/me/pikamug/quests/actions/BukkitAction.java b/core/src/main/java/me/pikamug/quests/actions/BukkitAction.java index c766295cc..2fda94933 100644 --- a/core/src/main/java/me/pikamug/quests/actions/BukkitAction.java +++ b/core/src/main/java/me/pikamug/quests/actions/BukkitAction.java @@ -359,9 +359,15 @@ public class BukkitAction implements Action { } } if (!commands.isEmpty()) { - for (final String s : commands) { - plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), - s.replace("", quester.getPlayer().getName())); + for (String s : commands) { + if (s.contains("")) { + if (player.isOnline()) { + s = s.replace("", player.getName()); + } else { + continue; + } + } + plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), s); } } if (!potionEffects.isEmpty()) {