mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-10-31 01:03:44 +01:00 
			
		
		
		
	| @@ -8,6 +8,7 @@ Key: | ||||
|   - Removal | ||||
|  | ||||
| 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 | ||||
|   | ||||
| @@ -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() { | ||||
|   | ||||
| @@ -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")); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 TfT_02
					TfT_02