summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-02-22 00:22:22 +0000
committerKHobbits <rob@khobbits.co.uk>2012-02-22 00:23:04 +0000
commit358edff798e8388a95b2640edd5735b188025c5c (patch)
treea125a40a3d3337622696246c77bb7e198736433e
parent34f13ba89cdb270e42fbc0f0225e0634d80b9676 (diff)
downloadEssentials-358edff798e8388a95b2640edd5735b188025c5c.tar
Essentials-358edff798e8388a95b2640edd5735b188025c5c.tar.gz
Essentials-358edff798e8388a95b2640edd5735b188025c5c.tar.lz
Essentials-358edff798e8388a95b2640edd5735b188025c5c.tar.xz
Essentials-358edff798e8388a95b2640edd5735b188025c5c.zip
Powertools dispatch commands as delayed tasks (should reduce any conflict issues).
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java12
1 files 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;