diff options
author | DerFlash <bte@freenet.de> | 2012-09-13 14:57:02 +0200 |
---|---|---|
committer | DerFlash <bte@freenet.de> | 2012-09-13 14:57:02 +0200 |
commit | 77f7027c50ddbe3899a567173c1b8fbd20d40f41 (patch) | |
tree | 289500b253aa02ab89ba35dae78b6cfd94a1f2d9 /EssentialsXMPP/src/com/earth2me | |
parent | 2d2e6b5e7257430084a37da05fd3ae40d78be3ab (diff) | |
download | Essentials-77f7027c50ddbe3899a567173c1b8fbd20d40f41.tar Essentials-77f7027c50ddbe3899a567173c1b8fbd20d40f41.tar.gz Essentials-77f7027c50ddbe3899a567173c1b8fbd20d40f41.tar.lz Essentials-77f7027c50ddbe3899a567173c1b8fbd20d40f41.tar.xz Essentials-77f7027c50ddbe3899a567173c1b8fbd20d40f41.zip |
Fix problems with async chat event not sending messages to xmpp chat spy
Diffstat (limited to 'EssentialsXMPP/src/com/earth2me')
-rw-r--r-- | EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java index 17827c3c7..c0913e6a9 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.xmpp; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -49,9 +50,18 @@ class EssentialsXMPPPlayerListener implements Listener List<String> users = EssentialsXMPP.getInstance().getSpyUsers(); synchronized (users) { - for (String address : users) + for (final String address : users) { - EssentialsXMPP.getInstance().sendMessage(address, message); + Bukkit.getScheduler().scheduleSyncDelayedTask(ess, new Runnable() + { + @Override + public void run() + { + EssentialsXMPP.getInstance().sendMessage(address, message); + } + + }); + } } } |