mirror of
https://github.com/cnaude/PurpleIRC-spigot.git
synced 2024-11-25 19:45:54 +01:00
Only send AFK message when player is online.
This commit is contained in:
parent
bcad2b3e5e
commit
7885a0a398
@ -82,9 +82,6 @@
|
||||
<exec>
|
||||
<arg />
|
||||
</exec>
|
||||
<exec>
|
||||
<arg />
|
||||
</exec>
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -45,12 +45,17 @@ public class EssentialsListener implements Listener {
|
||||
*/
|
||||
@EventHandler
|
||||
public void onAfkStatusChangeEvent(AfkStatusChangeEvent event) {
|
||||
IUser user = event.getAffected();
|
||||
final IUser user = event.getAffected();
|
||||
plugin.logDebug("AFK: " + user.getName() + ":" + user.isAfk());
|
||||
plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (PurpleBot ircBot : plugin.ircBots.values()) {
|
||||
if (user.getBase().isOnline()) {
|
||||
ircBot.essentialsAFK(user.getBase(), !user.isAfk());
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 20);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user