diff --git a/pom.xml b/pom.xml index fab5d6de..b5881f29 100644 --- a/pom.xml +++ b/pom.xml @@ -125,14 +125,14 @@ 1.7 - + diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index aa509f4b..9e96a52e 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -95,23 +95,28 @@ public class JobsListener implements Listener { } @EventHandler(priority = EventPriority.NORMAL) - public void AsyncPlayerChatEvent(AsyncPlayerChatEvent event) { + public void AsyncPlayerChatEvent(final AsyncPlayerChatEvent event) { if (event.isCancelled()) return; if (Util.getJobsEditorMap().isEmpty()) return; - Player player = event.getPlayer(); + final Player player = event.getPlayer(); if (!Util.getJobsEditorMap().containsKey(player.getUniqueId())) return; - String msg = Util.getJobsEditorMap().remove(player.getUniqueId()); + final String msg = Util.getJobsEditorMap().remove(player.getUniqueId()); if (msg == null) return; - player.performCommand(msg + event.getMessage()); + Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() { + @Override + public void run() { + player.performCommand(msg + event.getMessage()); + } + }); event.setCancelled(true); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index bbe2ae42..8cf95448 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -190,4 +190,4 @@ permissions: default: true jobs.command.edititembonus: description: Grants access to the edititembonus command - default: op \ No newline at end of file + default: op