diff --git a/Changelog.txt b/Changelog.txt index 461716397..bb2526c00 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -7,7 +7,23 @@ Key: ! Change - Removal -Version 1.5.00-dev +Version 1.5.01-dev + = Fixed bug where the Updater was running on the main thread. + +Version 1.5.00 + + Added Podzol & Red Sand to Excavation + + Added Hardened Clay, Stained Clay, and Packed Ice to Mining blocks + + Added Acacia and Dark Oak to Woodcutting blocks + + Added Salmon, Clownfish, and Pufferfish to Fishing XP + + Added new flowers and grasses to Herbalism XP + + Added option to config.yml which allows players to always catch fish, even when a treasure is found + + Added option to config.yml to override vanilla Minecraft treasures + ! Fishing XP now depends on the type of fish. + ! Woodcutting XP in experience.yml and Woodcutting double drops in config.yml now use the tree species names. Oak is now Generic, and Spruce is now Redwood. + ! Red_Rose was replaced by Poppy, and so the key in experience.yml has been updated accordingly. + - Removed deprecated permission nodes + - Removed "Treasure found!" message +>>>>>>> f0ee708... Updater should not be running on the main thread Version 1.4.08 + Added a new skill; Alchemy. Special thanks to EasyMFnE for creating this! diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index fc101d05c..627917be1 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -29,11 +29,11 @@ import com.gmail.nossr50.listeners.InventoryListener; import com.gmail.nossr50.listeners.PlayerListener; import com.gmail.nossr50.listeners.SelfListener; import com.gmail.nossr50.listeners.WorldListener; -import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.metrics.MetricsManager; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.runnables.CheckDateTask; import com.gmail.nossr50.runnables.SaveTimerTask; +import com.gmail.nossr50.runnables.UpdaterResultAsyncTask; import com.gmail.nossr50.runnables.backups.CleanBackupsTask; import com.gmail.nossr50.runnables.database.UserPurgeTask; import com.gmail.nossr50.runnables.party.PartyAutoKickTask; @@ -57,9 +57,6 @@ import com.gmail.nossr50.util.experience.FormulaManager; import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import net.gravitydevelopment.updater.mcmmo.Updater; -import net.gravitydevelopment.updater.mcmmo.Updater.UpdateResult; -import net.gravitydevelopment.updater.mcmmo.Updater.UpdateType; import net.shatteredlands.shatt.backup.ZipLibrary; public class mcMMO extends JavaPlugin { @@ -258,6 +255,10 @@ public class mcMMO extends JavaPlugin { return updateAvailable; } + public void setUpdateAvailable(boolean available) { + this.updateAvailable = available; + } + public boolean isXPEventEnabled() { return xpEventEnabled; } @@ -377,21 +378,7 @@ public class mcMMO extends JavaPlugin { return; } - Updater updater = new Updater(this, 31030, mcmmo, UpdateType.NO_DOWNLOAD, false); - - if (updater.getResult() != UpdateResult.UPDATE_AVAILABLE) { - this.updateAvailable = false; - return; - } - - if (updater.getLatestType().equals("beta") && !Config.getInstance().getPreferBeta()) { - this.updateAvailable = false; - return; - } - - this.updateAvailable = true; - getLogger().info(LocaleLoader.getString("UpdateChecker.Outdated")); - getLogger().info(LocaleLoader.getString("UpdateChecker.NewAvailable")); + new UpdaterResultAsyncTask(this).runTaskAsynchronously(mcMMO.p); } private void loadConfigFiles() { diff --git a/src/main/java/com/gmail/nossr50/runnables/UpdaterResultAsyncTask.java b/src/main/java/com/gmail/nossr50/runnables/UpdaterResultAsyncTask.java new file mode 100644 index 000000000..522230de7 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/runnables/UpdaterResultAsyncTask.java @@ -0,0 +1,36 @@ +package com.gmail.nossr50.runnables; + +import org.bukkit.scheduler.BukkitRunnable; + +import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.locale.LocaleLoader; + +import net.gravitydevelopment.updater.mcmmo.Updater; + +public class UpdaterResultAsyncTask extends BukkitRunnable { + private mcMMO plugin; + + public UpdaterResultAsyncTask(mcMMO plugin) { + this.plugin = plugin; + } + + @Override + public void run() { + Updater updater = new Updater(plugin, 31030, plugin.mcmmo, Updater.UpdateType.NO_DOWNLOAD, false); + + if (updater.getResult() != Updater.UpdateResult.UPDATE_AVAILABLE) { + plugin.setUpdateAvailable(false); + return; + } + + if (updater.getLatestType().equals("beta") && !Config.getInstance().getPreferBeta()) { + plugin.setUpdateAvailable(false); + return; + } + + plugin.setUpdateAvailable(true); + plugin.getLogger().info(LocaleLoader.getString("UpdateChecker.Outdated")); + plugin.getLogger().info(LocaleLoader.getString("UpdateChecker.NewAvailable")); + } +}