mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 22:24:43 +02:00
Replace remaining references to PlotSquared#log
This commit is contained in:
@ -30,12 +30,13 @@ import com.google.gson.JsonParser;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.PlotVersion;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import java.io.IOException;
|
||||
@ -44,6 +45,8 @@ import java.net.URL;
|
||||
|
||||
public class UpdateUtility implements Listener {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UpdateUtility.class);
|
||||
|
||||
public static PlotVersion internalVersion;
|
||||
public static String spigotVersion;
|
||||
public static boolean hasUpdate;
|
||||
@ -68,26 +71,22 @@ public class UpdateUtility implements Listener {
|
||||
.getAsJsonObject();
|
||||
spigotVersion = result.get("current_version").getAsString();
|
||||
} catch (IOException e) {
|
||||
PlotSquared.log(Captions.PREFIX + "&cUnable to check for updates because: " + e);
|
||||
logger.error("Unable to check for updates. Error: {}", e.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (internalVersion.isLaterVersion(spigotVersion)) {
|
||||
PlotSquared
|
||||
.log(Captions.PREFIX + "&6There appears to be a PlotSquared update available!");
|
||||
PlotSquared.log(
|
||||
Captions.PREFIX + "&6You are running version " + internalVersion.versionString()
|
||||
+ ", &6latest version is " + spigotVersion);
|
||||
PlotSquared
|
||||
.log(Captions.PREFIX + "&6https://www.spigotmc.org/resources/77506/updates");
|
||||
logger.info("There appears to be a PlotSquared update available!");
|
||||
logger.info("You are running version {}, the latest version is {}",
|
||||
internalVersion.versionString(), spigotVersion);
|
||||
logger.info("https://www.spigotmc.org/resources/77506/updates");
|
||||
hasUpdate = true;
|
||||
if (Settings.UpdateChecker.NOTIFY_ONCE) {
|
||||
cancelTask();
|
||||
}
|
||||
} else if (notify) {
|
||||
notify = false;
|
||||
PlotSquared.log(Captions.PREFIX
|
||||
+ "Congratulations! You are running the latest PlotSquared version.");
|
||||
logger.info("Congratulations! You are running the latest PlotSquared version");
|
||||
}
|
||||
}, 0L, Settings.UpdateChecker.POLL_RATE * 60 * 20);
|
||||
}
|
||||
|
Reference in New Issue
Block a user