Only send AFK message when player is online.

This commit is contained in:
cnaude 2015-12-08 22:56:07 -07:00
parent 25775081d7
commit bcad2b3e5e
3 changed files with 11 additions and 12 deletions

View File

@ -26,7 +26,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
@ -34,7 +34,7 @@
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<version>2.4.2</version>
<executions>
<execution>
<phase>package</phase>
@ -344,7 +344,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<version>4.12</version>
<scope>test</scope>
<exclusions>
<exclusion>
@ -356,7 +356,7 @@
<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>junit-benchmarks</artifactId>
<version>0.4.0</version>
<version>0.7.2</version>
<scope>test</scope>
</dependency>
</dependencies>

11
pom.xml
View File

@ -350,14 +350,14 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<version>4.12</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>junit-benchmarks</artifactId>
<version>0.4.0</version>
<version>0.7.2</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -384,7 +384,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
@ -394,7 +394,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<version>2.4.2</version>
<executions>
<execution>
<phase>package</phase>
@ -440,9 +440,6 @@
<exec dir="../${project.name}/target" executable="scp">
<arg line="PurpleIRC.jar cnaude@h.cnaude.org:spigottest/plugins/PurpleIRC.jar"/>
</exec>
<exec dir="../${project.name}/target" executable="scp">
<arg line="PurpleIRC.jar cnaude@h.cnaude.org:spigottest2/plugins/PurpleIRC.jar"/>
</exec>
</tasks>
</configuration>
<goals>

View File

@ -48,7 +48,9 @@ public class EssentialsListener implements Listener {
IUser user = event.getAffected();
plugin.logDebug("AFK: " + user.getName() + ":" + user.isAfk());
for (PurpleBot ircBot : plugin.ircBots.values()) {
ircBot.essentialsAFK(user.getBase(), !user.isAfk());
if (user.getBase().isOnline()) {
ircBot.essentialsAFK(user.getBase(), !user.isAfk());
}
}
}
}