From 4f1f9523e89c88efb9a56b0733c91dee6f94e0b5 Mon Sep 17 00:00:00 2001 From: Jsinco Date: Thu, 12 Dec 2024 20:14:00 -0500 Subject: [PATCH] Honestly overkill, allows addons to check for updates though --- .../java/com/dre/brewery/BreweryPlugin.java | 13 +-- .../commands/subcommands/VersionCommand.java | 6 +- .../brewery/configuration/files/Config.java | 4 +- .../dre/brewery/listeners/PlayerListener.java | 3 +- .../dre/brewery/utility/UpdateChecker.java | 102 ---------------- .../utility/releases/ReleaseChecker.java | 109 ++++++++++++++++++ .../releases/impl/GitHubReleaseChecker.java | 79 +++++++++++++ .../releases/impl/NoImplReleaseChecker.java | 49 ++++++++ .../releases/impl/SpigotReleaseChecker.java | 62 ++++++++++ src/main/resources/config-langs/de.yml | 4 +- src/main/resources/config-langs/en.yml | 4 +- src/main/resources/config-langs/es.yml | 4 +- src/main/resources/config-langs/fr.yml | 4 +- src/main/resources/config-langs/it.yml | 4 +- src/main/resources/config-langs/ru.yml | 4 +- src/main/resources/config-langs/zh.yml | 4 +- 16 files changed, 327 insertions(+), 128 deletions(-) delete mode 100644 src/main/java/com/dre/brewery/utility/UpdateChecker.java create mode 100644 src/main/java/com/dre/brewery/utility/releases/ReleaseChecker.java create mode 100644 src/main/java/com/dre/brewery/utility/releases/impl/GitHubReleaseChecker.java create mode 100644 src/main/java/com/dre/brewery/utility/releases/impl/NoImplReleaseChecker.java create mode 100644 src/main/java/com/dre/brewery/utility/releases/impl/SpigotReleaseChecker.java diff --git a/src/main/java/com/dre/brewery/BreweryPlugin.java b/src/main/java/com/dre/brewery/BreweryPlugin.java index 02cd3462..48b2fbb5 100644 --- a/src/main/java/com/dre/brewery/BreweryPlugin.java +++ b/src/main/java/com/dre/brewery/BreweryPlugin.java @@ -50,7 +50,7 @@ import com.dre.brewery.storage.StorageInitException; import com.dre.brewery.utility.Logging; import com.dre.brewery.utility.MinecraftVersion; -import com.dre.brewery.utility.UpdateChecker; +import com.dre.brewery.utility.releases.ReleaseChecker; import com.github.Anon8281.universalScheduler.UniversalScheduler; import com.github.Anon8281.universalScheduler.scheduling.schedulers.TaskScheduler; import io.papermc.lib.PaperLib; @@ -76,8 +76,6 @@ @Getter public class BreweryPlugin extends JavaPlugin { - private static final int RESOURCE_ID = 114777; - private @Getter static AddonManager addonManager; private @Getter static TaskScheduler scheduler; private @Getter static BreweryPlugin instance; @@ -202,16 +200,17 @@ public void onEnable() { placeholderAPIHook.getInstance().register(); } - if (config.isUpdateCheck()) { - UpdateChecker.run(RESOURCE_ID); - } - Logging.log("Using scheduler&7: &a" + scheduler.getClass().getSimpleName()); Logging.log("Environment&7: &a" + Logging.getEnvironmentAsString()); if (!PaperLib.isPaper()) { Logging.log("&aBreweryX performs best on Paper-based servers. Please consider switching to Paper for the best experience. &7https://papermc.io"); } Logging.log("BreweryX enabled!"); + + ReleaseChecker releaseChecker = ReleaseChecker.getInstance(); + releaseChecker.checkForUpdate().thenAccept(updateAvailable -> { + releaseChecker.notify(Bukkit.getConsoleSender()); + }); } @Override diff --git a/src/main/java/com/dre/brewery/commands/subcommands/VersionCommand.java b/src/main/java/com/dre/brewery/commands/subcommands/VersionCommand.java index 9502cb8a..685d2d96 100644 --- a/src/main/java/com/dre/brewery/commands/subcommands/VersionCommand.java +++ b/src/main/java/com/dre/brewery/commands/subcommands/VersionCommand.java @@ -26,7 +26,7 @@ import com.dre.brewery.commands.SubCommand; import com.dre.brewery.configuration.files.Lang; import com.dre.brewery.utility.Logging; -import com.dre.brewery.utility.UpdateChecker; +import com.dre.brewery.utility.releases.ReleaseChecker; import org.bukkit.command.CommandSender; import java.util.List; @@ -45,7 +45,9 @@ public void execute(BreweryPlugin breweryPlugin, Lang lang, CommandSender sender } } - Logging.msg(sender, "&2BreweryX version&7: &av" + breweryPlugin.getDescription().getVersion() + " &7(Latest: v" + UpdateChecker.getLatestVersion() + ")"); + ReleaseChecker rc = ReleaseChecker.getInstance(); + + Logging.msg(sender, "&2BreweryX version&7: &av" + rc.localVersion() + " &7(Latest: v" + rc.getResolvedLatestVersion() + ")"); Logging.msg(sender, "&2Original authors&7: &aGrafe, TTTheKing, Sn0wStorm"); Logging.msg(sender, "&dBreweryX authors&7: &aJsinco, Mitality, Nadwey, Szarkans, Vutka1"); Logging.msg(sender, "&2Loaded addons&7: &a" + addonString); diff --git a/src/main/java/com/dre/brewery/configuration/files/Config.java b/src/main/java/com/dre/brewery/configuration/files/Config.java index 03c1aa9f..e638badc 100644 --- a/src/main/java/com/dre/brewery/configuration/files/Config.java +++ b/src/main/java/com/dre/brewery/configuration/files/Config.java @@ -20,7 +20,6 @@ package com.dre.brewery.configuration.files; -import com.dre.brewery.BreweryPlugin; import com.dre.brewery.configuration.AbstractOkaeriConfigFile; import com.dre.brewery.configuration.annotation.DefaultCommentSpace; import com.dre.brewery.configuration.annotation.Footer; @@ -34,6 +33,7 @@ import com.dre.brewery.configuration.sector.capsule.ConfiguredDataManager; import com.dre.brewery.storage.DataManagerType; import com.dre.brewery.utility.Logging; +import com.dre.brewery.utility.releases.ReleaseChecker; import eu.okaeri.configs.annotation.Header; import lombok.Getter; import lombok.Setter; @@ -64,7 +64,7 @@ public void onFirstCreation() { private String language = "en"; @LocalizedComment("config.updateCheck") - private boolean updateCheck = true; + private ReleaseChecker.ReleaseCheckerType resolveUpdatesFrom = ReleaseChecker.ReleaseCheckerType.GITHUB; @LocalizedComment("config.autosave") private int autosave = 10; diff --git a/src/main/java/com/dre/brewery/listeners/PlayerListener.java b/src/main/java/com/dre/brewery/listeners/PlayerListener.java index 37565b37..625d23f6 100644 --- a/src/main/java/com/dre/brewery/listeners/PlayerListener.java +++ b/src/main/java/com/dre/brewery/listeners/PlayerListener.java @@ -26,6 +26,7 @@ import com.dre.brewery.configuration.files.Lang; import com.dre.brewery.utility.*; import com.dre.brewery.utility.MaterialUtil; +import com.dre.brewery.utility.releases.ReleaseChecker; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.Sound; @@ -299,11 +300,11 @@ public void onPlayerLogin(PlayerLoginEvent event) { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { - UpdateChecker.notify(event.getPlayer()); BPlayer bplayer = BPlayer.get(event.getPlayer()); if (bplayer != null) { bplayer.join(event.getPlayer()); } + ReleaseChecker.getInstance().notify(event.getPlayer()); } @EventHandler diff --git a/src/main/java/com/dre/brewery/utility/UpdateChecker.java b/src/main/java/com/dre/brewery/utility/UpdateChecker.java deleted file mode 100644 index 731731f6..00000000 --- a/src/main/java/com/dre/brewery/utility/UpdateChecker.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * BreweryX Bukkit-Plugin for an alternate brewing process - * Copyright (C) 2024 The Brewery Team - * - * This file is part of BreweryX. - * - * BreweryX is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BreweryX is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with BreweryX. If not, see . - */ - -package com.dre.brewery.utility; - -import com.dre.brewery.BreweryPlugin; -import com.dre.brewery.configuration.ConfigManager; -import com.dre.brewery.configuration.files.Lang; -import lombok.Getter; -import lombok.Setter; -import org.bukkit.entity.Player; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.Scanner; -import java.util.function.Consumer; -import java.util.logging.Level; - - -/** - * Update Checker modified for BreweryX - */ - -public class UpdateChecker { - - private static final BreweryPlugin plugin = BreweryPlugin.getInstance(); - private static final Lang lang = ConfigManager.getConfig(Lang.class); - - @Getter @Setter - private static String latestVersion = "Unknown"; - @Getter @Setter - private static boolean updateAvailable = false; - - private final int resourceID; - - public UpdateChecker(int resourceID) { - this.resourceID = resourceID; - } - - public static void notify(final Player player) { - if (!updateAvailable || !player.hasPermission("brewery.update")) { - return; - } - - lang.sendEntry(player, "Etc_UpdateAvailable", "v" + plugin.getDescription().getVersion(), "v" + latestVersion); - } - - /** - * Query the API to find the latest approved file's details. - */ - public void query(final Consumer consumer) { - BreweryPlugin.getScheduler().runTaskAsynchronously(() -> { - try (InputStream is = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + resourceID + "/~").openStream(); Scanner scann = new Scanner(is)) { - if (scann.hasNext()) { - consumer.accept(scann.next()); - } - } catch (IOException e) { - plugin.getLogger().log(Level.WARNING, "Cannot look for updates: " + e); - } - }); - } - - public static int parseVersion(String version) { - StringBuilder sb = new StringBuilder(); - for (char c : version.toCharArray()) { - if (Character.isDigit(c)) { - sb.append(c); - } - } - return Integer.parseInt(sb.toString()); - } - - public static void run(int resourceID) { - new UpdateChecker(resourceID).query(latestVersion -> { - String currentVersion = plugin.getDescription().getVersion(); - - if (UpdateChecker.parseVersion(latestVersion) > UpdateChecker.parseVersion(currentVersion)) { - UpdateChecker.setUpdateAvailable(true); - Logging.log(lang.getEntry("Etc_UpdateAvailable", "v" + currentVersion, "v" + latestVersion)); - } - UpdateChecker.setLatestVersion(latestVersion); - }); - } -} diff --git a/src/main/java/com/dre/brewery/utility/releases/ReleaseChecker.java b/src/main/java/com/dre/brewery/utility/releases/ReleaseChecker.java new file mode 100644 index 00000000..1af85313 --- /dev/null +++ b/src/main/java/com/dre/brewery/utility/releases/ReleaseChecker.java @@ -0,0 +1,109 @@ +/* + * BreweryX Bukkit-Plugin for an alternate brewing process + * Copyright (C) 2024 The Brewery Team + * + * This file is part of BreweryX. + * + * BreweryX is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BreweryX is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with BreweryX. If not, see . + */ + +package com.dre.brewery.utility.releases; + +import com.dre.brewery.BreweryPlugin; +import com.dre.brewery.configuration.ConfigManager; +import com.dre.brewery.configuration.files.Config; +import com.dre.brewery.configuration.files.Lang; +import com.dre.brewery.utility.releases.impl.GitHubReleaseChecker; +import com.dre.brewery.utility.releases.impl.NoImplReleaseChecker; +import com.dre.brewery.utility.releases.impl.SpigotReleaseChecker; +import lombok.Getter; +import org.bukkit.command.CommandSender; + +import java.util.concurrent.CompletableFuture; + +@Getter +public abstract class ReleaseChecker { + + protected static final String CONST_UNRESOLVED = "Unresolved"; + private static ReleaseChecker instance; + + protected String resolvedLatestVersion = CONST_UNRESOLVED; // Latest version of BX resolved from the source + + + public abstract CompletableFuture resolveLatest(); + + public abstract CompletableFuture checkForUpdate(); + + + public void notify(CommandSender receiver) { + if (receiver.hasPermission("brewery.update") && isUpdateAvailable()) { + ConfigManager.getConfig(Lang.class) + .sendEntry(receiver, "Etc_UpdateAvailable", "v" + localVersion(), "v" + resolvedLatestVersion); + } + } + + + public boolean isUpdateAvailable() { + if (resolvedLatestVersion.equals(CONST_UNRESOLVED)) { + return false; + } + int local = parseVersion(localVersion()); + int resolved = parseVersion(resolvedLatestVersion); + return resolved > local; + } + + + // Singleton + + public static ReleaseChecker getInstance() { + if (instance != null) { + return instance; + } + Config config = ConfigManager.getConfig(Config.class); + switch (config.getResolveUpdatesFrom()) { + case GITHUB -> instance = new GitHubReleaseChecker("BreweryTeam", "BreweryX"); + case SPIGOT -> instance = new SpigotReleaseChecker(114777); + case NONE -> instance = new NoImplReleaseChecker(); + } + return instance; + } + + + // Util + public String localVersion() { + String versionString = BreweryPlugin.getInstance().getDescription().getVersion(); + if (versionString.contains(";")) { + // I don't care about the branch + return versionString.split(";")[0]; + } + return versionString; + } + + public int parseVersion(String version) { + StringBuilder sb = new StringBuilder(); + for (char c : version.toCharArray()) { + if (Character.isDigit(c)) { + sb.append(c); + } + } + return Integer.parseInt(sb.toString()); + } + + + public enum ReleaseCheckerType { + GITHUB, + SPIGOT, + NONE + } +} diff --git a/src/main/java/com/dre/brewery/utility/releases/impl/GitHubReleaseChecker.java b/src/main/java/com/dre/brewery/utility/releases/impl/GitHubReleaseChecker.java new file mode 100644 index 00000000..20e5bd5c --- /dev/null +++ b/src/main/java/com/dre/brewery/utility/releases/impl/GitHubReleaseChecker.java @@ -0,0 +1,79 @@ +/* + * BreweryX Bukkit-Plugin for an alternate brewing process + * Copyright (C) 2024 The Brewery Team + * + * This file is part of BreweryX. + * + * BreweryX is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BreweryX is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with BreweryX. If not, see . + */ + +package com.dre.brewery.utility.releases.impl; + +import com.dre.brewery.utility.Logging; +import com.dre.brewery.utility.releases.ReleaseChecker; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.concurrent.CompletableFuture; + +public class GitHubReleaseChecker extends ReleaseChecker { + + private static final String CONST_URL = "https://api.github.com/repos/%s/%s/releases/latest"; + private static final String CONST_JSON_FIELD = "tag_name"; + + private final String link; + + public GitHubReleaseChecker(String owner, String repo) { + this.link = String.format(CONST_URL, owner, repo); + } + + @Override + public CompletableFuture resolveLatest() { + if (resolvedLatestVersion != null) { + return CompletableFuture.completedFuture(resolvedLatestVersion); + } + HttpClient client = HttpClient.newHttpClient(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create(link)) + .GET() + .build(); + + return CompletableFuture.supplyAsync(() -> { + try { + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + JsonObject jsonResponse = JsonParser.parseString(response.body()).getAsJsonObject(); + this.resolvedLatestVersion = jsonResponse.get(CONST_JSON_FIELD).getAsString(); + return this.resolvedLatestVersion; + } catch (IOException | InterruptedException e) { + Logging.warningLog("Failed to resolve latest BreweryX version from GitHub. (No connection?)"); + return CONST_UNRESOLVED; + } + }); + } + + @Override + public CompletableFuture checkForUpdate() { + return resolveLatest().thenApply(v -> { + if (v.equals(CONST_UNRESOLVED)) { + return false; + } + return isUpdateAvailable(); + }); + } +} diff --git a/src/main/java/com/dre/brewery/utility/releases/impl/NoImplReleaseChecker.java b/src/main/java/com/dre/brewery/utility/releases/impl/NoImplReleaseChecker.java new file mode 100644 index 00000000..8c03c64c --- /dev/null +++ b/src/main/java/com/dre/brewery/utility/releases/impl/NoImplReleaseChecker.java @@ -0,0 +1,49 @@ +/* + * BreweryX Bukkit-Plugin for an alternate brewing process + * Copyright (C) 2024 The Brewery Team + * + * This file is part of BreweryX. + * + * BreweryX is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BreweryX is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with BreweryX. If not, see . + */ + +package com.dre.brewery.utility.releases.impl; + +import com.dre.brewery.utility.releases.ReleaseChecker; +import org.bukkit.command.CommandSender; + +import java.util.concurrent.CompletableFuture; + +public class NoImplReleaseChecker extends ReleaseChecker { + + @Override + public CompletableFuture resolveLatest() { + return CompletableFuture.completedFuture(CONST_UNRESOLVED); + } + + @Override + public boolean isUpdateAvailable() { + return false; + } + + @Override + public CompletableFuture checkForUpdate() { + return CompletableFuture.completedFuture(false); + } + + @Override + public void notify(CommandSender receiver) { + // No implementation + } +} diff --git a/src/main/java/com/dre/brewery/utility/releases/impl/SpigotReleaseChecker.java b/src/main/java/com/dre/brewery/utility/releases/impl/SpigotReleaseChecker.java new file mode 100644 index 00000000..e9d84dd2 --- /dev/null +++ b/src/main/java/com/dre/brewery/utility/releases/impl/SpigotReleaseChecker.java @@ -0,0 +1,62 @@ +/* + * BreweryX Bukkit-Plugin for an alternate brewing process + * Copyright (C) 2024 The Brewery Team + * + * This file is part of BreweryX. + * + * BreweryX is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BreweryX is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with BreweryX. If not, see . + */ + +package com.dre.brewery.utility.releases.impl; + +import com.dre.brewery.utility.releases.ReleaseChecker; + +import java.io.IOException; +import java.net.URL; +import java.util.Scanner; +import java.util.concurrent.CompletableFuture; + +public class SpigotReleaseChecker extends ReleaseChecker { + + private static final String CONST_URL = "https://api.spigotmc.org/legacy/update.php?resource=%s/~"; + + private final String link; + + public SpigotReleaseChecker(int resourceId) { + this.link = String.format(CONST_URL, resourceId); + } + + @Override + public CompletableFuture resolveLatest() { + if (resolvedLatestVersion != null) { + return CompletableFuture.completedFuture(resolvedLatestVersion); + } + return CompletableFuture.supplyAsync(() -> { + try (Scanner scanner = new Scanner(new URL(link).openStream())) { + if (scanner.hasNext()) { + this.resolvedLatestVersion = scanner.next(); + return this.resolvedLatestVersion; + } + return CONST_UNRESOLVED; + } catch (IOException e) { + return CONST_UNRESOLVED; + } + }); + } + + @Override + public CompletableFuture checkForUpdate() { + return resolveLatest().thenApply(ignored -> isUpdateAvailable()); + } +} diff --git a/src/main/resources/config-langs/de.yml b/src/main/resources/config-langs/de.yml index f63fd224..89860011 100644 --- a/src/main/resources/config-langs/de.yml +++ b/src/main/resources/config-langs/de.yml @@ -6,8 +6,8 @@ config: Sprachedatei die genutzt werden sollte [en] Available types: en (English), de (German), es (Spanish), fr (French), it (Italian), ru (Russian), zh (Chinese) updateCheck: | - Aktiviert das Suchen nach Updates für Brewery mit der spigot api [true] - Wenn ein Update gefunden wurde, wird dies bei Serverstart im log angezeigt, sowie OPs benachrichtigt + Should BreweryX check for updates? Specify which service you'd like to use for update checking or disable it. + Options available: GitHub, Spigot, None [GitHub] autosave: "Autosave Intervall in Minuten [10]" pluginPrefix: "Prefix used on messages" debug: "Debug Nachrichten im Log anzeigen [false]" diff --git a/src/main/resources/config-langs/en.yml b/src/main/resources/config-langs/en.yml index 7d251126..0a2b50a0 100644 --- a/src/main/resources/config-langs/en.yml +++ b/src/main/resources/config-langs/en.yml @@ -6,8 +6,8 @@ config: The translation to be used [en] Available types: en (English), de (German), es (Spanish), fr (French), it (Italian), ru (Russian), zh (Chinese) updateCheck: | - Enable checking for Updates, Checks the Spigot api for updates to BreweryX [true] - If an Update is found a Message is logged on Server-start and displayed to OPs joining the game + Should BreweryX check for updates? Specify which service you'd like to use for update checking or disable it. + Options available: GitHub, Spigot, None [GitHub] autosave: "Autosave interval in minutes [10]" pluginPrefix: "Prefix used on messages" debug: "Show debug messages in logs [false]" diff --git a/src/main/resources/config-langs/es.yml b/src/main/resources/config-langs/es.yml index 233270e2..821946d3 100644 --- a/src/main/resources/config-langs/es.yml +++ b/src/main/resources/config-langs/es.yml @@ -6,8 +6,8 @@ config: La traducción a utilizar Tipos disponibles: en (Inglés), de (Alemán), es (Español), fr (Francés), it (Italiano), ru (Ruso), zh (Chino) updateCheck: | - Activa la comprobación de actualizaciones, pregunta a la API de Spigot por actualizaciones de BreweryX [true] - Si se encuentra una nueva versión, se registra un mensaje en el inicio del servidor y se muestra a OPs al unirse + Should BreweryX check for updates? Specify which service you'd like to use for update checking or disable it. + Options available: GitHub, Spigot, None [GitHub] autosave: "Intervalo de autoguardado en minutos [10]" pluginPrefix: "Prefijo usado en los mensajes" debug: "Mostrar mensajes de depuración en los registros [false]" diff --git a/src/main/resources/config-langs/fr.yml b/src/main/resources/config-langs/fr.yml index dde480c2..d77cb0e9 100644 --- a/src/main/resources/config-langs/fr.yml +++ b/src/main/resources/config-langs/fr.yml @@ -10,8 +10,8 @@ config: Fichier de langage à utiliser [en] Valeurs disponibles: en (Anglais), de (Allemande), es (Espagnol), fr (Français), it (Italien), ru (Russe), zh (Chinois) updateCheck: | - Activer la cherche de mises à jour. Cherche l’API CurseForge pour les mises à jour. [true] - Si une mise à jour est trouvé, un message sera enregistré lors du démarage du serveur. Il sera également affiché aux joueurs OP quand ils se connectent. + Should BreweryX check for updates? Specify which service you'd like to use for update checking or disable it. + Options available: GitHub, Spigot, None [GitHub] autosave: "Intervale de la sauvegarde automatique en minutes [10]" pluginPrefix: "Préfixe utilisé avec les messages BreweryX" debug: "Afficher les messages de débogue dans le journal du serveur (log) [false]" diff --git a/src/main/resources/config-langs/it.yml b/src/main/resources/config-langs/it.yml index b454c456..8635280f 100644 --- a/src/main/resources/config-langs/it.yml +++ b/src/main/resources/config-langs/it.yml @@ -6,8 +6,8 @@ config: Lingua da usare [en] Available types: en (English), de (German), es (Spanish), fr (French), it (Italian), ru (Russian), zh (Chinese) updateCheck: | - Abilita il controllo degli aggiornamenti, controlla l'API di Spigot per eventuali aggiornamenti di Brewery [true] - Se quando un aggiornamento viene trovato un messaggio è loggato e mostrato agli OPs quando entrano in gioco. + Should BreweryX check for updates? Specify which service you'd like to use for update checking or disable it. + Options available: GitHub, Spigot, None [GitHub] autosave: "Intervallo di autosalvataggio in minuti [10]" pluginPrefix: "Prefix used on messages" debug: "Show debug messages in logs [false]" diff --git a/src/main/resources/config-langs/ru.yml b/src/main/resources/config-langs/ru.yml index 1e5d0a53..9048f115 100644 --- a/src/main/resources/config-langs/ru.yml +++ b/src/main/resources/config-langs/ru.yml @@ -6,8 +6,8 @@ config: Какой файл локализации использовать [en] Available types: en (English), de (German), es (Spanish), fr (French), it (Italian), ru (Russian), zh (Chinese) updateCheck: | - Включить ли проверку обновлений. Проверяет API Spigot на предмет обновлений для BreweryX [true] - Если обнаружено новое обновление, администраторы получат об этом сообщение при входе в игру + Should BreweryX check for updates? Specify which service you'd like to use for update checking or disable it. + Options available: GitHub, Spigot, None [GitHub] autosave: "Период автосохранения данных (в минутах) [10]" pluginPrefix: | Префикс плагина, используемый в сообщениях. diff --git a/src/main/resources/config-langs/zh.yml b/src/main/resources/config-langs/zh.yml index d17736e3..07c889d7 100644 --- a/src/main/resources/config-langs/zh.yml +++ b/src/main/resources/config-langs/zh.yml @@ -6,8 +6,8 @@ config: 语言文件 [en] Available types: en (English), de (German), es (Spanish), fr (French), it (Italian), ru (Russian), zh (Chinese) updateCheck: | - 是否检查更新 [true] - 若有更新, 服务端后台与上线时的管理员会收到通知 + Should BreweryX check for updates? Specify which service you'd like to use for update checking or disable it. + Options available: GitHub, Spigot, None [GitHub] autosave: "自动保存时间间隔, 单位:分钟 [10]" pluginPrefix: "用于此插件的消息前缀[Brewery]" debug: "是否在日志中显示调试信息 [false]"