summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunfighterJ <joseph.jenniges@gmail.com>2013-02-02 22:48:39 -0600
committerGunfighterJ <joseph.jenniges@gmail.com>2013-02-02 23:06:09 -0600
commitd2ff2d32a768f721d46bab44e1ab7c4ac0676547 (patch)
tree21c9995e120a9ccfe7037dd62b70a2f153f31b01
parent24cf09a540ac1ce1516377afe766872c3489adc0 (diff)
downloadEssentials-d2ff2d32a768f721d46bab44e1ab7c4ac0676547.tar
Essentials-d2ff2d32a768f721d46bab44e1ab7c4ac0676547.tar.gz
Essentials-d2ff2d32a768f721d46bab44e1ab7c4ac0676547.tar.lz
Essentials-d2ff2d32a768f721d46bab44e1ab7c4ac0676547.tar.xz
Essentials-d2ff2d32a768f721d46bab44e1ab7c4ac0676547.zip
Adds toggle to disable AFK cancel on interactions
-rw-r--r--Essentials/src/com/earth2me/essentials/ISettings.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/Settings.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java2
-rw-r--r--Essentials/src/config.yml6
4 files changed, 22 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java
index c58ffa8e7..f72969f5b 100644
--- a/Essentials/src/com/earth2me/essentials/ISettings.java
+++ b/Essentials/src/com/earth2me/essentials/ISettings.java
@@ -143,6 +143,8 @@ public interface ISettings extends IConf
boolean getFreezeAfkPlayers();
boolean cancelAfkOnMove();
+
+ boolean cancelAfkOnInteract();
boolean areDeathMessagesEnabled();
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java
index 95123d051..a16c9a01f 100644
--- a/Essentials/src/com/earth2me/essentials/Settings.java
+++ b/Essentials/src/com/earth2me/essentials/Settings.java
@@ -469,6 +469,7 @@ public class Settings implements ISettings
disableItemPickupWhileAfk = _getDisableItemPickupWhileAfk();
registerBackInListener = _registerBackInListener();
cancelAfkOnMove = _cancelAfkOnMove();
+ cancelAfkOnInteract = _cancelAfkOnInteract();
getFreezeAfkPlayers = _getFreezeAfkPlayers();
itemSpawnBl = _getItemSpawnBlacklist();
loginAttackDelay = _getLoginAttackDelay();
@@ -831,6 +832,19 @@ public class Settings implements ISettings
{
return config.getBoolean("cancel-afk-on-move", true);
}
+
+ private boolean cancelAfkOnInteract;
+
+ @Override
+ public boolean cancelAfkOnInteract()
+ {
+ return cancelAfkOnInteract;
+ }
+
+ private boolean _cancelAfkOnInteract()
+ {
+ return config.getBoolean("cancel-afk-on-interact", true);
+ }
@Override
public boolean areDeathMessagesEnabled()
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index 6fce1c087..3a6b42781 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -530,7 +530,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
public void updateActivity(final boolean broadcast)
{
- if (isAfk())
+ if (isAfk() && ess.getSettings().cancelAfkOnInteract())
{
setAfk(false);
if (broadcast && !isHidden())
diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml
index bf5523e5a..409be971c 100644
--- a/Essentials/src/config.yml
+++ b/Essentials/src/config.yml
@@ -317,8 +317,12 @@ freeze-afk-players: false
# Enable this, when you don't want people idling in mob traps.
disable-item-pickup-while-afk: false
+# This setting controls if a player is marked as active on interaction.
+# When this setting is false, you will need to manually un-AFK using the /afk command.
+cancel-afk-on-interact: true
+
# Should we automatically remove afk status when the player moves?
-# Player will be removed from afk on chat/command regardless of this setting.
+# Player will be removed from AFK on chat/command regardless of this setting.
# Disable this to reduce server lag.
cancel-afk-on-move: true