Only warn that a player is AFK when the player is actually AFK when using /r
Fixes
@@ -15,6 +15,7 @@ import io.github.nucleuspowered.nucleus.internal.annotations.RegisterCommand;
import io.github.nucleuspowered.nucleus.internal.command.AbstractCommand;
import io.github.nucleuspowered.nucleus.internal.docgen.annotations.EssentialsEquivalent;
import io.github.nucleuspowered.nucleus.internal.permissions.SuggestedLevel;
+import io.github.nucleuspowered.nucleus.modules.afk.handlers.AFKHandler;
import io.github.nucleuspowered.nucleus.modules.message.handlers.MessageHandler;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
@@ -51,7 +52,9 @@ public class ReplyCommand extends AbstractCommand<CommandSource> {
if (b) {
handler.getLastMessageFrom(Util.getUUID(src)).ifPresent(x -> {
if (x instanceof Player) {
- NucleusProcessing.addToContextOnSuccess(args, () -> AlertOnAfkArgument.getAction(src, (Player)x));
+ plugin.getInternalServiceManager().getService(AFKHandler.class).filter(y -> y.isAfk((Player)x)).ifPresent(k ->
+ NucleusProcessing.addToContextOnSuccess(args, () -> AlertOnAfkArgument.getAction(src, (Player)x))
+ );
}
});
