Skip to content

Commit

Permalink
fix afk
Browse files Browse the repository at this point in the history
Closes #98
  • Loading branch information
mastercake10 committed Jul 21, 2021
1 parent 32d8fee commit bc2ba9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Plugin/src/main/java/de/Linus122/TimeIsMoney/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void onEnable() {

loadPayouts();

if (Bukkit.getPluginManager().isPluginEnabled("Essentials")) {
if (Bukkit.getPluginManager().isPluginEnabled("Essentials") && this.getConfig().getBoolean("afk_use_essentials")) {
clogger.sendMessage("Time is Money: Essentials found. Hook in it -> Will use Essentials's AFK feature if afk is enabled.");
}
new Metrics(this);
Expand Down Expand Up @@ -338,7 +338,7 @@ private void pay(Player p) {
double afkPercent = 0.0D;
if (!p.hasPermission("tim.afkbypass")) {
//ESENTIALS_AFK_FEATURE
if (Bukkit.getServer().getPluginManager().isPluginEnabled("Essentials")) {
if (Bukkit.getServer().getPluginManager().isPluginEnabled("Essentials") && this.getConfig().getBoolean("afk_use_essentials")) {
Essentials essentials = (com.earth2me.essentials.Essentials) Bukkit.getServer().getPluginManager().getPlugin("Essentials");
if (essentials.getUser(p).isAfk()) {
afk = true;
Expand Down
2 changes: 2 additions & 0 deletions Plugin/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ disabled_in_worlds:
afk_payout: false
# If afk payout is enabled, what percent should be paid out?
afk_payout_percent: 10
# Will use essential's AFK feature if available
afk_use_essentials: true

display-messages-in-chat: true
display-messages-in-actionbar: true
Expand Down

0 comments on commit bc2ba9b

Please sign in to comment.