diff --git a/src/main/java/xyz/nkomarn/Harbor/task/Checker.java b/src/main/java/xyz/nkomarn/Harbor/task/Checker.java index 530f69b..d8182e2 100644 --- a/src/main/java/xyz/nkomarn/Harbor/task/Checker.java +++ b/src/main/java/xyz/nkomarn/Harbor/task/Checker.java @@ -39,6 +39,8 @@ public class Checker implements Runnable { world.getPlayers().forEach(player -> Messages.sendActionBarMessage(player, Config.getString("messages.actionbar.everyone"))); skippingWorlds.add(world); + + if (!Config.getBoolean("features.skip")) return; new AccelerateNightTask(world).runTaskTimer(Harbor.instance, 0L, 1); Messages.sendRandomChatMessage(world, "messages.chat.accelerateNight"); } diff --git a/src/main/java/xyz/nkomarn/Harbor/util/Updater.java b/src/main/java/xyz/nkomarn/Harbor/util/Updater.java index 13734d0..81c5783 100644 --- a/src/main/java/xyz/nkomarn/Harbor/util/Updater.java +++ b/src/main/java/xyz/nkomarn/Harbor/util/Updater.java @@ -24,7 +24,7 @@ public class Updater { try { URL latestVersion = new URL("https://api.spigotmc.org/legacy/update.php?resource=60088"); URLConnection request = latestVersion.openConnection(); - request.addRequestProperty("User-Agent", "Harbor"); + request.addRequestProperty("User-Agent", "Harbor"); request.connect(); InputStream inputStream = request.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); @@ -51,7 +51,7 @@ public class Updater { URL downloadURL = new URL("http://aqua.api.spiget.org/v2/resources/60088/download"); File updatedJarFile = new File("plugins" + File.separator + "update" + File.separator + jarName); - updatedJarFile.mkdirs(); // TODO don't ignore result + updatedJarFile.mkdirs(); InputStream inputStream = downloadURL.openStream(); Files.copy(inputStream, Paths.get(updatedJarFile.toURI()), StandardCopyOption.REPLACE_EXISTING); future.complete("Updated Harbor. Changes will take effect after a server reload/reboot."); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d381896..4fcf41d 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -10,7 +10,7 @@ values: timer: 2 # How often (in seconds) to run the clock task (used to detect sleep, AFK players, time actionbar, etc.) - percent: 100 # Percent of players that need to sleep to skip night (must be between 0 to 100) + percent: 50 # Percent of players that need to sleep to skip night (must be between 0 to 100) interval: 60 # Time skip interval that is added when the night get accelerated. features: @@ -19,7 +19,7 @@ features: phantoms: false # Reset the sleep statistic (practically disables phantom spawns - false = no phantoms) bypass: true # Toggle exclusion of operators/players with permission "harbor.bypass" from sleep count ignore: true # Toggle exclusion of players in creative and spectator mode - afk: true # Detect AFK players and remove them from the sleep count (Essentials/API used for detection) + afk: true # Detect AFK players and remove them from the sleep count (Essentials API used for detection) notifier: true # Displays a notification when a new update is released messages: