forked from Upstream/CommandPanels
3.21.0.0
This commit is contained in:
parent
42dd8ee698
commit
bb50313587
@ -48,7 +48,6 @@ placeholders:
|
||||
start: '{'
|
||||
end: '}'
|
||||
updater:
|
||||
auto-update: false
|
||||
update-checks: true
|
||||
purchase:
|
||||
currency:
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: 3.20.2.0
|
||||
version: 3.21.0.0
|
||||
main: me.rockyhawk.commandpanels.CommandPanels
|
||||
name: CommandPanels
|
||||
author: RockyHawk
|
||||
|
@ -283,7 +283,7 @@ public class CommandPanels extends JavaPlugin{
|
||||
//save files
|
||||
panelData.saveDataFile();
|
||||
inventorySaver.saveInventoryFile();
|
||||
updater.autoUpdatePlugin(this.getFile().getName());
|
||||
updater.updatePlugin(this.getFile().getName());
|
||||
Bukkit.getLogger().info("RockyHawk's CommandPanels Plugin Disabled, aww man.");
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ public class Updater implements Listener {
|
||||
}
|
||||
|
||||
//the pluginFileName can only be obtained from the main class
|
||||
public void autoUpdatePlugin(String pluginFileName){
|
||||
public void updatePlugin(String pluginFileName){
|
||||
if (Objects.requireNonNull(plugin.config.getString("updater.update-checks")).equalsIgnoreCase("false")) {
|
||||
return;
|
||||
}
|
||||
@ -113,23 +113,20 @@ public class Updater implements Listener {
|
||||
String thisVersion = plugin.getDescription().getVersion();
|
||||
|
||||
//manual download, only if it was requested
|
||||
if(downloadVersionManually != null) {
|
||||
if (downloadVersionManually.equals("latest")) {
|
||||
downloadFile(latestVersion, pluginFileName);
|
||||
}else{
|
||||
downloadFile(downloadVersionManually, pluginFileName);
|
||||
}
|
||||
if(downloadVersionManually == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (downloadVersionManually.equals("latest")) {
|
||||
downloadFile(latestVersion, pluginFileName);
|
||||
}else{
|
||||
downloadFile(downloadVersionManually, pluginFileName);
|
||||
}
|
||||
|
||||
if(latestVersion.equals(thisVersion) || thisVersion.contains("-")){
|
||||
//no need to update or running custom version
|
||||
return;
|
||||
}
|
||||
if (Objects.requireNonNull(plugin.config.getString("updater.auto-update")).equalsIgnoreCase("false")) {
|
||||
//return if auto-update is false
|
||||
return;
|
||||
}
|
||||
if(thisVersion.split("\\.")[1].equals(latestVersion.split("\\.")[1]) && thisVersion.split("\\.")[0].equals(latestVersion.split("\\.")[0])){
|
||||
//only update if the latest version is a minor update
|
||||
//the first and second number of the version is the same, updates: [major.major.minor.minor]
|
||||
|
Loading…
Reference in New Issue
Block a user