diff --git a/src/main/java/me/blackvein/quests/Event.java b/src/main/java/me/blackvein/quests/Event.java index 1e538614b..e107c0c67 100644 --- a/src/main/java/me/blackvein/quests/Event.java +++ b/src/main/java/me/blackvein/quests/Event.java @@ -230,19 +230,7 @@ public class Event { } if (commands.isEmpty() == false) { for (String s : commands) { - if (!Bukkit.isPrimaryThread()) { - new BukkitRunnable() { - - @Override - public void run() { - quester.plugin.getServer().dispatchCommand(quester.plugin.getServer().getConsoleSender(), s.replaceAll("<player>", quester.getPlayer().getName())); - - } - - }.runTask(this.plugin); - } else { - quester.plugin.getServer().dispatchCommand(quester.plugin.getServer().getConsoleSender(), s.replaceAll("<player>", quester.getPlayer().getName())); - } + quester.plugin.getServer().dispatchCommand(quester.plugin.getServer().getConsoleSender(), s.replaceAll("<player>", quester.getPlayer().getName())); } } if (potionEffects.isEmpty() == false) { diff --git a/src/main/java/me/blackvein/quests/PlayerListener.java b/src/main/java/me/blackvein/quests/PlayerListener.java index 93bfd8c57..941393052 100644 --- a/src/main/java/me/blackvein/quests/PlayerListener.java +++ b/src/main/java/me/blackvein/quests/PlayerListener.java @@ -59,6 +59,7 @@ import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerShearEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.projectiles.ProjectileSource; +import org.bukkit.scheduler.BukkitRunnable; import com.sk89q.worldguard.protection.managers.RegionManager; import com.sk89q.worldguard.protection.regions.ProtectedRegion; @@ -307,7 +308,13 @@ public class PlayerListener implements Listener { for (String s : currentStage.chatEvents.keySet()) { if (s.equalsIgnoreCase(chat)) { if (quester.getQuestData(quest).eventFired.get(s) == null || quester.getQuestData(quest).eventFired.get(s) == false) { - currentStage.chatEvents.get(s).fire(quester, quest); + new BukkitRunnable() { + @Override + public void run() { + currentStage.chatEvents.get(s).fire(quester, quest); + } + + }.runTask(this.plugin); quester.getQuestData(quest).eventFired.put(s, true); } }