From 358edff798e8388a95b2640edd5735b188025c5c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 22 Feb 2012 00:22:22 +0000 Subject: [PATCH] Powertools dispatch commands as delayed tasks (should reduce any conflict issues). --- .../essentials/EssentialsPlayerListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index a3b4559a2..9b964364b 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -370,7 +370,7 @@ public class EssentialsPlayerListener implements Listener } boolean used = false; // We need to loop through each command and execute - for (String command : commandList) + for (final String command : commandList) { if (command.matches(".*\\{player\\}.*")) { @@ -385,7 +385,15 @@ public class EssentialsPlayerListener implements Listener else { used = true; - user.getServer().dispatchCommand(user.getBase(), command); + ess.scheduleSyncDelayedTask( + new Runnable() + { + @Override + public void run() + { + user.getServer().dispatchCommand(user.getBase(), command); + } + }); } } return used;