Skip to content

Commit

Permalink
2.0.3
Browse files Browse the repository at this point in the history
1. Added config option to disable update checking
2. 1.21 minecraft version support
  • Loading branch information
DVDishka committed Jun 14, 2024
1 parent 9aef1e5 commit 5bc8635
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

<groupId>ru.dvdishka</groupId>
<artifactId>Backuper</artifactId>
<version>2.0.2</version>
<version>2.0.3</version>
<packaging>jar</packaging>

<name>Backuper</name>

<description>Backuper plugin for spigot</description>
<properties>
<java.version>1.8</java.version>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<url>dvdserv.ru</url>
Expand Down Expand Up @@ -92,7 +92,7 @@
<dependency>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-bukkit-shade</artifactId>
<version>9.4.2</version>
<version>9.5.0</version>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ public static void checkOperatingSystem() {

public static void checkPluginVersion() {

if (!Config.getInstance().isCheckUpdates()) {
return;
}

try {

HttpURLConnection connection = (HttpURLConnection) Utils.getLatestVersionURL.openConnection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class Config {
private boolean betterLogging = false;
private boolean setWorldsReadOnly = false;
private boolean alertOnlyServerRestart = true;
private boolean checkUpdates = true;

private static Config instance = null;

Expand Down Expand Up @@ -99,6 +100,7 @@ public void load(File configFile, CommandSender sender) {
this.alertTimeBeforeRestart = config.getLong("alertTimeBeforeRestart", 60);
this.setWorldsReadOnly = config.getBoolean("setWorldsReadOnly", false);
this.alertOnlyServerRestart = config.getBoolean("alertOnlyServerRestart", true);
this.checkUpdates = config.getBoolean("checkUpdates", true);

if (this.backupTime < -1) {
Logger.getLogger().warn("Failed to load config value!");
Expand Down Expand Up @@ -135,7 +137,7 @@ public void load(File configFile, CommandSender sender) {
List<String> configFields = List.of("backupTime", "backupPeriod", "afterBackup", "maxBackupsNumber",
"maxBackupsWeight", "zipArchive", "betterLogging", "autoBackup", "lastBackup", "lastChange",
"skipDuplicateBackup", "backupsFolder", "alertTimeBeforeRestart", "addDirectoryToBackup",
"excludeDirectoryFromBackup", "setWorldsReadOnly", "alertOnlyServerRestart");
"excludeDirectoryFromBackup", "setWorldsReadOnly", "alertOnlyServerRestart", "checkUpdates");

for (String configField : configFields) {
if (isConfigFileOk && !config.contains(configField)) {
Expand Down Expand Up @@ -173,6 +175,7 @@ public void load(File configFile, CommandSender sender) {
newConfig.set("excludeDirectoryFromBackup", this.excludeDirectoryFromBackup);
newConfig.set("setWorldsReadOnly", this.setWorldsReadOnly);
newConfig.set("alertOnlyServerRestart", this.alertOnlyServerRestart);
newConfig.set("checkUpdates", this.checkUpdates);

try {

Expand Down Expand Up @@ -273,4 +276,8 @@ public boolean isSetWorldsReadOnly() {
public boolean isAlertOnlyServerRestart() {
return alertOnlyServerRestart;
}

public boolean isCheckUpdates() {
return checkUpdates;
}
}
5 changes: 3 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ configVersion: 7.0
lastBackup: 0
lastChange: 0


# (true/false) Automatic backup once in a specified period
autoBackup: true

Expand Down Expand Up @@ -46,4 +45,6 @@ alertOnlyServerRestart: true
# (true/false) Better logging (Some statistic and other information for debugging, you probably don't need it)
betterLogging: false
# (true/false) (True recommended) The backuper will mark all world folders as Read Only to prevent folder changing that may cause the backup crash. True value may cause access denied errors during the backup (you should just ignore that)
setWorldsReadOnly: false
setWorldsReadOnly: false
# (true/false) Check for new versions of the Backuper to stay up to date
checkUpdates: true

0 comments on commit 5bc8635

Please sign in to comment.