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