Added AFK messages (#12)

This commit is contained in:
Norbi Peti 2016-12-11 01:31:16 +01:00
parent 39491efaba
commit 30266c318e
2 changed files with 15 additions and 0 deletions

View file

@ -112,6 +112,10 @@
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>Essentials</id>
<url>http://repo.ess3.net/</url>
</repository>
</repositories>
<dependencies>
@ -152,5 +156,10 @@
<version>master-SNAPSHOT</version> <!-- 1.6 -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.ess3</groupId>
<artifactId>Essentials</artifactId>
<version>2.13.1</version>
</dependency>
</dependencies>
</project>

View file

@ -13,6 +13,7 @@ import buttondevteam.lib.TBMCPlayerGetInfoEvent;
import buttondevteam.lib.TBMCPlayerJoinEvent;
import buttondevteam.lib.TBMCPlayerQuitEvent;
import buttondevteam.lib.TBMCYEEHAWEvent;
import net.ess3.api.events.AfkStatusChangeEvent;
import sx.blah.discord.handle.obj.IUser;
import sx.blah.discord.handle.obj.Status.StatusType;
@ -59,4 +60,9 @@ public class MCListener implements Listener {
public void onPlayerYEEHAW(TBMCYEEHAWEvent e) {
DiscordPlugin.sendMessageToChannel(DiscordPlugin.chatchannel, e.getSender() + " YEEHAWs");
}
public void onPlayerAFK(AfkStatusChangeEvent e) {
DiscordPlugin.sendMessageToChannel(DiscordPlugin.chatchannel,
e.getAffected().getBase().getDisplayName() + " is " + (e.getValue() ? "now" : "no longer") + " AFK.");
}
}