mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-28 12:07:38 +01:00
Adds toggle to disable AFK cancel on interactions
This commit is contained in:
parent
5225fb22f8
commit
88c1b785af
@ -143,6 +143,8 @@ public interface ISettings extends IConf
|
|||||||
boolean getFreezeAfkPlayers();
|
boolean getFreezeAfkPlayers();
|
||||||
|
|
||||||
boolean cancelAfkOnMove();
|
boolean cancelAfkOnMove();
|
||||||
|
|
||||||
|
boolean cancelAfkOnInteract();
|
||||||
|
|
||||||
boolean areDeathMessagesEnabled();
|
boolean areDeathMessagesEnabled();
|
||||||
|
|
||||||
|
@ -469,6 +469,7 @@ public class Settings implements ISettings
|
|||||||
disableItemPickupWhileAfk = _getDisableItemPickupWhileAfk();
|
disableItemPickupWhileAfk = _getDisableItemPickupWhileAfk();
|
||||||
registerBackInListener = _registerBackInListener();
|
registerBackInListener = _registerBackInListener();
|
||||||
cancelAfkOnMove = _cancelAfkOnMove();
|
cancelAfkOnMove = _cancelAfkOnMove();
|
||||||
|
cancelAfkOnInteract = _cancelAfkOnInteract();
|
||||||
getFreezeAfkPlayers = _getFreezeAfkPlayers();
|
getFreezeAfkPlayers = _getFreezeAfkPlayers();
|
||||||
itemSpawnBl = _getItemSpawnBlacklist();
|
itemSpawnBl = _getItemSpawnBlacklist();
|
||||||
loginAttackDelay = _getLoginAttackDelay();
|
loginAttackDelay = _getLoginAttackDelay();
|
||||||
@ -831,6 +832,19 @@ public class Settings implements ISettings
|
|||||||
{
|
{
|
||||||
return config.getBoolean("cancel-afk-on-move", true);
|
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
|
@Override
|
||||||
public boolean areDeathMessagesEnabled()
|
public boolean areDeathMessagesEnabled()
|
||||||
|
@ -530,7 +530,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||||||
|
|
||||||
public void updateActivity(final boolean broadcast)
|
public void updateActivity(final boolean broadcast)
|
||||||
{
|
{
|
||||||
if (isAfk())
|
if (isAfk() && ess.getSettings().cancelAfkOnInteract())
|
||||||
{
|
{
|
||||||
setAfk(false);
|
setAfk(false);
|
||||||
if (broadcast && !isHidden())
|
if (broadcast && !isHidden())
|
||||||
|
@ -317,8 +317,12 @@ freeze-afk-players: false
|
|||||||
# Enable this, when you don't want people idling in mob traps.
|
# Enable this, when you don't want people idling in mob traps.
|
||||||
disable-item-pickup-while-afk: false
|
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?
|
# 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.
|
# Disable this to reduce server lag.
|
||||||
cancel-afk-on-move: true
|
cancel-afk-on-move: true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user