This commit is contained in:
rockyhawk64 2021-04-03 12:32:10 +11:00
parent 1a42ecfb02
commit 46a7dd13b4
2 changed files with 9 additions and 4 deletions

View File

@ -96,6 +96,9 @@ public class CommandPanels extends JavaPlugin{
public void onEnable() {
Bukkit.getLogger().info("[CommandPanels] RockyHawk's CommandPanels v" + this.getDescription().getVersion() + " Plugin Loading...");
//set version to latest version
updater.githubNewUpdate(false);
//register config files
this.panelsf = new File(this.getDataFolder() + File.separator + "panels");
this.blockConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder() + File.separator + "blocks.yml"));
@ -223,9 +226,6 @@ public class CommandPanels extends JavaPlugin{
//get tag
tag = tex.papi(config.getString("config.format.tag") + " ");
//set version to latest version
updater.githubNewUpdate(false);
Bukkit.getLogger().info("[CommandPanels] RockyHawk's CommandPanels v" + this.getDescription().getVersion() + " Plugin Loaded!");
}

View File

@ -52,6 +52,11 @@ public class Updater {
}
public void getLatestVersion(boolean sendMessages){
//check for null
if(catchedLatestVersion.equals("null")){
catchedLatestVersion = plugin.getDescription().getVersion();
}
//using an array allows editing while still being final
new BukkitRunnable(){
public void run(){
@ -76,7 +81,7 @@ public class Updater {
//the pluginFileName can only be obtained from the main class
public void autoUpdatePlugin(String pluginFileName){
String latestVersion = githubNewUpdate(false);
String latestVersion = catchedLatestVersion;
String thisVersion = plugin.getDescription().getVersion();
if(downloadVersionManually != null) {