Bladeren bron

fix afk

Closes #98
MasterCake 3 jaren geleden
bovenliggende
commit
bc2ba9bb14
2 gewijzigde bestanden met toevoegingen van 4 en 2 verwijderingen
  1. 2 2
      Plugin/src/main/java/de/Linus122/TimeIsMoney/Main.java
  2. 2 0
      Plugin/src/main/resources/config.yml

+ 2 - 2
Plugin/src/main/java/de/Linus122/TimeIsMoney/Main.java

@@ -156,7 +156,7 @@ public class Main extends JavaPlugin {
 		
 		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);
@@ -338,7 +338,7 @@ public class Main extends JavaPlugin {
 		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;

+ 2 - 0
Plugin/src/main/resources/config.yml

@@ -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