Compare commits

...
39 Commits
Author SHA1 Message Date
Nassim Jahnke 199eb2e67d 4.1.0 Release 2023-04-17 09:57:04 +02:00
Nassim Jahnke 0683450c2d Update version checker endpoint to Hangar 2023-04-17 09:57:04 +02:00
Nassim Jahnke dbdd7d18d0 Update Gradle wrapper 2023-04-15 11:17:25 +02:00
Maintenancer cf4ae33ca7 New translations language-en.yml (Japanese) (#98)
Thanks to yu-solt
2023-04-15 11:15:24 +02:00
Nassim Jahnke ba8c574e79 Update Folia class check 2023-03-30 08:45:52 +02:00
Nassim Jahnke 225fe4b15a Add preliminary Folia support 2023-03-10 12:53:44 +01:00
Nassim Jahnke de203244c3 Add enable-playercounthovermessage option, don't disable playercount messages when disabling pingmessages 2023-03-08 15:01:12 +01:00
Nassim Jahnke 167065eef5 Update Gradle wrapper and shadow 2023-03-08 15:00:25 +01:00
Maintenancer 25503f6196 New Crowdin updates (#95)
* New translations language-en.yml (Spanish)

* New translations language-en.yml (Polish)

* New translations language-en.yml (Russian)
2023-03-08 14:54:39 +01:00
Nassim Jahnke 23bfe7ef8f Small cleanup 2023-02-25 11:44:13 +01:00
Nassim Jahnke 31e721f443 Fix variable replacement with gradients 2023-02-25 10:42:24 +01:00
Nassim Jahnke 158680e6ca Update Gradle wrapper, dependencies 2023-02-25 10:41:10 +01:00
Nassim Jahnke b6c9c1bd5e Update workflow 2023-02-22 16:36:59 +01:00
Maintenancer 370b9d9eb8 New Crowdin updates (#94) 2023-02-07 13:33:40 +01:00
Nassim Jahnke 339136c1f2 New Crowdin updates (#93) 2023-02-07 13:24:49 +01:00
Nassim Jahnke 4f0e158435 Update README 2023-02-07 13:06:58 +01:00
Nassim Jahnke c6efc58242 New Crowdin updates (#91) 2023-02-07 12:39:00 +01:00
Nassim Jahnke 6aed091356 Update Crowdin configuration file 2023-02-07 12:01:13 +01:00
Nassim Jahnke d343c75eb6 Remove platform specific aliases 2023-02-07 09:24:48 +01:00
Nassim Jahnke 9cbe2597d0 Update download url 2023-01-28 12:06:20 +01:00
Nassim Jahnke 912d094d6d Add Ukrainian translation file (thanks to Mrlucke) 2023-01-01 13:52:19 +01:00
Nassim Jahnke 6d942f87ce Fix Velocity startup
Closes #87
2022-12-19 17:26:35 +01:00
Nassim Jahnke 30380604da Thank you gradle, very cool 2022-12-09 11:20:06 +01:00
Nassim Jahnke f2c07f1fd4 Update Gradle wrapper 2022-12-08 10:36:29 +01:00
Nassim Jahnke 36f14a6b30 Relocate bstats 2022-10-01 13:43:12 +02:00
Nassim Jahnke 871bd0882c Fix the message for cancelling proxied server timers not replacing the server argument 2022-10-01 13:41:28 +02:00
Nassim Jahnke fbc9fc47e2 Update deps, add bstats to Velocity and Sponge modules 2022-09-25 12:18:55 +02:00
Super ccd5eab475 Create language-se.yml (#84) 2022-08-30 15:46:49 +02:00
Nassim Jahnke 5d0fbb310e Add turkish translation file 2022-08-05 09:48:36 +02:00
Nassim Jahnke 09d2e03c0c Fix disabling enable-pingmessages not being respected on Paper servers 2022-04-27 16:40:01 +02:00
Nassim Jahnke 57da60a669 Bump version to 4.0.2-SNAPSHOT 2022-04-27 16:39:48 +02:00
original-codematrix 63dafb05b6 Switch from assert to Assertions class from JUnit (#77) 2022-04-27 16:06:16 +02:00
Nassim Jahnke d8e36d7ff6 4.0.1 Release 2022-04-16 18:40:34 +02:00
Nassim Jahnke 39f966ba5d Update dependencies, actually fix tests 2022-04-15 21:51:29 +02:00
Nassim Jahnke 879f07e3e7 Fix tests 2022-04-15 20:08:13 +02:00
Nassim Jahnke 9cbead310a Fix config header saving 2022-03-23 09:27:43 +01:00
Nassim Jahnke 25375b184d Update workflow 2022-03-23 09:26:53 +01:00
Nassim Jahnke eec5acd0ce Bump version to 4.0.1-SNAPSHOT 2022-03-23 09:20:09 +01:00
Nassim Jahnke 14cef4d53b Fix Sponge metadata replacement 2022-03-17 10:50:56 +01:00
72 changed files with 990 additions and 985 deletions

No files matched your search

+22
View File
@@ -1,6 +1,28 @@
# Maintenance Changelog
This file contains update logs for this project. The top may contain a `Unreleased` section, gathering update logs for a future update during development.
---
## 4.1.0 - April 17th 2023
### Changed
* Added config option `enable-playercounthovermessage` to be able to toggle the player count hover message
* Removed platform specific command aliases (e.g. `maintenancevelocity`)
* Translations
* Moved translation editing to [Crowdin](https://crowdin.com/translate/maintenance)
* Added Turkish translation file (thanks to Proomp)
* Added Swedish translation file (thanks to Sup33r)
* Added Ukrainian translation file (thanks to Mrlucke)
* Added Japanese translation file (thanks to yu-solt)
* Added bStats metrics to Velocity and Sponge modules
### Fixed
* Fixed disabling the `enable-pingmessages` setting not working on Paper servers
* Fixed variable replacement in messages with gradients
* Fixed the message for cancelling proxied server timers not replacing the server argument
* Setting `enable-pingmessages` to `false` no longer disables custom player and player hover messages
---
## 4.0.1 - April 17th 2022
### Fixed
* Fixed the config header sometimes breaking the config on upgrading/saving
---
## 4.0.0 - March 17th 2022
### Changed
+5 -10
View File
@@ -7,16 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/cache@v2.1.7
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
@@ -25,7 +20,7 @@ jobs:
run: ./gradlew build
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2.3.1
uses: actions/upload-artifact@v3
with:
name: MaintenanceFiles
name: Maintenance Files
path: build/libs
+1
View File
@@ -94,3 +94,4 @@ $RECYCLE.BIN/
*.lnk
!MaintenanceAPI.jar
**/src/test/resources/
!core/src/test/resources/dirty-config.yml
+11 -10
View File
@@ -1,9 +1,8 @@
# Maintenance
[![Version](https://img.shields.io/github/release/kennytv/Maintenance.svg)](https://github.com/kennytv/Maintenance/releases)
![Build Status](https://github.com/kennytv/Maintenance/workflows/Build/badge.svg)
[![GH Downloads](https://img.shields.io/github/downloads/kennytv/Maintenance/total)](https://github.com/kennytv/Maintenance/releases)
[![Crowdin](https://badges.crowdin.net/maintenance/localized.svg)](https://crowdin.com/project/maintenance)
[![Discord](https://img.shields.io/discord/489135856284729384.svg?label=Discord&logo=discord&logoColor=fff)](https://discord.gg/vGCUzHq)
[![Twitter](https://img.shields.io/twitter/follow/kennytvn.svg?label=Twitter)](https://twitter.com/kennytvn)
Maintenance is the most customizable free maintenance plugin for your Minecraft server you can find. It runs on Spigot, BungeeCord, Sponge, as well as Velocity.
@@ -16,23 +15,25 @@ Its features include:
* Features specifically for Bungee/Velocity
* Only want to enable maintenance on a single server? You can also do so by using the `/maintenance <on/off> <servername>` command
* Link multiple proxy instances through a MySQL database connection, so you don't have to change maintenance on each proxy by hand
* Use PlaceholderAPI placeholders with the [**MaintenanceAddon**](https://github.com/kennytv/Maintenance/wiki/MaintenanceAddon) (only for Bungee)
* Use PlaceholderAPI placeholders with the [**MaintenanceAddon**](https://hangar.papermc.io/kennytv/MaintenanceAddon) (for Velocity and Bungee)
A full list of commands, permissions and configuration options can be found in the wiki listed below.
* [Hangar Downloads](https://hangar.papermc.io/kennytv/Maintenance)
* [Wiki](https://github.com/kennytv/Maintenance/wiki) (configuration, permissions, API usage)
* [Downloads](https://github.com/kennytv/Maintenance/releases) (GitHub)
* [Changelogs](https://github.com/kennytv/Maintenance/blob/master/.github/CHANGELOG.md)
* [Issue tracker/bug reports](https://github.com/kennytv/Maintenance/issues)
* [Discord](https://discord.gg/vGCUzHq)
* [PlaceholderAPI addon](https://github.com/kennytv/Maintenance/wiki/MaintenanceAddon)
* [PlaceholderAPI addon](https://hangar.papermc.io/kennytv/MaintenanceAddon)
Other forum threads
* [Spigot forums](https://www.spigotmc.org/resources/maintenance.40699/)
* [Ore/Sponge Forums](https://ore.spongepowered.org/KennyTV/Maintenance)
* [Velocity forums](https://forums.velocitypowered.com/t/maintenance/129)
## Localization
The English base language file is localized using Crodwin. You can see and update translations here: https://crowdin.com/project/maintenance
Join [our Discord](https://discord.gg/vGCUzHq) if you want to get the proofreader or translator role on the project.
Adding translations for languages not yet listed is always appreciated as well!
## Compiling
To create a working jar yourself, simply clone the project and compile it with maven (by using `mvn clean package` in your IDE console).
To create a working jar yourself, simply clone the project and compile it with Gradle (`gradlew build`).
## License
This project is licensed under the [GNU General Public License v3](LICENSE.txt).
+1 -1
View File
@@ -8,5 +8,5 @@ repositories {
dependencies {
// version must be manually kept in sync with the one in root project settings.gradle.kts
implementation("gradle.plugin.com.github.johnrengelman", "shadow", "7.1.1")
implementation("com.github.johnrengelman", "shadow", "8.1.1")
}
@@ -6,7 +6,7 @@ plugins {
tasks {
// Variable replacements
processResources {
filesMatching(listOf("plugin.yml", "bungee.yml")) {
filesMatching(listOf("plugin.yml", "bungee.yml", "META-INF/sponge_plugins.json")) {
expand("version" to project.version, "description" to project.description)
}
}
@@ -18,6 +18,9 @@ tasks {
options.encoding = Charsets.UTF_8.name()
options.compilerArgs.addAll(listOf("-nowarn", "-Xlint:-unchecked", "-Xlint:-deprecation"))
}
test {
useJUnitPlatform()
}
}
java {
@@ -1,10 +1,12 @@
import java.util.*
plugins {
id("maintenance.shadow-conventions")
}
tasks {
shadowJar {
archiveFileName.set("Maintenance-${project.name.substringAfter("maintenance-").capitalize()}-${project.version}.jar")
archiveFileName.set("Maintenance-${project.name.substringAfter("maintenance-").replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}-${project.version}.jar")
destinationDirectory.set(rootProject.layout.buildDirectory.dir("libs"))
}
}
@@ -25,4 +25,5 @@ publishShadowJar()
fun ShadowJar.configureRelocations() {
relocate("com.zaxxer.hikari", "eu.kennytv.maintenance.lib.hikari")
relocate("org.bstats", "eu.kennytv.maintenance.lib.bstats")
}
+3 -2
View File
@@ -36,6 +36,7 @@ subprojects {
}
dependencies {
TEST_IMPLEMENTATION_CONFIGURATION_NAME("org.junit.jupiter:junit-jupiter-engine:5.8.2")
TEST_IMPLEMENTATION_CONFIGURATION_NAME(rootProject.libs.bundles.junit)
TEST_IMPLEMENTATION_CONFIGURATION_NAME(rootProject.libs.snakeyaml)
}
}
}
+1
View File
@@ -3,5 +3,6 @@ dependencies {
implementation(projects.adventure.adventurePlatformBungee) {
targetConfiguration = "shadow"
}
implementation(libs.bstatsBungee)
compileOnly(libs.bungee)
}
@@ -22,7 +22,6 @@ import eu.kennytv.maintenance.bungee.command.MaintenanceBungeeCommand;
import eu.kennytv.maintenance.bungee.command.MaintenanceBungeeCommandBase;
import eu.kennytv.maintenance.bungee.listener.ProxyPingListener;
import eu.kennytv.maintenance.bungee.listener.ServerConnectListener;
import eu.kennytv.maintenance.bungee.metrics.MetricsLite;
import eu.kennytv.maintenance.bungee.util.BungeeSenderInfo;
import eu.kennytv.maintenance.bungee.util.BungeeServer;
import eu.kennytv.maintenance.bungee.util.BungeeTask;
@@ -51,6 +50,7 @@ import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.api.plugin.PluginManager;
import org.bstats.bungeecord.Metrics;
import org.jetbrains.annotations.Nullable;
import javax.imageio.ImageIO;
@@ -88,7 +88,7 @@ public final class MaintenanceBungeePlugin extends MaintenanceProxyPlugin {
pm.registerCommand(plugin, new MaintenanceBungeeCommandBase(commandManager));
continueLastEndtimer();
new MetricsLite(plugin);
new Metrics(plugin, 742);
final Plugin serverListPlus = pm.getPlugin("ServerListPlus");
if (serverListPlus != null) {
@@ -111,9 +111,9 @@ public final class MaintenanceBungeePlugin extends MaintenanceProxyPlugin {
@Override
public void sendUpdateNotification(final SenderInfo sender) {
final TextComponent tc1 = new TextComponent(TextComponent.fromLegacyText(getPrefix()));
final TextComponent tc2 = new TextComponent(TextComponent.fromLegacyText("§cDownload it at: §6https://www.spigotmc.org/resources/maintenance.40699/"));
final TextComponent tc2 = new TextComponent(TextComponent.fromLegacyText("§cDownload it at: §6" + HANGAR_URL));
final TextComponent click = new TextComponent(TextComponent.fromLegacyText(" §7§l§o(CLICK ME)"));
click.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.spigotmc.org/resources/maintenance.40699/"));
click.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, HANGAR_URL));
click.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(new ComponentBuilder("§aDownload the latest version").create())));
tc1.addExtra(tc2);
tc1.addExtra(click);
@@ -27,7 +27,7 @@ public final class MaintenanceBungeeCommandBase extends Command implements TabEx
private final MaintenanceCommand command;
public MaintenanceBungeeCommandBase(final MaintenanceCommand command) {
super("maintenance", "maintenance.command", "maintenancebungee", "mt");
super("maintenance", "maintenance.command", "mt");
this.command = command;
}
@@ -36,28 +36,33 @@ public final class ProxyPingListener implements Listener {
@EventHandler(priority = 80)
public void proxyPing(final ProxyPingEvent event) {
if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return;
if (!settings.isMaintenance()) {
return;
}
final ServerPing ping = event.getResponse();
ServerPing.Players players = ping.getPlayers();
if (players == null) {
ping.setPlayers(players = new ServerPing.Players(0, 0, null));
}
if (settings.hasCustomPlayerCountMessage()) {
ping.setVersion(new ServerPing.Protocol(settings.getPlayerCountMessage()
.replace("%ONLINE%", Integer.toString(players.getOnline()))
.replace("%MAX%", Integer.toString(players.getMax())), 1));
ping.setVersion(new ServerPing.Protocol(settings.getPlayerCountMessage(), 1));
}
ping.setDescriptionComponent(ComponentUtil.toBadComponents(settings.getRandomPingMessage()));
final String[] lines = settings.getPlayerCountHoverLines();
final ServerPing.PlayerInfo[] samplePlayers = new ServerPing.PlayerInfo[lines.length];
for (int i = 0; i < lines.length; i++) {
samplePlayers[i] = new ServerPing.PlayerInfo(lines[i], "");
if (settings.isEnablePingMessages()) {
ping.setDescriptionComponent(ComponentUtil.toBadComponents(settings.getRandomPingMessage()));
}
if (settings.hasCustomPlayerCountHoverMessage()) {
ServerPing.Players players = ping.getPlayers();
if (players == null) {
players = new ServerPing.Players(0, 0, null);
ping.setPlayers(players);
}
final String[] lines = settings.getPlayerCountHoverLines();
final ServerPing.PlayerInfo[] samplePlayers = new ServerPing.PlayerInfo[lines.length];
for (int i = 0; i < lines.length; i++) {
samplePlayers[i] = new ServerPing.PlayerInfo(lines[i], "");
}
players.setSample(samplePlayers);
}
players.setSample(samplePlayers);
if (settings.hasCustomIcon() && plugin.getFavicon() != null) {
ping.setFavicon(plugin.getFavicon());
@@ -1,272 +0,0 @@
package eu.kennytv.maintenance.bungee.metrics;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.zip.GZIPOutputStream;
public final class MetricsLite {
public static final int B_STATS_VERSION = 1;
private static final int PLUGIN_ID = 742;
private static final String URL = "https://bStats.org/submitData/bungeecord";
private final Plugin plugin;
private boolean enabled;
private String serverUUID;
private boolean logFailedRequests;
private static boolean logSentData;
private static boolean logResponseStatusText;
private static final List<Object> knownMetricsInstances = new ArrayList<>();
public MetricsLite(final Plugin plugin) {
this.plugin = plugin;
try {
loadConfig();
} catch (final IOException e) {
plugin.getLogger().log(Level.WARNING, "Failed to load bStats config!", e);
return;
}
if (!enabled) {
return;
}
final Class<?> usedMetricsClass = getFirstBStatsClass();
if (usedMetricsClass == null) {
return;
}
if (usedMetricsClass == getClass()) {
linkMetrics(this);
startSubmitting();
} else {
try {
usedMetricsClass.getMethod("linkMetrics", Object.class).invoke(null, this);
} catch (final NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
if (logFailedRequests) {
plugin.getLogger().log(Level.WARNING, "Failed to link to first metrics class " + usedMetricsClass.getName() + "!", e);
}
}
}
}
public boolean isEnabled() {
return enabled;
}
public static void linkMetrics(final Object metrics) {
knownMetricsInstances.add(metrics);
}
public JsonObject getPluginData() {
final JsonObject data = new JsonObject();
//final String pluginName = plugin.getDescription().getName();
final String pluginName = "MaintenanceBungee"; // I cut off the suffix, not sure how bStats would like the name change
final String pluginVersion = plugin.getDescription().getVersion();
data.addProperty("pluginName", pluginName);
data.addProperty("id", PLUGIN_ID);
data.addProperty("pluginVersion", pluginVersion);
final JsonArray customCharts = new JsonArray();
data.add("customCharts", customCharts);
return data;
}
private void startSubmitting() {
plugin.getProxy().getScheduler().schedule(plugin, this::submitData, 2, 30, TimeUnit.MINUTES);
}
private JsonObject getServerData() {
final int playerAmount = Math.min(plugin.getProxy().getOnlineCount(), 500);
final int onlineMode = plugin.getProxy().getConfig().isOnlineMode() ? 1 : 0;
final String bungeecordVersion = plugin.getProxy().getVersion();
final int managedServers = plugin.getProxy().getServers().size();
final String javaVersion = System.getProperty("java.version");
final String osName = System.getProperty("os.name");
final String osArch = System.getProperty("os.arch");
final String osVersion = System.getProperty("os.version");
final int coreCount = Runtime.getRuntime().availableProcessors();
final JsonObject data = new JsonObject();
data.addProperty("serverUUID", serverUUID);
data.addProperty("playerAmount", playerAmount);
data.addProperty("managedServers", managedServers);
data.addProperty("onlineMode", onlineMode);
data.addProperty("bungeecordVersion", bungeecordVersion);
data.addProperty("javaVersion", javaVersion);
data.addProperty("osName", osName);
data.addProperty("osArch", osArch);
data.addProperty("osVersion", osVersion);
data.addProperty("coreCount", coreCount);
return data;
}
private void submitData() {
final JsonObject data = getServerData();
final JsonArray pluginData = new JsonArray();
for (final Object metrics : knownMetricsInstances) {
try {
final Object plugin = metrics.getClass().getMethod("getPluginData").invoke(metrics);
if (plugin instanceof JsonObject) {
pluginData.add((JsonObject) plugin);
}
} catch (final NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
}
}
data.add("plugins", pluginData);
try {
sendData(plugin, data);
} catch (final Exception e) {
if (logFailedRequests) {
plugin.getLogger().log(Level.WARNING, "Could not submit plugin stats!", e);
}
}
}
private void loadConfig() throws IOException {
final File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
bStatsFolder.mkdirs();
final File configFile = new File(bStatsFolder, "config.yml");
if (!configFile.exists()) {
writeFile(configFile,
"#bStats collects some data for plugin authors like how many servers are using their plugins.",
"#To honor their work, you should not disable it.",
"#This has nearly no effect on the server performance!",
"#Check out https://bStats.org/ to learn more :)",
"enabled: true",
"serverUuid: \"" + UUID.randomUUID() + "\"",
"logFailedRequests: false",
"logSentData: false",
"logResponseStatusText: false");
}
final Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
enabled = configuration.getBoolean("enabled", true);
serverUUID = configuration.getString("serverUuid");
logFailedRequests = configuration.getBoolean("logFailedRequests", false);
logSentData = configuration.getBoolean("logSentData", false);
logResponseStatusText = configuration.getBoolean("logResponseStatusText", false);
}
private Class<?> getFirstBStatsClass() {
final Path configPath = plugin.getDataFolder().toPath().getParent().resolve("bStats");
configPath.toFile().mkdirs();
final File tempFile = new File(configPath.toFile(), "temp.txt");
try {
final String className = readFile(tempFile);
if (className != null) {
try {
return Class.forName(className);
} catch (final ClassNotFoundException ignored) {
}
}
writeFile(tempFile, getClass().getName());
return getClass();
} catch (final IOException e) {
if (logFailedRequests) {
plugin.getLogger().log(Level.WARNING, "Failed to get first bStats class!", e);
}
return null;
}
}
private String readFile(final File file) throws IOException {
if (!file.exists()) {
return null;
}
try (final BufferedReader bufferedReader = new BufferedReader(new FileReader(file))) {
return bufferedReader.readLine();
}
}
private void writeFile(final File file, final String... lines) throws IOException {
if (!file.exists()) {
file.createNewFile();
}
try (final BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file))) {
for (final String line : lines) {
bufferedWriter.write(line);
bufferedWriter.newLine();
}
}
}
private static void sendData(final Plugin plugin, final JsonObject data) throws Exception {
if (data == null) {
throw new IllegalArgumentException("Data cannot be null");
}
if (logSentData) {
plugin.getLogger().info("Sending data to bStats: " + data);
}
final HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();
final byte[] compressedData = compress(data.toString());
connection.setRequestMethod("POST");
connection.addRequestProperty("Accept", "application/json");
connection.addRequestProperty("Connection", "close");
connection.addRequestProperty("Content-Encoding", "gzip");
connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("User-Agent", "MC-Server/" + B_STATS_VERSION);
connection.setDoOutput(true);
try (final DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {
outputStream.write(compressedData);
}
if (logResponseStatusText) {
final StringBuilder builder = new StringBuilder();
try (final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
String line;
while ((line = bufferedReader.readLine()) != null) {
builder.append(line);
}
}
plugin.getLogger().info("Sent data to bStats and received response: " + builder);
} else {
connection.getInputStream().close();
}
}
private static byte[] compress(final String str) throws IOException {
if (str == null) {
return null;
}
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try (final GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) {
gzip.write(str.getBytes(StandardCharsets.UTF_8));
}
return outputStream.toByteArray();
}
}
+1 -1
View File
@@ -4,4 +4,4 @@ main: eu.kennytv.maintenance.bungee.MaintenanceBungeeBase
author: kennytv
description: ${description}
softDepends: [ServerListPlus, LuckPerms]
website: https://www.spigotmc.org/resources/maintenance.40699/
website: https://hangar.papermc.io/kennytv/Maintenance
@@ -151,20 +151,20 @@ public final class SettingsProxy extends Settings {
}
public Component getServerKickMessage(final String server) {
Component message = getMessageOrNull("singleMaintenanceKicks." + server, "%SERVER%", server);
String message = getLanguageStringOrNull("singleMaintenanceKicks." + server, "%SERVER%", server);
if (message == null) {
message = getMessage("singleMaintenanceKick", "%SERVER%", server);
message = getLanguageString("singleMaintenanceKick", "%SERVER%", server);
}
return plugin.replacePingVariables(message);
return parse(plugin.replacePingVariables(message));
}
// Full = being kicked from the proxy, not just a proxied server
public Component getFullServerKickMessage(final String server) {
Component message = getMessageOrNull("singleMaintenanceKicksComplete." + server, "%SERVER%", server);
String message = getLanguageStringOrNull("singleMaintenanceKicksComplete." + server, "%SERVER%", server);
if (message == null) {
message = getMessage("singleMaintenanceKickComplete", "%SERVER%", server);
message = getLanguageString("singleMaintenanceKickComplete", "%SERVER%", server);
}
return plugin.replacePingVariables(message);
return parse(plugin.replacePingVariables(message));
}
public boolean hasMySQL() {
@@ -60,7 +60,7 @@ public final class AbortSingleTimerCommand extends ProxyCommandInfo {
}
plugin.cancelSingleTask(server);
sender.send(getMessage("singleTimerCancelled"));
sender.send(getMessage("singleTimerCancelled", "%SERVER%", server.getName()));
} else
sender.send(getHelpMessage());
}
@@ -31,7 +31,7 @@ import java.util.function.Function;
public final class LuckPermsProxyHook {
public static <T> void register(final MaintenanceProxyPlugin plugin, final Function<T, String> function) {
LuckPermsProvider.get().getContextManager().registerCalculator(new MaintenanceProxyCalculator<T>(plugin, function));
LuckPermsProvider.get().getContextManager().registerCalculator(new MaintenanceProxyCalculator<>(plugin, function));
}
public static final class MaintenanceProxyCalculator<T> implements ContextCalculator<T> {
@@ -17,7 +17,6 @@
*/
package eu.kennytv.maintenance.core;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.io.CharStreams;
import com.google.gson.Gson;
@@ -38,14 +37,10 @@ import eu.kennytv.maintenance.core.util.ServerType;
import eu.kennytv.maintenance.core.util.Task;
import eu.kennytv.maintenance.core.util.Version;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import org.jetbrains.annotations.Nullable;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -54,6 +49,9 @@ import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
@@ -61,9 +59,11 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jetbrains.annotations.Nullable;
public abstract class MaintenancePlugin implements Maintenance {
public static final Gson GSON = new GsonBuilder().create();
public static final String HANGAR_URL = "https://hangar.papermc.io/kennytv/Maintenance";
protected final eu.kennytv.maintenance.core.event.EventManager eventManager;
protected final Version version;
protected Settings settings;
@@ -123,21 +123,24 @@ public abstract class MaintenancePlugin implements Maintenance {
eventManager.callEvent(new MaintenanceChangedEvent(maintenance));
}
public Component replacePingVariables(final Component component) {
return component.replaceText(builder -> builder.matchLiteral("%TIMER%").replacement(c -> getTimerMessage()))
.replaceText(builder -> builder.matchLiteral("%ONLINE%").replacement(c -> Component.text(getOnlinePlayers())))
.replaceText(builder -> builder.matchLiteral("%MAX%").replacement(c -> Component.text(getMaxPlayers())));
public String replacePingVariables(String component) {
if (component.contains("%TIMER%")) {
component = component.replace("%TIMER%", getTimerMessage());
}
component = component.replace("%ONLINE%", String.valueOf(getOnlinePlayers()));
component = component.replace("%MAX%", String.valueOf(getMaxPlayers()));
return component;
}
public Component getTimerMessage() {
public String getTimerMessage() {
if (!isTaskRunning()) {
return settings.getMessage("motdTimerNotRunning");
return settings.getLanguageString("motdTimerNotRunning");
}
final int preHours = runnable.getSecondsLeft() / 60;
final int minutes = preHours % 60;
final int seconds = runnable.getSecondsLeft() % 60;
return settings.getMessage("motdTimer",
return settings.getLanguageString("motdTimer",
"%HOURS%", String.format("%02d", preHours / 60),
"%MINUTES%", String.format("%02d", minutes),
"%SECONDS%", String.format("%02d", seconds));
@@ -178,7 +181,7 @@ public abstract class MaintenancePlugin implements Maintenance {
public boolean updateAvailable() {
try {
checkNewestVersion();
return version.compareTo(newestVersion) == -1;
return version.compareTo(newestVersion) < 0;
} catch (final Exception e) {
return false;
}
@@ -209,15 +212,14 @@ public abstract class MaintenancePlugin implements Maintenance {
try {
checkNewestVersion();
} catch (final Exception e) {
getLogger().warning("An error occured during update checking!");
return;
}
final int compare = version.compareTo(newestVersion);
if (compare == -1) {
if (compare < 0) {
//TODO mmmmmmmm legacy chat
getLogger().info("§cNewest version available: §aVersion " + newestVersion + "§c, you're on §a" + version);
} else if (compare == 1) {
} else if (compare > 0) {
if (version.getTag().equalsIgnoreCase("snapshot")) {
getLogger().info("§cYou're running a development version, please report bugs on the Discord server (https://discord.gg/vGCUzHq) or the GitHub issue tracker (https://github.com/kennytv/Maintenance/issues)");
} else {
@@ -227,27 +229,32 @@ public abstract class MaintenancePlugin implements Maintenance {
});
}
public boolean installUpdate() {
// Ore sad :(
Preconditions.checkArgument(serverType != ServerType.SPONGE);
try {
final String fileSuffix = serverType == ServerType.VELOCITY ? "Velocity" : "";
final URLConnection conn = new URL("https://github.com/kennytv/Maintenance/releases/download/" + newestVersion + "/Maintenance" + fileSuffix + ".jar").openConnection();
writeFile(new BufferedInputStream(conn.getInputStream()), new BufferedOutputStream(new FileOutputStream(getPluginFolder() + "Maintenance.tmp")));
final File file = new File(getPluginFolder() + "Maintenance.tmp");
final long newlength = file.length();
if (newlength < 10000) {
file.delete();
return false;
}
public boolean installUpdate() throws Exception {
// Sponge and Velocity need their own jar
final String platformInfix = serverType == ServerType.VELOCITY ? "Velocity-" : serverType == ServerType.SPONGE ? "Sponge-" : "";
final String fileName = "Maintenance-" + platformInfix + newestVersion + ".jar";
final Path tempFilePath = Paths.get(getPluginFolder() + "Maintenance.tmp");
final URLConnection connection = new URL("https://github.com/kennytv/Maintenance/releases/download/" + newestVersion + "/" + fileName).openConnection();
try (final BufferedInputStream is = new BufferedInputStream(connection.getInputStream());
final BufferedOutputStream os = new BufferedOutputStream(Files.newOutputStream(tempFilePath))) {
writeFile(is, os);
}
writeFile(new FileInputStream(file), new BufferedOutputStream(new FileOutputStream(getPluginFile())));
final File file = tempFilePath.toFile();
final long newlength = file.length();
if (newlength < 10_000) {
// Sanity check the file length
file.delete();
return true;
} catch (final Exception e) {
e.printStackTrace();
return false;
}
try (final InputStream is = Files.newInputStream(file.toPath());
final BufferedOutputStream os = new BufferedOutputStream(Files.newOutputStream(getPluginFile().toPath()))) {
writeFile(is, os);
}
file.delete();
return true;
}
private void writeFile(final InputStream is, final OutputStream os) throws IOException {
@@ -256,13 +263,11 @@ public abstract class MaintenancePlugin implements Maintenance {
while ((chunkSize = is.read(chunk)) != -1) {
os.write(chunk, 0, chunkSize);
}
is.close();
os.close();
}
private void checkNewestVersion() throws Exception {
final HttpURLConnection c = (HttpURLConnection) new URL("https://api.spigotmc.org/legacy/update.php?resource=40699").openConnection();
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(c.getInputStream()))) {
final HttpURLConnection connection = (HttpURLConnection) new URL("https://hangar.papermc.io/api/v1/projects/kennytv/Maintenance/latestrelease").openConnection();
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
final String newVersionString = reader.readLine();
final Version newVersion = new Version(newVersionString);
if (!newVersion.equals(version)) {
@@ -447,7 +452,7 @@ public abstract class MaintenancePlugin implements Maintenance {
public abstract File getDataFolder();
@Nullable
public InputStream getResource(String name) {
public InputStream getResource(final String name) {
return this.getClass().getClassLoader().getResourceAsStream(name);
}
@@ -23,16 +23,14 @@ import eu.kennytv.maintenance.core.config.ConfigSection;
import eu.kennytv.maintenance.core.util.ServerType;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import eu.kennytv.maintenance.lib.kyori.adventure.text.TextComponent;
import eu.kennytv.maintenance.lib.kyori.adventure.text.TextReplacementConfig;
import eu.kennytv.maintenance.lib.kyori.adventure.text.minimessage.MiniMessage;
import eu.kennytv.maintenance.lib.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -40,6 +38,7 @@ import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import org.jetbrains.annotations.Nullable;
public class Settings implements eu.kennytv.maintenance.api.Settings {
public static final String NEW_LINE_REPLACEMENT = "<br>";
@@ -51,16 +50,17 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
private final String[] unsupportedFields;
protected boolean maintenance;
private Set<Integer> broadcastIntervals;
private List<Component> pingMessages;
private List<Component> timerSpecificPingMessages;
private List<String> pingMessages;
private List<String> timerSpecificPingMessages;
private List<String> commandsOnMaintenanceEnable;
private List<String> commandsOnMaintenanceDisable;
private Component playerCountMessage;
private List<Component> playerCountHoverLines;
private Component prefix;
private String playerCountMessage;
private List<String> playerCountHoverLines;
private String prefixString;
private String languageName;
private boolean enablePingMessages;
private boolean customPlayerCountMessage;
private boolean customPlayerCountHoverMessage;
private boolean customMaintenanceIcon;
private boolean joinNotifications;
private boolean updateChecks;
@@ -116,7 +116,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
e.printStackTrace();
}
prefix = MiniMessage.miniMessage().deserialize(language.getString("prefix"));
prefixString = language.getString("prefix");
plugin.getEventManager().callEvent(new MaintenanceReloadedEvent());
}
@@ -183,6 +183,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
commandsOnMaintenanceEnable = config.getStringList("commands-on-maintenance-enable");
commandsOnMaintenanceDisable = config.getStringList("commands-on-maintenance-disable");
customPlayerCountMessage = config.getBoolean("enable-playercountmessage");
customPlayerCountHoverMessage = config.getBoolean("enable-playercounthovermessage");
customMaintenanceIcon = config.getBoolean("custom-maintenance-icon");
joinNotifications = config.getBoolean("send-join-notification");
broadcastIntervals = new HashSet<>(config.getIntList("timer-broadcast-for-seconds"));
@@ -192,9 +193,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
playerCountHoverLines = new ArrayList<>();
final String playerHoverMessage = config.getString("playercounthovermessage");
for (final String line : playerHoverMessage.split("<br>")) {
playerCountHoverLines.add(MiniMessage.miniMessage().deserialize(line));
}
Collections.addAll(playerCountHoverLines, playerHoverMessage.split("<br>"));
languageName = config.getString("language").toLowerCase();
kickOnlinePlayers = config.getBoolean("kick-online-players", true);
@@ -323,25 +322,23 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
}
private void legacyToMinimessage(final List<String> list) {
for (int i = 0; i < list.size(); i++) {
list.set(i, legacyToMinimessage(list.get(i)));
}
list.replaceAll(this::legacyToMinimessage);
}
public Component getConfigMessage(final String path) {
public String getConfigMessage(final String path) {
final String s = config.getString(path);
if (s == null) {
plugin.getLogger().warning("The config file is missing the following string: " + path);
return Component.text("null");
return path;
}
return MiniMessage.miniMessage().deserialize(replaceNewlineVar(s));
return replaceNewlineVar(s);
}
public Component getMessage(final String path, final String... replacements) {
public String getLanguageString(final String path, final String... replacements) {
String s = language.getString(path);
if (s == null) {
plugin.getLogger().warning("The language file is missing the following string: " + path);
return Component.text("null");
return path;
}
if (replacements.length != 0) {
if (replacements.length % 2 != 0) {
@@ -353,13 +350,15 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
s = s.replace(key, replacements[i + 1]);
}
}
return MiniMessage.miniMessage().deserialize(replaceNewlineVar(s))
.replaceText(TextReplacementConfig.builder().matchLiteral("<prefix>").replacement(prefix).build());
return replaceNewlineVar(s).replace("<prefix>", prefixString);
}
public @Nullable Component getMessageOrNull(final String path, final String... replacements) {
return language.contains(path) ? getMessage(path, replacements) : null;
public @Nullable String getLanguageStringOrNull(final String path, final String... replacements) {
return language.contains(path) ? getLanguageString(path, replacements) : null;
}
public Component getMessage(final String path, final String... replacements) {
return parse(getLanguageString(path, replacements));
}
public Component getRandomPingMessage() {
@@ -370,16 +369,16 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return pingMessages.isEmpty() ? Component.empty() : getPingMessage(pingMessages);
}
private Component getPingMessage(final List<Component> list) {
final Component component = list.size() == 1 ? list.get(0) : list.get(RANDOM.nextInt(list.size()));
return plugin.replacePingVariables(component);
private Component getPingMessage(final List<String> list) {
final String component = list.size() == 1 ? list.get(0) : list.get(RANDOM.nextInt(list.size()));
return parse(plugin.replacePingVariables(component));
}
private List<Component> loadPingMessages(final String path) {
private List<String> loadPingMessages(final String path) {
final List<String> list = config.getStringList(path);
final List<Component> components = new ArrayList<>(list.size());
final List<String> components = new ArrayList<>(list.size());
for (final String s : list) {
components.add(MiniMessage.miniMessage().deserialize(replaceNewlineVar(s)));
components.add(replaceNewlineVar(s));
}
return components;
}
@@ -395,7 +394,6 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return true;
}
@Deprecated
@Override
public boolean removeWhitelistedPlayer(final String name) {
UUID uuid = null;
@@ -494,7 +492,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return config;
}
public List<Component> getPingMessages() {
public List<String> getPingMessages() {
return pingMessages;
}
@@ -507,7 +505,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
}
@Nullable
public List<Component> getTimerSpecificPingMessages() {
public List<String> getTimerSpecificPingMessages() {
return timerSpecificPingMessages;
}
@@ -517,20 +515,21 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
// Yikeseroo
public String getPlayerCountMessage() {
return LegacyComponentSerializer.legacySection().serialize(plugin.replacePingVariables(playerCountMessage));
return LegacyComponentSerializer.legacySection().serialize(parse(plugin.replacePingVariables(playerCountMessage)));
}
// Yikeseroo x2
public String[] getPlayerCountHoverLines() {
final String[] lines = new String[playerCountHoverLines.size()];
for (int i = 0; i < playerCountHoverLines.size(); i++) {
final Component component = plugin.replacePingVariables(playerCountHoverLines.get(i));
lines[i] = LegacyComponentSerializer.legacySection().serialize(component);
final String component = plugin.replacePingVariables(playerCountHoverLines.get(i));
lines[i] = LegacyComponentSerializer.legacySection().serialize(parse(component));
}
return lines;
}
public Component getKickMessage() {
return plugin.replacePingVariables(getMessage("kickmessage"));
return parse(plugin.replacePingVariables(getLanguageString("kickmessage")));
}
public String getLanguage() {
@@ -541,6 +540,14 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return customPlayerCountMessage;
}
public boolean hasCustomPlayerCountHoverMessage() {
return customPlayerCountHoverMessage;
}
protected Component parse(final String s) {
return MiniMessage.miniMessage().deserialize(s);
}
/*
* Note on why this even exists: Yaml will force save all strings containing line breaks '\n' in this rather chunky format:
* key: |-
@@ -36,8 +36,6 @@ import eu.kennytv.maintenance.core.command.subcommand.WhitelistAddCommand;
import eu.kennytv.maintenance.core.command.subcommand.WhitelistCommand;
import eu.kennytv.maintenance.core.command.subcommand.WhitelistRemoveCommand;
import eu.kennytv.maintenance.core.util.SenderInfo;
import eu.kennytv.maintenance.core.util.ServerType;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
@@ -162,13 +160,8 @@ public abstract class MaintenanceCommand {
public void checkForUpdate(final SenderInfo sender) {
if (plugin.updateAvailable()) {
sender.sendMessage(plugin.getPrefix() + "§cNewest version available: §aVersion " + plugin.getNewestVersion() + "§c, you're on §a" + plugin.getVersion());
// Ore sad :(
if (plugin.getServerType() != ServerType.SPONGE) {
sender.sendMessage(plugin.getPrefix() + "§c§lWARNING: §cYou will have to restart the server to prevent further issues and to complete the update! If you can't do that, don't update!");
sendUpdateMessage(sender);
} else {
sender.sendMessage(plugin.getPrefix() + "§aDownload the latest version on the Ore plugin page: §bhttps://ore.spongepowered.org/KennyTV/Maintenance");
}
sender.sendMessage(plugin.getPrefix() + "§c§lWARNING: §cYou will have to restart the server to prevent further issues and to complete the update! If you can't do that, don't update!");
sendUpdateMessage(sender);
} else
sender.sendMessage(plugin.getPrefix() + "§aYou already have the latest version of the plugin!");
}
@@ -20,8 +20,6 @@ package eu.kennytv.maintenance.core.command.subcommand;
import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.command.CommandInfo;
import eu.kennytv.maintenance.core.util.SenderInfo;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import eu.kennytv.maintenance.lib.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import java.util.Collections;
import java.util.List;
@@ -48,7 +46,7 @@ public final class MotdCommand extends CommandInfo {
}
}
private void sendList(final SenderInfo sender, final List<Component> list) {
private void sendList(final SenderInfo sender, final List<String> list) {
if (list == null || list.isEmpty()) {
sender.send(getMessage("motdListEmpty"));
return;
@@ -56,15 +54,17 @@ public final class MotdCommand extends CommandInfo {
sender.send(getMessage("motdList"));
for (int i = 0; i < list.size(); i++) {
sender.sendMessage("§b" + (i + 1) + "§8§m---------");
sender.send(list.get(i));
sender.sendRich("<aqua>" + (i + 1) + "<dark_gray><st>---------");
sender.sendRich(list.get(i));
}
sender.sendMessage("§8§m----------");
sender.sendRich("<dark_gray><st>----------");
}
@Override
public List<String> getTabCompletion(final SenderInfo sender, final String[] args) {
if (args.length != 2 || !getSettings().hasTimerSpecificPingMessages()) return Collections.emptyList();
if (args.length != 2 || !getSettings().hasTimerSpecificPingMessages()) {
return Collections.emptyList();
}
return Collections.singletonList("timer");
}
}
@@ -21,7 +21,6 @@ import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.core.command.CommandInfo;
import eu.kennytv.maintenance.core.util.SenderInfo;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import java.util.ArrayList;
import java.util.Collections;
@@ -66,7 +65,7 @@ public final class RemoveMotdCommand extends CommandInfo {
return;
}
final List<Component> pingComponents = timerPingMessages ? settings.getTimerSpecificPingMessages() : settings.getPingMessages();
final List<String> pingComponents = timerPingMessages ? settings.getTimerSpecificPingMessages() : settings.getPingMessages();
pingComponents.remove(index - 1);
pingMessages.remove(index - 1);
settings.getConfig().set(timerPingMessages ? "timerspecific-pingmessages" : "pingmessages", pingMessages);
@@ -21,9 +21,6 @@ import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.core.command.CommandInfo;
import eu.kennytv.maintenance.core.util.SenderInfo;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import eu.kennytv.maintenance.lib.kyori.adventure.text.minimessage.MiniMessage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -56,7 +53,7 @@ public final class SetMotdCommand extends CommandInfo {
}
final Settings settings = getSettings();
final List<Component> pingComponents = timerPingMessages ? settings.getTimerSpecificPingMessages() : settings.getPingMessages();
final List<String> pingComponents = timerPingMessages ? settings.getTimerSpecificPingMessages() : settings.getPingMessages();
final List<String> pingMessages = settings.getConfig().getStringList(timerPingMessages ? "timerspecific-pingmessages" : "pingmessages");
final int index = Integer.parseInt(args[1]);
if (index == 0 || index > pingMessages.size() + 1) {
@@ -89,20 +86,23 @@ public final class SetMotdCommand extends CommandInfo {
}
// Replace component in config and the cached list
final Component component = MiniMessage.miniMessage().deserialize(newMessage.replace(NEW_LINE_REPLACEMENT, "\n"));
final String componentString = newMessage.replace(NEW_LINE_REPLACEMENT, "\n");
if (index > pingMessages.size()) {
pingMessages.add(newMessage);
pingComponents.add(component);
pingComponents.add(componentString);
} else {
pingMessages.set(index - 1, newMessage);
pingComponents.set(index - 1, component);
pingComponents.set(index - 1, componentString);
}
settings.getConfig().set(timerPingMessages ? "timerspecific-pingmessages" : "pingmessages", pingMessages);
settings.saveConfig();
sender.send(settings.getMessage("setMotd",
sender.send(settings.getMessage(
"setMotd",
"%LINE%", args[2],
"%INDEX%", args[1]).replaceText(builder -> builder.matchLiteral("%MOTD%").replacement(component)));
"%INDEX%", args[1],
"%MOTD%", componentString
));
}
@Override
@@ -20,7 +20,6 @@ package eu.kennytv.maintenance.core.command.subcommand;
import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.command.CommandInfo;
import eu.kennytv.maintenance.core.util.SenderInfo;
import eu.kennytv.maintenance.core.util.ServerType;
public final class UpdateCommand extends CommandInfo {
@@ -33,23 +32,24 @@ public final class UpdateCommand extends CommandInfo {
if (checkArgs(sender, args, 1)) return;
if (args[0].equalsIgnoreCase("update")) {
plugin.async(() -> plugin.getCommandManager().checkForUpdate(sender));
} else {
if (!plugin.updateAvailable()) {
sender.sendMessage(plugin.getPrefix() + "§aYou already have the latest version of the plugin!");
return;
}
// Ore very sad :(
if (plugin.getServerType() == ServerType.SPONGE) {
sender.sendMessage(plugin.getPrefix() + "§cSorry, automated downloading of the plugin is not supported on Sponge! Please download the latest version manually! :(");
return;
}
return;
}
sender.send(getMessage("updateDownloading"));
if (!plugin.updateAvailable()) {
sender.sendMessage(plugin.getPrefix() + "§aYou already have the latest version of the plugin!");
return;
}
sender.send(getMessage("updateDownloading"));
try {
if (plugin.installUpdate()) {
sender.send(getMessage("updateFinished"));
} else {
sender.send(getMessage("updateFailed"));
}
} catch (Exception e) {
sender.send(getMessage("updateFailed"));
e.printStackTrace();
}
}
}
@@ -33,7 +33,7 @@ import java.util.Map;
import java.util.Set;
/**
* Further modified version of the SimpleConfig project of PSandro (https://github.com/PSandro/SimpleConfig).
* Further modified version of the <a href="https://github.com/PSandro/SimpleConfig">SimpleConfig</a>SimpleConfig project of PSandro.
*
* @author PSandro on 26.01.19
* @author kennytv
@@ -51,7 +51,8 @@ public final class Config extends ConfigSection {
"###################################################################################################################\n" +
"# You can report bugs here: https://github.com/kennytv/Maintenance/issues\n" +
"# If you need any other help/support, you can also join my Discord server: https://discord.gg/vGCUzHq\n" +
"# The config and language files use MiniMessage, NOT legacy text for input. Use https://webui.adventure.kyori.net/ to edit and preview the formatted text.";
"# The config and language files use MiniMessage, NOT legacy text for input. Use https://webui.adventure.kyori.net/ to edit and preview the formatted text.\n" +
"# For a full list of formats and fancy examples of MiniMessage, see https://docs.adventure.kyori.net/minimessage/format.html\n";
private final Yaml yaml = createYaml();
private final File file;
private final Set<String> unsupportedFields;
@@ -25,7 +25,7 @@ import java.util.Map;
import java.util.Set;
/**
* Further modified version of the SimpleConfig project of PSandro (https://github.com/PSandro/SimpleConfig).
* Further modified version of the <a href="https://github.com/PSandro/SimpleConfig">SimpleConfig</a>SimpleConfig project of PSandro.
*
* @author kennytv
*/
@@ -26,7 +26,7 @@ import java.util.Map;
import java.util.regex.Pattern;
/**
* Further modified version of the SimpleConfig project of PSandro (https://github.com/PSandro/SimpleConfig).
* Further modified version of the <a href="https://github.com/PSandro/SimpleConfig">SimpleConfig</a>SimpleConfig project of PSandro.
*
* @author PSandro on 26.01.19
* @author kennytv
@@ -25,6 +25,7 @@ import java.io.File;
import java.util.LinkedHashMap;
import java.util.Map;
@SuppressWarnings({"FieldCanBeLocal", "unused"})
public final class MaintenanceDump {
private final ServerDump general;
private final Map<String, Object> configuration;
@@ -19,6 +19,7 @@ package eu.kennytv.maintenance.core.dump;
import java.util.List;
@SuppressWarnings({"FieldCanBeLocal", "unused"})
public final class PluginDump {
private final String name;
private final String version;
@@ -19,6 +19,7 @@ package eu.kennytv.maintenance.core.dump;
import java.util.List;
@SuppressWarnings({"FieldCanBeLocal", "unused"})
public final class ServerDump {
private final String pluginVersion;
private final String platform;
@@ -60,7 +60,9 @@ public abstract class JoinListenerBase {
if (!settings.hasUpdateChecks()) return;
if (!sender.hasPermission("maintenance.admin") || notifiedPlayers.contains(sender.getUuid())) return;
plugin.async(() -> {
if (!plugin.updateAvailable()) return;
if (!plugin.updateAvailable()) {
return;
}
notifiedPlayers.add(sender.getUuid());
sender.sendMessage(plugin.getPrefix() + "§cThere is a newer version available: §aVersion " + plugin.getNewestVersion() + "§c, you're on §a" + plugin.getVersion());
@@ -25,8 +25,8 @@ import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
public abstract class MaintenanceRunnableBase implements Runnable {
protected final MaintenancePlugin plugin;
protected final Settings settings;
protected final boolean enable;
private final Task task;
protected boolean enable;
protected int seconds;
protected MaintenanceRunnableBase(final MaintenancePlugin plugin, final Settings settings, final int seconds, final boolean enable) {
@@ -18,7 +18,7 @@
package eu.kennytv.maintenance.core.util;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import eu.kennytv.maintenance.lib.kyori.adventure.text.minimessage.MiniMessage;
import java.util.UUID;
public interface SenderInfo {
@@ -38,5 +38,9 @@ public interface SenderInfo {
void send(Component component);
default void sendRich(final String message) {
send(MiniMessage.miniMessage().deserialize(message));
}
boolean isPlayer();
}
+3 -2
View File
@@ -59,6 +59,7 @@ playercountmessage: "<dark_red>Maintenance"
# Is shown when you move your mouse above the text in the top right corner of the server in the serverlist,
# where the playercount would normally be displayed.
# DOES NOT SUPPORT RGB!
enable-playercounthovermessage: true
playercounthovermessage: "<red>Currently under<br><red>maintenance"
# If set to true, the server icon will be changed to the 'maintenance-icon.png' file in the plugin's folder during maintenance.
@@ -74,7 +75,7 @@ kick-online-players: true
# Changes the language of command feedback/messages.
# If you find missing translations or want to contribute a new language file, you are very welcome to message me on Spigot or my Discord server! :)
# Currently available are: en (English), de (German), fr (French), pt (Portuguese), es (Spanish), ru (Russian), zh (Chinese), it (Italian), pl (Polish)
# Currently available are: en (English), de (German), fr (French), pt (Portuguese), es (Spanish), ru (Russian), zh (Chinese), it (Italian), pl (Polish), tr (Turkish), sv (Swedish), uk (Ukrainian), ja (Japanese)
language: en
# If you have 2 or more proxy instances, the database connection will make sure all proxies
@@ -112,4 +113,4 @@ timer-broadcast-for-seconds: [1200, 900, 600, 300, 120, 60, 30, 20, 10, 5, 4, 3,
update-checks: true
# Used for autoupdating the config, do not change this value.
config-version: 6
config-version: 7
+9 -16
View File
@@ -1,8 +1,7 @@
# Maintenance Plugin by kennytv
# Nutze https://webui.adventure.kyori.net/ um Text zu editieren und eine formatierte Vorschau zu erhalten
# Alle Formate und Beispiele findet man unter https://docs.adventure.kyori.net/minimessage/format.html
# Nachrichten mit dem Platzhalter "<prefix>" haben diesen mit dem hier eingestellten Prefix ersetzt
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>Du hast nicht die erforderliche Berechtigung für diesen Befehl."
kickmessage: "<red>Der Server befindet sich momentan im Wartungsmodus!<br>Versuche es später nochmal!"
@@ -13,7 +12,7 @@ alreadyDisabled: "<prefix><red>Der Wartungsmodus ist bereits deaktiviert!"
endtimerBroadcast: "<prefix><gray>Der Wartungsmodus wird deaktiviert in: <gold>%TIME%<gray>."
endtimerStarted: "<prefix><green>Gestarteter Timer: <gray>Der Wartungsmodus wird deaktiviert in: <gold>%TIME%<gray>."
starttimerBroadcast: "<prefix><gray>Der Wartungsmodus wird aktiviert in: <gold>%TIME%<gray>."
starttimerStarted: "<prefix><green>Gestarteter Timer: <gray>Der Wartungsmodus wird aktiviert in: <gold>%TIME%<gray>"
starttimerStarted: "<prefix><green>Gestarteter Timer: <gray>Der Wartungsmodus wird aktiviert in: <gold>%TIME%<gray>."
scheduletimerBroadcast: "<prefix><gray>Der Wartungsmodus wird in <gold>%TIME% <gray>aktiviert und <gold>%DURATION% <gray>dauern."
timerAlreadyRunning: "<prefix><red>Momentan läuft bereits ein Timer!"
timerNotRunning: "<prefix><red>Momentan läuft kein Timer."
@@ -45,15 +44,13 @@ playerNotFound: "<prefix><red>Bisher hat kein Spieler mit diesem Namen jemals au
playerNotFoundUuid: "<prefix><red>Es konnte kein Spieler mit dieser UUID gefunden werden."
playerNotOnline: "<prefix><red>Es ist momentan kein Spieler mit diesem Namen online."
invalidUuid: "<prefix><red>Ungültiges UUID Format!"
# Nachrichten für den Bungee/Velocity Teil des Plugins, einfach ignorieren, falls das Plugin auf Spigot/Sponge verwendet wird
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>Du wurdest auf den Warteserver verbunden!"
forceWaitingServer: "<prefix><red>Du kannst den Warteserver nicht verlassen solange der Wartungsmodus aktiviert ist!"
serverNotFound: "<prefix><red>Es wurde kein Server mit diesem Namen gefunden!"
singleTimerAlreadyRunning: "<prefix><red>Momentan läuft bereits ein Timer auf diesem Server!"
singleTimerNotRunning: "<prefix><red>Momentan läuft kein Timer auf diesem Server."
singleTimerCancelled: "<prefix><red>Der laufende Timer dieses Servers wurde beendet."
singleTimerNotRunning: "<prefix><red>Momentan läuft kein Timer auf diesem Server."
singleEndtimerBroadcast: "<prefix><gray>Der Wartungsmodus auf Server %SERVER% wird deaktiviert in: <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>Der Wartungsmodus auf Server %SERVER% wird aktiviert in: <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>Der Wartungsmodus auf Server %SERVER% wird aktiviert in <gold>%TIME% <gray>und wird <gold>%DURATION% <gray>dauern."
@@ -66,14 +63,12 @@ singleServerAlreadyDisabled: "<prefix><red>Der Wartungsmodus ist bereits aus auf
singleServerMaintenanceList: "<prefix><gray>Unterserver, die im Wartungsmodus sind:"
singleServerMaintenanceListEmpty: "<prefix><gray>Es befindet sich momentan kein Unterserver im Wartungsmodus."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "Sekunde"
seconds: "Sekunden"
minute: "Minute"
minutes: "Minuten"
hour: "Stunde"
hours: "Stunden"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>Es gibt keine Seite mit dieser Nummer!"
helpNextPage: "<gray>Nutze <aqua>/maintenance help %SEITE%<gray>, um zur nächsten Hilfeseite zu kommen."
@@ -93,14 +88,12 @@ helpUpdate: "<gold>/maintenance update <gray>(Sucht nach neuen Updates für das
helpWhitelist: "<gold>/maintenance whitelist <gray>(Zeigt alle gewhitelisteten Spieler für den Wartungsmodus an)"
helpWhitelistAdd: "<gold>/maintenance add <Name/UUID> <gray>(Whitelistet einen Spieler für den Wartungsmodus, sodass dieser während Wartungen den Server betreten kann)"
helpWhitelistRemove: "<gold>/maintenance remove <Name/UUID> <gray>(Entfernt einen Spieler aus der Wartungsmodus Whitelist)"
# Nachrichten für den Bungee/Velocity Teil des Plugins, einfach ignorieren, falls das Plugin auf Spigot/Sponge verwendet wird
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [Server] <gray>(Falls momentan ein Timer läuft, wird dieser abgebrochen)"
helpSingleEndtimer: "<gold>/maintenance endtimer [Server] <Minuten> <gray>(Sobald der Timer abläuft wird der Wartungsmodus deaktiviert)"
helpSingleStarttimer: "<gold>/maintenance starttimer [Server] <Minuten> <gray>(Sobald der Timer abläuft wird der Wartungsmodus aktiviert)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [Server] <Minuten> <Wartung in Minuten> <gray>(Sobald der Timer abläuft wird der Wartungsmodus für die gegebene Länge aktiviert)"
helpSingleToggle: "<gold>/maintenance <on/off> [Server] <gray>(Aktiviert/deaktiviert den Wartungsmodus)"
helpStatus: "<gold>/maintenance status <gray>(Zeigt alle Server an, auf denen momentan der Wartungsmodus aktiviert ist)"
# Wird zum autoupdaten der Datei verwendet; darf nicht manuell verändert werden
#Used for autoupdating the language file, do not change this value.
language-version: 1
+7 -14
View File
@@ -1,8 +1,7 @@
# Maintenance Plugin by kennytv
# You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
# For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
# Messages containing the placeholder "<prefix>" will have it replaced with the following string
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>You do not have the permission to execute that command."
kickmessage: "<red>The server is currently under maintenance!<br>Try again later!"
@@ -45,12 +44,10 @@ playerNotFound: "<prefix><red>No player with this name has played on this server
playerNotFoundUuid: "<prefix><red>No player with that uuid could be found."
playerNotOnline: "<prefix><red>There is no player online with that name."
invalidUuid: "<prefix><red>Invalid uuid format!"
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>You have been sent to a waiting server!"
forceWaitingServer: "<prefix><red>You cannot leave the waiting server while maintenance is enabled!"
serverNotFound: "<prefix><red>No server with this name is registered on the proxy!"
singleTimerAlreadyRunning: "<prefix><red>There is already a timer scheduled for that server!"
singleTimerCancelled: "<prefix><red>The current timer for server <yellow>%SERVER% <red>has been disabled."
singleTimerNotRunning: "<prefix><red>There is currently no running timer for that server."
@@ -66,14 +63,12 @@ singleServerAlreadyDisabled: "<prefix><red>Maintenance is already disabled on se
singleServerMaintenanceList: "<prefix><gray>Proxied servers, that have maintenance enabled:"
singleServerMaintenanceListEmpty: "<prefix><gray>There are no proxied servers that are under maintenance."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "second"
seconds: "seconds"
minute: "minute"
minutes: "minutes"
hour: "hour"
hours: "hours"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>There is no page with that number!"
helpNextPage: "<gray>Use <aqua>/maintenance help %PAGE% <gray>to get to the next help window."
@@ -93,14 +88,12 @@ helpUpdate: "<gold>/maintenance update <gray>(Remotely downloads the newest vers
helpWhitelist: "<gold>/maintenance whitelist <gray>(Shows all whitelisted players for the maintenance mode)"
helpWhitelistAdd: "<gold>/maintenance add <name/uuid> <gray>(Adds the player to the maintenance whitelist, so they can join the server even though maintenance is enabled)"
helpWhitelistRemove: "<gold>/maintenance remove <name/uuid> <gray>(Removes the player from the maintenance whitelist)"
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [server] <gray>(If running, the current timer will be aborted)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minutes> <gray>(After the given time in minutes, maintenance mode will be disabled)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minutes> <gray>(After the given time in minutes, maintenance mode will be enabled)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(After the given time in minutes, maintenance mode will be enabled for the given duration in minutes)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(Enables/disables maintenance mode)"
helpStatus: "<gold>/maintenance status <gray>(Lists all proxied servers, that are currently under maintenance)"
# Used for autoupdating the language file, do not change this value.
#Used for autoupdating the language file, do not change this value.
language-version: 1
+8 -16
View File
@@ -1,9 +1,7 @@
# Maintenance Plugin by kennytv
# Translators: Vixo_Ulises
# You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
# For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
# Messages containing the placeholder "<prefix>" will have it replaced with the following string
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<prefix><dark_red>No tienes permiso para ejecutar este comando."
kickmessage: "<red>El servidor se encuentra en mantenimiento!<br>Intentalo de nuevo mas tarde!"
@@ -46,15 +44,13 @@ playerNotFound: "<prefix><gray>Ningun jugador con este nombre ha jugado en este
playerNotFoundUuid: "<prefix><red>No se pudo encontrar el jugador con ese UUID."
playerNotOnline: "<prefix><gray>No hay jugador en línea con este nombre."
invalidUuid: "<prefix><red>Formato inválido!"
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><green>Has sido enviado a un servidor de espera!"
forceWaitingServer: "<prefix><red>No puedes dejar el servidor de espera mientras el mantenimiento está activado!"
serverNotFound: "<prefix><red>Ningún servidor con este nombre está registrado en el proxy!"
singleTimerAlreadyRunning: "<prefix><red>Ya hay un temporizador programado!"
singleTimerNotRunning: "<prefix><red>Actualmente no hay ningún temporizador en ejecución para ese servidor."
singleTimerCancelled: "<prefix><red>El temporizador actual para el servidor <gold>%SERVER% <red>ha sido desactivado."
singleTimerNotRunning: "<prefix><red>Actualmente no hay ningún temporizador en ejecución para ese servidor."
singleEndtimerBroadcast: "<prefix><gray>El modo mantenimiento en el Servidor <gold>%SERVER% <gray>se desactivará en <green>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>El modo mantenimiento en el servidor <gold>%SERVER%<gray> se activará en <green>%TIME%<gray>"
singleScheduletimerBroadcast: "<prefix><gray>El modo mantenimiento en el servidor %SERVER% se activará en <gold>%TIME% <gray>y durará <gold>%DURATION%<gray>."
@@ -67,14 +63,12 @@ singleServerAlreadyDisabled: "<prefix><gray>El modo mantenimiento se encuentra d
singleServerMaintenanceList: "<prefix><gray>Servidores proxy, que tienen habilitado el mantenimiento:"
singleServerMaintenanceListEmpty: "<prefix><gray>No hay servidores proxy que están en mantenimiento."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "Segundo"
seconds: "Segundos"
minute: "Minuto"
minutes: "Minutos"
hour: "Hora"
hours: "Horas"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><gray>No hay pagina con ese número."
helpNextPage: "<gray>Utilice <aqua>/maintenance help %PAGE% <gray>Para pasar a la siguiente ventana de ayuda."
@@ -94,14 +88,12 @@ helpUpdate: "<gold>/maintenance update <dark_gray>(<gray>Descarga de forma remot
helpWhitelist: "<gold>/maintenance whitelist <dark_gray>(<gray>Muestra todos los jugadores en lista blanca para el modo de mantenimiento<dark_gray>)"
helpWhitelistAdd: "<gold>/maintenance add <name/uuid> <dark_gray>(<gray>Agrega al jugador a la lista blanca de mantenimiento, para que puedan unirse al servidor aunque el mantenimiento esté habilitado<dark_gray>)"
helpWhitelistRemove: "<gold>/maintenance remove <name/uuid> <dark_gray>(<gray>Quita al jugador de la lista blanca de mantenimiento<dark_gray>)"
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [servidor] <dark_gray>(<gray>Si está funcionando, se abortará el temporizador actual<dark_gray>)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minutes> <dark_gray>(<gray>Después del tiempo en minutos, se desactivará el modo de mantenimiento<dark_gray>)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minutes> <dark_gray>(<gray>Después del tiempo en minutos, se activara el modo de mantenimiento<dark_gray>)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(Tras los minutos introducidos, el modo mantenimiento se activará durante la duración introducida.)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <dark_gray>(<gray>Habilita / deshabilita el modo de mantenimiento<dark_gray>)"
helpStatus: "<gold>/maintenance status <dark_gray>(<gray>Enumera todos los servidores proxy, que están actualmente en mantenimiento<dark_gray>)"
# Used for autoupdating the language file, do not change this value.
#Used for autoupdating the language file, do not change this value.
language-version: 1
+8 -15
View File
@@ -1,8 +1,7 @@
# Plugin Maintenance par kennytv, traduit en Français par Zendrique & Aurelien30000.
# You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
# For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
# Messages containing the placeholder "<prefix>" will have it replaced with the following string
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>Vous n'avez pas la permission d'exécuter cette commande."
kickmessage: "<red>Le serveur est actuellement en maintenance !<br>Réessayez plus tard !"
@@ -45,15 +44,13 @@ playerNotFound: "<prefix><red>Aucun joueur avec ce nom n'a auparavant joué sur
playerNotFoundUuid: "<prefix><red>Aucun joueur avec cet UUID n'a pu être trouvé."
playerNotOnline: "<prefix><red>Il n'y a pas de joueur en ligne avec ce nom."
invalidUuid: "<prefix><red>Le format de l'UUID est invalide !"
# Quelques messages pour la partie Bungee/Velocity, ignorez-les si vous utilisez le plugin sur Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>Vous avez été redirigé(e) vers un serveur d'attente !"
forceWaitingServer: "<prefix><red>Vous ne pouvez pas quitter le serveur d'attente tant que la maintenance est activée !"
serverNotFound: "<prefix><red>Aucun serveur avec ce nom n'est enregistré sur le proxy !"
singleTimerAlreadyRunning: "<prefix><red>Il y a déjà un horaire prévu sur ce serveur !"
singleTimerNotRunning: "<prefix><red>Il n'y a actuellement aucune maintenance prévue sur ce serveur."
singleTimerCancelled: "<prefix><red>La minuterie actuelle a été désactivée sur ce serveur."
singleTimerNotRunning: "<prefix><red>Il n'y a actuellement aucune maintenance prévue sur ce serveur."
singleEndtimerBroadcast: "<prefix><gray>La maintenance sur le serveur %SERVER% sera désactivée dans <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>La maintenance sur le serveur %SERVER% sera activée dans <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
@@ -66,14 +63,12 @@ singleServerAlreadyDisabled: "<prefix><red>La maintenance est déjà désactivé
singleServerMaintenanceList: "<prefix><gray>Serveurs proxy ayant la maintenance activée :"
singleServerMaintenanceListEmpty: "<prefix><gray>Il n'y a pas de serveurs proxy en maintenance."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "seconde"
seconds: "secondes"
minute: "minute"
minutes: "minutes"
hour: "heure"
hours: "heures"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>Il n'y a pas cette page !"
helpNextPage: "<gray>Utilisez <aqua>/maintenance help %PAGE% <gray>pour accéder à la fenêtre d’aide suivante."
@@ -93,14 +88,12 @@ helpUpdate: "<gold>/maintenance update <gray>(Télécharge la dernière version
helpWhitelist: "<gold>/maintenance whitelist <gray>(Affiche les joueurs de la liste blanche pour le mode maintenance)"
helpWhitelistAdd: "<gold>/maintenance add <name/uuid> <gray>(Ajoute un joueur à la liste blanche de maintenance afin qu'il puisse rejoindre le serveur même si la maintenance est activée)"
helpWhitelistRemove: "<gold>/maintenance remove <name/uuid> <gray>(Supprime un joueur de la liste blanche de maintenance)"
# Quelques messages pour la partie Bungee/Velocity, ignorez-les si vous utilisez le plugin sur Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [server] <gray>(Si en cours d'exécution, le minuteur actuel sera abandonné)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minutes> <gray>(Après le temps imparti en minutes, le mode maintenance sera désactivé)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minutes> <gray>(Après le temps imparti en minutes, le mode maintenance sera activé)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(Après le temps imparti en minutes, le mode maintenance sera activé pour la durée spécifiée en minutes)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(Active/désactive le mode maintenance)"
helpStatus: "<gold>/maintenance status <gray>(Répertorie tous les serveurs mandatés actuellement en maintenance)"
# Used for autoupdating the language file, do not change this value.
#Used for autoupdating the language file, do not change this value.
language-version: 1
+7 -15
View File
@@ -1,9 +1,7 @@
# Maintenance Plugin by kennytv
# Translators: TheViperShow
# You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
# For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
# Messages containing the placeholder "<prefix>" will have it replaced with the following string
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>Non hai i permessi necessari per eseguire quel comando."
kickmessage: "<red>Il server è momentaneamente in manutenzione!<br>Riprova più tardi!"
@@ -46,12 +44,10 @@ playerNotFound: "<prefix><red>Nessun giocatore con questo username è mai entrat
playerNotFoundUuid: "<prefix><red>Nessun player con quell'uuid è stato trovato."
playerNotOnline: "<prefix><red>Non c'è nessun giocatore online con quell'username."
invalidUuid: "<prefix><red>L'uuid presenta un formato invalido!"
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>Sei stato inviato su un server d'attesa!"
forceWaitingServer: "<prefix><red>Non puoi abbandonare il server d'attesa durante una manutenzione!"
serverNotFound: "<prefix><red>Nessun server con questo nome è registrato sulla proxy!"
singleTimerAlreadyRunning: "<prefix><red>È già presente un timer pianificato per quel server!"
singleTimerCancelled: "<prefix><red>Il timer attuale per il server <yellow>%SERVER% <red>è stato rimosso."
singleTimerNotRunning: "<prefix><red>Non c'è nessun timer correntemente attivo per quel server."
@@ -67,14 +63,12 @@ singleServerAlreadyDisabled: "<prefix><red>La modalità manutenzione è già dis
singleServerMaintenanceList: "<prefix><gray>Servers sotto proxy che hanno la modalità manutenzione attiva:"
singleServerMaintenanceListEmpty: "<prefix><gray>Nessun server sotto proxy ha la modalità manutenzione attiva."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "secondo"
seconds: "secondi"
minute: "minuto"
minutes: "minuti"
hour: "ora"
hours: "ore"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>Non c'è alcuna pagina con quel numero!"
helpNextPage: "<gray>Usa <aqua>/maintenance help %PAGE% <gray>per andare alla prossima pagina d'aiuto."
@@ -94,14 +88,12 @@ helpUpdate: "<gold>/maintenance update <gray>(Scarica dall'esterno l'ultima vers
helpWhitelist: "<gold>/maintenance whitelist <gray>(Elenca tutti i giocatori nella whitelist per la manutenzione)"
helpWhitelistAdd: "<gold>/maintenance add <name/uuid> <gray>(Aggiunge il giocatore alla whitelist di manutenzione, così possono entrare in un server durante la manutenzione)"
helpWhitelistRemove: "<gold>/maintenance remove <name/uuid> <gray>(Rimuovi il player dalla whitelist della manutenzione)"
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [server] <gray>(Se attivo, il timer attuale verrà fermato)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minutes> <gray>(Dopo il tempo fornito in minuti, la modalità manutenzione sarà rimossa)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minutes> <gray>(Dopo il tempo fornito in minuti, la modalità manutenzione sarà attivata)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(After the given time in minutes, maintenance mode will be enabled for the given duration in minutes)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(Abilita/Disabilita la modalità manutenzione)"
helpStatus: "<gold>/maintenance status <gray>(Elenca tutti i server sotto proxy che hanno la modalità manutenzione attiva)"
# Used for autoupdating the language file, do not change this value.
#Used for autoupdating the language file, do not change this value.
language-version: 1
+99
View File
@@ -0,0 +1,99 @@
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>このコマンドを実行する権限がありません。"
kickmessage: "<red>メンテナンス中です。<br>むやみにアクセスしないでください。"
maintenanceActivated: "<prefix><green>メンテナンスを有効にしました。"
maintenanceDeactivated: "<prefix><yellow>メンテナンスを解除しました。"
alreadyEnabled: "<prefix><red>メンテナンスは既に有効です。"
alreadyDisabled: "<prefix><red>メンテナンスは常に解除されています。"
endtimerBroadcast: "<prefix><gray>メンテナンスモードは、<gold>%TIME%<gray>で無効になります。"
endtimerStarted: "<prefix><green>メンテナンスモードは<gold>%TIME%<gray>で解除されます。"
starttimerBroadcast: "<prefix><gray>タイマー開始:<gray>メンテナンスモードは、<gold>%TIME%<gray>で有効になります。"
starttimerStarted: "<prefix><green>タイマー開始:<gray>メンテナンスモードは<gold>%TIME%<gray>で開始されます。"
scheduletimerBroadcast: "<prefix><gray>メンテナンスモードは、<gold>%TIME% <gray>で有効になり、<gold>%DURATION%<gray>の間、持続されます。"
timerAlreadyRunning: "<prefix><red>すでにタイマーが設定されています。"
timerNotRunning: "<prefix><red>現在、実行中のタイマーはありません。"
timerCancelled: "<prefix><red>現在のタイマーを中止しました。"
timerTooLong: "<prefix><red>40320(28日)以下でなければなりません。"
timerMotdDisabled: "<prefix><red>タイマー固有のモットーを使用/編集したい場合は、config.yml内の「enable-timerspecific-messages」を「true」に設定する必要があります。"
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
joinNotification: "<prefix><red>%PLAYER% <white>がサーバーに参加しようとしました。"
motdList: "<prefix><gray>MOTDのリスト: "
motdListEmpty: "<prefix><red>MOTDが設定されていません。"
reload: "<prefix><green>再読み込みが完了しました。"
removedMotd: "<prefix><green>motd番号%INDEX%を削除しました。"
removeMotdError: "<prefix><red>motdは1つしかないので、削除することはできません。"
setMotd: "<prefix><greenINDEX%.の行 %LINE% を %MOTD% に設定します。"
setMotdIndexError: "<prefix><red>現在、%MOTDS%のMOTDを持っているので、1から%NEWAMOUNT%の間の数字を選ぶ必要があります。"
setMotdLineError: "<prefix><red>第2引数には、行番号(1または2)を指定する必要があります。"
updateDownloading: "<prefix><red><bold>アップデートをダウンロード中です..."
updateFailed: "<prefix><dark_red><bold>アップデートに失敗しました。"
updateFinished: "<prefix><green><bold>アップデートが完了しました! アップデートを完了させるために、サーバーを再起動する必要があります。"
whitelistedPlayers: "<prefix><gold>メンテナンスのホワイトリストに追加されたプレイヤー: "
whitelistedPlayersFormat: "<dark_gray>- <yellow>%NAME% <dark_gray>(<gray>%UUID%<dark_gray>)"
whitelistAdded: "<prefix><aqua>%PLAYER% <green>をホワイトリストに追加しました。"
whitelistAlreadyAdded: "<prefix><aqua>%PLAYER% <green>をホワイトリストに追加しました。"
whitelistRemoved: "<prefix><aqua>%PLAYER% <green>をホワイトリストから削除しました。"
whitelistNotFound: "<prefix><aqua>%PLAYER% <green>不明なユーザーです。"
whitelistEmpty: "<prefix><red>使用方法が違います。<yellow>/maintenance add <player/uuid> <red>を使用してください。"
playerNotFound: "<prefix><red>不明なユーザーです。"
playerNotFoundUuid: "<prefix><red>不明なUUIDです。"
playerNotOnline: "<prefix><red>このユーザーはオンラインではありません。"
invalidUuid: "<prefix><red>UUID形式が無効です。"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>待機中のサーバーに転送されました。"
forceWaitingServer: "<prefix><red>メンテナンスが有効な間は、待機中のサーバーから離れることはできません。"
serverNotFound: "<prefix><red>この名前のサーバーはプロキシに登録されていません。"
singleTimerAlreadyRunning: "<prefix><red>そのサーバーには既にタイマーが設定されています。"
singleTimerCancelled: "<prefix><yellow>%SERVER% <red>の現在のタイマが解除されました。"
singleTimerNotRunning: "<prefix><red>現在、そのサーバーの実行中のタイマーはありません。"
singleEndtimerBroadcast: "<prefix><gray>%SERVER% のメンテナンスモードは、<gold>%TIME%<gray> で無効になります。"
singleStarttimerBroadcast: "<prefix><gray>%SERVER% のメンテナンスモードは、<gold>%TIME%<gray> で有効になります。"
singleScheduletimerBroadcast: "<prefix><gray>サーバ %SERVER% のメンテナンスモードは <gold>%TIME% <gray> で有効になり、<gold>%DURATION%<gray> の間持続します。"
singleMaintenanceKick: "<prefix><red>%SERVER% はメンテナンス中です。むやみにアクセスしないでください。"
singleMaintenanceKickComplete: "<red>The server %SERVER% is under maintenance!<br>You may try to rejoin to go onto another server!"
singleMaintenanceActivated: "<prefix><yellow>%SERVER%<green> のメンテナンスを有効にしました。"
singleMaintenanceDeactivated: "<prefix><yellow>%SERVER%<yellow> のメンテナンスを解除しました。"
singleServerAlreadyEnabled: "<prefix><yellow>%SERVER%<red> のメンテナンスは既に有効です。"
singleServerAlreadyDisabled: "<prefix><yellow>%SERVER%<red> のメンテナンスは既に無効です。"
singleServerMaintenanceList: "<prefix><gray>プロキシサーバーで、メンテナンスが有効になっているもの: "
singleServerMaintenanceListEmpty: "<prefix><gray>メンテナンス中のプロキシサーバーはありません。"
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "秒"
seconds: "秒"
minute: "分"
minutes: "分"
hour: "時間"
hours: "時間"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>その番号のページがありません。"
helpNextPage: "<gray>Use <aqua>/maintenance help %PAGE% <gray>で次のヘルプウィンドウに移動します。"
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(タイマーを実行していた場合、タイマーの実行を中止します。)"
helpEndtimer: "<gold>/maintenance endtimer <minutes> <gray>(分単位で指定された時間が経過すると、メンテナンスモードは無効になります。)"
helpStarttimer: "<gold>/maintenance starttimer <minutes> <gray>(分単位で指定された時間経過後、メンテナンスモードが有効になります。)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <タイマーの時間> <メンテナンスの時間> <gray>(分単位で指定した時間が経過すると、分単位で指定した時間だけメンテナンスモードが有効になります。)"
helpDebug: "<gold>/maintenance debug <gray>(デバッグロギングを有効にします。)"
helpDump: "<gold>/maintenance dump <gray>(バグレポートに使用される、いくつかのサーバ情報をダンプします。)"
helpHelp: "<gold>/maintenance help [page] <gray>(このようなヘルプページが表示されます。)"
helpMotd: "<gold>/maintenance motd [timer] <gray>(現在設定されているメンテナンスMOTDを一覧表示します。'timer'を指定した場合は、タイマーの場合のMOTDを表示します。)"
helpRemoveMotd: "<gold>/maintenance removemotd [timer] <index> <gray>(メンテナンスの場合に使用されるMOTDを削除します。引数として'timer'を使用した場合にはタイマー固有のピングメッセージが表示されます。)"
helpSetMotd: "<gold>/maintenance setmotd [timer] <index> <1/2> <message> <gray>(メンテナンスの場合に使用されるMOTDを設定します。引数として'timer'を使用した場合にはタイマー固有のピングメッセージが表示されます。)"
helpReload: "<gold>/maintenance reload <gray>(設定ファイル、ホワイトリストファイル、サーバーアイコンを再読み込みします。)"
helpToggle: "<gold>/maintenance <on/off> <gray>(メンテナンスモードの有効/解除を設定します。)"
helpUpdate: "<gold>/maintenance update <gray>(最新版のプラグインをサーバーにリモートでダウンロードします。)"
helpWhitelist: "<gold>/maintenance whitelist <gray>(メンテナンスモードのホワイトリストに登録されているすべてのプレーヤーを表示します。)"
helpWhitelistAdd: "<gold>/maintenance add <name/uuid> <gray>(メンテナンスのホワイトリストにユーザーを追加し、メンテナンスが有効な状態でもサーバーに参加できるようにします。)"
helpWhitelistRemove: "<gold>/maintenance remove <name/uuid> <gray>(メンテナンスのホワイトリストからプレーヤーを削除します。)"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [server] <gray>(もし、タイマーが実行中の場合、現在のタイマーを中止します。)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minutes> <gray>(分単位で指定された時間が経過すると、メンテナンスモードは無効になります。)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minutes> <gray>(分単位で指定された時間経過後、メンテナンスモードが有効になります。)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <タイマーの時間> <メンテナンスの時間> <gray>(分単位で指定した時間が経過すると、分単位で指定した時間だけメンテナンスモードが有効になります)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(メンテナンスモードの有効化/無効化を設定します。)"
helpStatus: "<gold>/maintenance status <gray>(現在メンテナンス中のプロキシサーバーをすべてリストアップします。)"
#Used for autoupdating the language file, do not change this value.
language-version: 1
+9 -16
View File
@@ -1,10 +1,9 @@
# Maintenance Plugin by kennytv. Translation by Slasherss and EEEGuba
# You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
# For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
# Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>Nie masz permisji na użycie tej komendy."
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Prace techniczne<dark_gray>] "
noPermission: "<red>Nie posiadasz permisji na użycie tej komendy."
kickmessage: "<red>Serwer jest w trakcie przerwy technicznej!<br>Spróbuj ponownie później!"
maintenanceActivated: "<prefix><gold>Tryb konserwacji włączony."
maintenanceDeactivated: "<prefix><gold>Tryb konserwacji wyłączony."
@@ -45,12 +44,10 @@ playerNotFound: "<prefix><red>Ten gracz nigdy nie grał na serwerze."
playerNotFoundUuid: "<prefix><red>Nie można znaleźć gracza z tym uuid."
playerNotOnline: "<prefix><red>Nie ma gracza online z tym nickiem."
invalidUuid: "<prefix><red>Nieprawidłowy format uuid!"
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>Zostałeś wysłany do poczekalni!"
forceWaitingServer: "<prefix><red>Nie możesz opuścić poczekalni gdy tryb konserwacji jest włączony!"
serverNotFound: "<prefix><red>Brak serwera z tą nazwą!"
singleTimerAlreadyRunning: "<prefix><red>Timer został już zaplanowany na tym serwerze!"
singleTimerCancelled: "<prefix><red>Timer dla serwera <yellow>%SERVER% <red>został wyłączony."
singleTimerNotRunning: "<prefix><red>Nie ma działających timerów na tym serwerze."
@@ -66,14 +63,12 @@ singleServerAlreadyDisabled: "<prefix><red>Tryb konserwacji jest już wyłączon
singleServerMaintenanceList: "<prefix><gray>Serwery z włączonym trybem konserwacji:"
singleServerMaintenanceListEmpty: "<prefix><gray>Brak serwerów pod nadzorem."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "sekunda"
seconds: "sekund"
minute: "minuta"
minutes: "minuty"
hour: "godzina"
hours: "godzin/y"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>Strona z tym numerem nie istnieje!"
helpNextPage: "<gray>Użyj <aqua>/maintenance help %PAGE% <gray>aby przejść do następnej strony pomocy."
@@ -93,14 +88,12 @@ helpUpdate: "<gold>/maintenance update <gray>(Pobiera najnowszą wersję plugina
helpWhitelist: "<gold>/maintenance whitelist <gray>(Pokazuje białą listę trybu konserwacji)"
helpWhitelistAdd: "<gold>/maintenance add <nazwa/uuid> <gray>(Dodaje gracza do listy konserwacji, aby mogli dołączyć do serwera w trakcie konserwacji)"
helpWhitelistRemove: "<gold>/maintenance remove <nazwa/uuid> <gray>(Usuwa gracza z listy trybu konserwacji)"
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [serwer] <gray>(Jeśli aktywny, timer zostanie anulowany)"
helpSingleEndtimer: "<gold>/maintenance endtimer [serwer] <minuty> <gray>(Po czasie podanym w minutach, tryb konserwacji zostanie wyłączony)"
helpSingleStarttimer: "<gold>/maintenance starttimer [serwer] <minuty> <gray>(Po czasie podanym w minutach, tryb konserwacji zostanie włączony)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [serwer] <minuty timera> <długośc konserwacji> <gray>(Po czasie podanym w minutach, tryb konserwacji zostanie włączony na podaną ilość minut)"
helpSingleToggle: "<gold>/maintenance <on/off> [serwer] <gray>(Włącza/wyłącza tryb konserwacji)"
helpStatus: "<gold>/maintenance status <gray>(Wyświetla wszystkie serwery w trybie konserwacji)"
# Used for autoupdating the language file, do not change this value.
#Used for autoupdating the language file, do not change this value.
language-version: 1
+8 -16
View File
@@ -1,9 +1,7 @@
# Maintenance Plugin by kennytv
# Translators: JoaoPinto
# You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
# For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
# Messages containing the placeholder "<prefix>" will have it replaced with the following string
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>Nao tens permissao para executar este comando."
kickmessage: "<red>O servidor esta em manutencao!<br>Tente mais tarde!"
@@ -46,15 +44,13 @@ playerNotFound: "<prefix><red>Ninguem com esse nome se registou no servidor."
playerNotFoundUuid: "<prefix><red>Nenhum player com esse uuid foi encontrado."
playerNotOnline: "<prefix><red>Nao esta ninguem online com esse nome"
invalidUuid: "<prefix><red>Formato de uuid invalido!"
# Algumas mensagens para o Bungee/Velocity, ignora-as se estas a usar Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<dark_gray>[<yellow>Manutencao<dark_gray>] <red>Foste enviado para um servidor para aguardares ate que fique disponivel novamente!"
forceWaitingServer: "<dark_gray>[<yellow>Manutencao<dark_gray>] <red>Nao podes sair deste servidor enquanto a manutencao estiver habilitada!"
serverNotFound: "<prefix><red>Servidor nao encontrado!"
singleTimerAlreadyRunning: "<prefix><red>O Timer ja esta a decorrer!"
singleTimerNotRunning: "<prefix><red>O Timer nao esta a decorrer!"
singleTimerCancelled: "<prefix><red>O Timer foi cancelado no!"
singleTimerNotRunning: "<prefix><red>O Timer nao esta a decorrer!"
singleEndtimerBroadcast: "<prefix><gray>Manutencao no %SERVER% vai ser desativada em <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>Manutencao no %SERVER% vai ser ativada em <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<dark_gray>[<yellow>Manutencao<dark_gray>] <gray>O servidor %SERVER% ira entrar em manutencao em <gold>%TIME% <gray>e ira durar <gold>%DURATION%<gray>."
@@ -67,14 +63,12 @@ singleServerAlreadyDisabled: "<prefix><red>Manutencao ja esta desativada no <yel
singleServerMaintenanceList: "<prefix><gray>Servidores com manutencao ativa:"
singleServerMaintenanceListEmpty: "<prefix><gray>Nao existem servidores com a manutencao ativa."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "segundo"
seconds: "segundos"
minute: "minuto"
minutes: "minutos"
hour: "hora"
hours: "horas"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<dark_gray>[<yellow>Manutencao<dark_gray>] <red>Nao existe nenhuma pagina com esse numero!"
helpNextPage: "<gray>Use <aqua>/maintenance help %PAGE% <gray>para ir para a próxima págin."
@@ -94,14 +88,12 @@ helpUpdate: "<gold>/maintenance update <gray>(Arualiza o plugin de manutenção)
helpWhitelist: "<gold>/maintenance whitelist <gray>(Mostra os payers que estão na whitelist)"
helpWhitelistAdd: "<gold>/maintenance add <name/uuid> <gray>(Adiciona o player à whitelist para poder entrar durante a manutenção)"
helpWhitelistRemove: "<gold>/maintenance remove <name/uuid> <gray>(Remove o player da whitelist)"
# Algumas mensagens para o Bungee/Velocity, ignora-as se estas a usar Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [server] <gray>(Se o timer estiver ativado este vai ser abortado)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minutes> <gray>(Depois do tempo dado a manutenção vai ser desativada)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minutes> <gray>(Depois do tempo dado a manutenção vai ser ativa)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(Apos o tempo determinado em minutos, o modo de manutenção sera habilitado para a duracao em minutos)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(Ativa/Desativa a manutenção)"
helpStatus: "<gold>/maintenance status <gray>(Lista os servers em proxy que estão em manutenção)"
# Used for autoupdating the language file, do not change this value.
#Used for autoupdating the language file, do not change this value.
language-version: 1
+8 -16
View File
@@ -1,9 +1,7 @@
# Maintenance Plugin by kennytv
# Translators: En_0t_S
# You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
# For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
# Messages containing the placeholder "<prefix>" will have it replaced with the following string
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>У вас недостаточно прав!"
kickmessage: "<red>Сервер закрыт на технические работы!"
@@ -46,12 +44,10 @@ playerNotFound: "<red>Игрок не найден!"
playerNotFoundUuid: "<red>Игрок с таким UUID не найден!"
playerNotOnline: "<red>Игрок должен быть онлайн!"
invalidUuid: "<red>Неверный формат UUID!"
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<red>Вы были перемещены в лобби!"
forceWaitingServer: "<red>Вы не можете покинуть лобби во время технических работ!"
serverNotFound: "<red>Сервер не найден!"
singleTimerAlreadyRunning: "<red>Таймер сервера <white>%SERVER% <red>уже запущен!"
singleTimerCancelled: "<gray>Таймер сервера <white>%SERVER% <gray>был остановлен."
singleTimerNotRunning: "<red>Таймер сервера <white>%SERVER% <red>не был запущен."
@@ -67,14 +63,12 @@ singleServerAlreadyDisabled: "<red>Режим технических работ
singleServerMaintenanceList: "<gray>Сервера на которых включен режим технических работ:"
singleServerMaintenanceListEmpty: "<gray>Сервера на которых включен режим технических работ: <white>пусто"
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "секунду"
seconds: "секунд"
minute: "минуту"
minutes: "минут"
hour: "час"
hours: "часов"
helpHeader: "<gray>========[ <white>%NAME% <gray>| <gold>%PAGE%<white>/<gold>%MAX% <gray>]========"
helpPageNotFound: "<red>Страница не найдена."
helpNextPage: "<white>Используйте <gold>/maintenance help %PAGE% <white>чтобы перейти на следующую страницу."
@@ -94,14 +88,12 @@ helpUpdate: "<gold>/maintenance update <gray>- <white>Обновить плаг
helpWhitelist: "<gold>/maintenance whitelist <gray>- <white>Отобразить всех игроков из белого списка."
helpWhitelistAdd: "<gold>/maintenance add [ник|uuid] <gray>- <white>Добавить игрока в белый список."
helpWhitelistRemove: "<gold>/maintenance remove [ник|uuid] <gray>- <white>Удалить игрока из белого списка."
# Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [сервер] <gray>- <white>Остановить таймер включения/выключения режима технических работ."
helpSingleEndtimer: "<gold>/maintenance endtimer [сервер] [время в минутах] <gray>- <white>Запустить таймер выключения режима технических работ."
helpSingleStarttimer: "<gold>/maintenance starttimer [сервер] [время в минутах] <gray>- <white>Запустить таймер включения режима технических работ."
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(After the given time in minutes, maintenance mode will be enabled for the given duration in minutes)"
helpSingleToggle: "<gold>/maintenance [on|off] [сервер] <gray>- <white>Включить/выключить режим технических работы."
helpSingleToggle: "<gold>/maintenance [on|off] [сервер] <gray>- <white>Включить/выключить режим технических работ."
helpStatus: "<gold>/maintenance status <gray>- <white>Список всех серверов закрытых на технические работы."
# Used for autoupdating the language file, do not change this value.
#Used for autoupdating the language file, do not change this value.
language-version: 1
+99
View File
@@ -0,0 +1,99 @@
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Underhållsarbete<dark_gray>] "
noPermission: "<red>Du har inte rättigheterna att utfärda det kommandot."
kickmessage: "<red>Sevrern är just nu under underhåll!<br>Försök igen senare!"
maintenanceActivated: "<prefix><gold>Underhållsläge är aktiverat."
maintenanceDeactivated: "<prefix><gold>Underhållsläge är avaktiverat."
alreadyEnabled: "<prefix><red>Underhållsläge är redan aktiverat!"
alreadyDisabled: "<prefix><red>Underhållsläge är redan avaktiverat!"
endtimerBroadcast: "<prefix><gray>Underhållsläget kommer att vara avstängt om <gold>%TIME%<gray>."
endtimerStarted: "<prefix><green>Startade timer: <gray>Underhållsläge kommer stängas av om <gold>%TIME%<gray>."
starttimerBroadcast: "<prefix><gray>Underhållsläge kommer aktiveras om <gold>%TIME%<gray>."
starttimerStarted: "<prefix><green>Startade timer: <gray>Underhållsläge kommer aktiveras om <gold>%TIME%<gray>."
scheduletimerBroadcast: "<prefix><gray>Underhållsläge kommer aktiveras om <gold>%TIME% <gray>och håller på i <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>Det finns redan en timer schemalagd!"
timerNotRunning: "<prefix><red>Ingen timer är aktiverad för tillfället."
timerCancelled: "<prefix><red>Den nuvarande timern har blivit inaktiverad."
timerTooLong: "<prefix><red>Talet måste vara mindre än 40320 (28 days)!"
timerMotdDisabled: "<prefix><red>Du måste sätta värdet för 'enable-timerspecific-messages' i konfigurationsfilen filen till 'true', om du vill använda/redigera tidsspecifika motds."
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
joinNotification: "<prefix><yellow>%PLAYER% <red>försökte ansluta till servern."
motdList: "<prefix><gray>Lista på dina underhålls motds:"
motdListEmpty: "<prefix><red>Du har inte skapat några underhålls motds än!"
reload: "<prefix><green>Laddade om konfigurationsfilen, vitlistade spelare, språkfilerna och underhålls ikonen."
removedMotd: "<prefix><green>Tog bort motd nummer %INDEX%."
removeMotdError: "<prefix><red>Du har bara en motd, så du kan inte ta bort några!"
setMotd: "<prefix><green>Satte linjen %LINE% av %INDEX%. underhålls motd till %MOTD%"
setMotdIndexError: "<prefix><red>Du har just nu %MOTDS% motds, så du måste välja ett nummer mellan 1 och %NEWAMOUNT%."
setMotdLineError: "<prefix><red>Det andra argumentet måste vara linjenumret (1 or 2)!"
updateDownloading: "<prefix><red><bold>Laddar ner uppdatering..."
updateFailed: "<prefix><dark_red><bold>Uppdatering misslyckades!"
updateFinished: "<prefix><green><bold>Uppdateringen genomfördes framgångsrikt! För att förebygga problem med uppgifter och för att färdigställa uppdateringen, måste du starta om servern!"
whitelistedPlayers: "<prefix><gold>Vitlistade spelare för underhåll:"
whitelistedPlayersFormat: "<dark_gray>- <yellow>%NAME% <dark_gray>(<gray>%UUID%<dark_gray>)"
whitelistAdded: "<prefix><green>Lade till <aqua>%PLAYER% <green>till underhållsvitlistan!"
whitelistAlreadyAdded: "<prefix><aqua>%PLAYER% <red>finns redan med i underhållsvitlistan!"
whitelistRemoved: "<prefix><green>Tog bort <aqua>%PLAYER% <green>från underhållsvitlistan!"
whitelistNotFound: "<prefix><red>Den specifierade spelaren är inte med i vitlistan!"
whitelistEmpty: "<prefix><red>Underhållsvitlistan är tom! Använd <yellow>/maintenance add <player/uuid> <red>för att lägga till någon!"
playerNotFound: "<prefix><red>Ingen spelare med detta namn har spelat på servern tidigare."
playerNotFoundUuid: "<prefix><red>Ingen spelare med det uuid hittades."
playerNotOnline: "<prefix><red>Det finns ingen spelare med det namnet online."
invalidUuid: "<prefix><red>Ogiltigt uuid format!"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>Du har blvitt skickad till en väntserver!"
forceWaitingServer: "<prefix><red>Du kan inte lämna väntservern medans underhållsläget är aktiverat!"
serverNotFound: "<prefix><red>Ingen server med det namnet är registerad på proxyn!"
singleTimerAlreadyRunning: "<prefix><red>Det finns redan en timer schemalagd för den servern!"
singleTimerCancelled: "<prefix><red>Den nuvarande timern för för server <yellow>%SERVER% <red>har blivit avaktiverad."
singleTimerNotRunning: "<prefix><red>Det finns för närvarande ingen timer för den servern."
singleEndtimerBroadcast: "<prefix><gray>Underhållsläge på server %SERVER% kommer avaktiveras om <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>Underhållsläge på server %SERVER% kommer aktiveras om <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>Underhållsläge på server %SERVER% kommer aktiveras om <gold>%TIME% <gray>och håller på i <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>Servern %SERVER% är just nu i underhåll! Försök igen senare!"
singleMaintenanceKickComplete: "<red>Servern %SERVER% är just nu i underhåll!<br>Du kan försöka återansluta dig för att gå in på en annan server!"
singleMaintenanceActivated: "<prefix><gold>Underhållsläge är nu aktiverat på server <yellow>%SERVER%<gold>."
singleMaintenanceDeactivated: "<prefix><gold>Underhållsläge är nu avaktiverat på server <yellow>%SERVER%<gold>."
singleServerAlreadyEnabled: "<prefix><red>Underhåll är redan aktiverat på server <yellow>%SERVER%<red>!"
singleServerAlreadyDisabled: "<prefix><red>Underhåll är redan avaktiverat på server <yellow>%SERVER%<red>!"
singleServerMaintenanceList: "<prefix><gray>Proxiade servrar, som är under underhåll:"
singleServerMaintenanceListEmpty: "<prefix><gray>Det finns inga proxiade servrar som har underhåll aktiverat."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "sekund"
seconds: "sekunder"
minute: "minut"
minutes: "minuter"
hour: "timme"
hours: "timmar"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>Det finns ingen sida med det numret!"
helpNextPage: "<gray>Use <aqua>/maintenance help %PAGE% <gray>för att komma till nästa hjälpsida."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(Om timern körs, kommer den nuvarande timern avbrytas)"
helpEndtimer: "<gold>/maintenance endtimer <minuter> <gray>(Efter den specificerade tiden i minuter, kommer underhållsläge avaktiveras)"
helpStarttimer: "<gold>/maintenance starttimer <minuter> <gray>(Efter den specificerade tiden i minuter, kommer underhållsläge att aktiveras)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <timer minuter> <maintenance duration> <gray>(Efter den specificerade tiden i minuter, kommer underhållsläge att aktiveras för den angivna varaktigheten i minuter)"
helpDebug: "<gold>/maintenance debug <gray>(Aktiverar lite felsöknings loggande)"
helpDump: "<gold>/maintenance dump <gray>(Dumpar lite serverinformation, används för buggrapportering)"
helpHelp: "<gold>/maintenance help [sida] <gray>(Visar denna magiskt fina hjälpsida)"
helpMotd: "<gold>/maintenance motd [timer] <gray>(Listar alla för närvarande aktiva underhålls motds. Om argumentet 'timer' specificeras, kommer alla timer motds visas)"
helpRemoveMotd: "<gold>/maintenance removemotd [timer] <index> <gray>(Tar bort ett motd. Om 'timer' används som argument, kommer ett timerspecifikt pingmeddelande bli borttaget)"
helpSetMotd: "<gold>/maintenance setmotd [timer] <index> <1/2> <meddelande> <gray>(Sätter ett specifikt motd. If using. Om argumentet 'timer' specificeras, kommer ett timerspecifikt pingmeddelande bli satt)"
helpReload: "<gold>/maintenance reload <gray>(Laddar om konfigurationsfilen, vitlistan and server ikonen)"
helpToggle: "<gold>/maintenance <on/off> <gray>(Aktiverar/avaktiverar underhållsläget)"
helpUpdate: "<gold>/maintenance update <gray>(Avlägset laddar ner senaste versionen av insticksprogrammet på din server)"
helpWhitelist: "<gold>/maintenance whitelist <gray>(Visar alla vitlistade spelare för underhållsläget)"
helpWhitelistAdd: "<gold>/maintenance add <namn/uuid> <gray>(Lägger till en spelare på vitlistan för underhållsläget, så de kan logga in även om underhåll är aktiverat)"
helpWhitelistRemove: "<gold>/maintenance remove <namn/uuid> <gray>(Tar bort spelaren från vitlistan för underhållsläget)"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [server] <gray>(Vid utfärdandet av detta kommando kommer den nuvarande timern bli avbruten)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minuter> <gray>(Efter den angivna tiden kommer underhållsläge avaktiveras)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minuter> <gray>(Efter den angivna tiden kommer underhållsläge aktiveras)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minuter> <maintenance duration> <gray>(Efter den angivna tiden i minuter kommer underhållsläge vara aktiverat i den specificerade tiden)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(Aktiverar/avaktiverar underhållsläge)"
helpStatus: "<gold>/maintenance status <gray>(Listar alla proxiade servrar som är i underhåll)"
#Used for autoupdating the language file, do not change this value.
language-version: 1
+99
View File
@@ -0,0 +1,99 @@
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<yellow><bold>Sunucu<bold> <dark_gray>▸ "
noPermission: "<red>Bunun için iznin yok!"
kickmessage: "<red>Sunucuda bakım çalışması vardır!"
maintenanceActivated: "<prefix><gold>Bakım modu aktif."
maintenanceDeactivated: "<prefix><gold>Bakım modu deaktif."
alreadyEnabled: "<prefix><red>Bakım modu zaten aktif!"
alreadyDisabled: "<prefix><red>Bakım modu zaten deaktif!"
endtimerBroadcast: "<prefix><gray>Bakım modu <gold>%TIME%<gray> içerisinde devre dışı olacak."
endtimerStarted: "<prefix><green>Başlatılan zamanlayıcı: <gray>Bakım modu <gold>%TIME%<gray> içerisinde devre dışı olacak."
starttimerBroadcast: "<prefix><gray>Bakım modu <gold>%TIME%<gray> içerisinde etkin olacak."
starttimerStarted: "<prefix><green>Başlatılan zamanlayıcı: <gray>Bakım modu <gold>%TIME%<gray> içerisinde etkin olacak."
scheduletimerBroadcast: "<prefix><gray>Bakım modu <gold>%TIME% <gray>içerisinde etkin olacak ve <gold>%DURATION%<gray> sürecek."
timerAlreadyRunning: "<prefix><red>Zaten planlanmış bir zamanlayıcı var!"
timerNotRunning: "<prefix><red>Şu anda çalışan bir zamanlayıcı yok."
timerCancelled: "<prefix><red>Geçerli zamanlayıcı devre dışı bırakıldı."
timerTooLong: "<prefix><red>Belirtilen sayı 40320'den küçük olmalıdır (28 güne tekabül)!"
timerMotdDisabled: "<prefix><red>Zamanlayıcıya özgü motd'ları kullanmak/düzenlemek istiyorsanız, konfigürasyonda 'enable-timerspecial-messages' kısmını 'true' olarak ayarlamalısınız."
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
joinNotification: "<prefix><yellow>%PLAYER% <red>sunucuya katılmaya çalıştı."
motdList: "<prefix><gray>Bakım modu MOTD'leriniz:"
motdListEmpty: "<prefix><red>Herhangi bir MOTD ayarlamadınız!"
reload: "<prefix><green>Konfigürasyon dosyaları yeniden yüklendi."
removedMotd: "<prefix><green>%INDEX% numaralı MOTD kaldırıldı."
removeMotdError: "<prefix><red>Yalnızca bir MOTD'niz var, bu nedenle hiçbirini kaldıramazsınız!"
setMotd: "<prefix><green>%LINE% satırını %INDEX% ayarlayın. Bakım MOTD'si %MOTD%"
setMotdIndexError: "<prefix><red>Şu anda %MOTDS% motd'unuz var, bu yüzden 1 ile %NEWAMOUNT% arasında bir sayı seçmeniz gerekiyor."
setMotdLineError: "<prefix><red>2. argüman satır numarası (1 veya 2) olmalıdır.!"
updateDownloading: "<prefix><red><bold>Güncelleme indiriliyor..."
updateFailed: "<prefix><dark_red><bold>Güncelleme hataya uğradı!"
updateFinished: "<prefix><green><bold>Güncelleme başarılı oldu! Işleyişle ilgili sorunları önlemek ve güncellemeyi tamamlamak için sunucuyu yeniden başlatmanız gerekir!"
whitelistedPlayers: "<prefix><gold>Bakım için beyaz listeye alınan oyuncular:"
whitelistedPlayersFormat: "<dark_gray>- <yellow>%NAME% <dark_gray>(<gray>%UUID%<dark_gray>)"
whitelistAdded: "<prefix><aqua>%PLAYER% <green>bakım için beyaz listeye eklendi!"
whitelistAlreadyAdded: "<prefix><aqua>%PLAYER% <red>zaten bakım için beyaz listede yer alıyor!"
whitelistRemoved: "<prefix><aqua>%PLAYER% <green>bakım için beyaz listeden kaldırıldı!"
whitelistNotFound: "<prefix><red>Bu oyuncu bakım için beyaz listesinde değil!"
whitelistEmpty: "<prefix><red>Bakım beyaz listesi boş! Eklemek için <yellow>/maintenance add <isim/uuid> <red>komutunu kullan!"
playerNotFound: "<prefix><red>Bu sunucuda daha önce bu isimde hiçbir oyuncu oynamadı."
playerNotFoundUuid: "<prefix><red>Bu UUID'ye sahip hiçbir oyuncu bulunamadı."
playerNotOnline: "<prefix><red>Bu isimle çevrimiçi oyuncu yok."
invalidUuid: "<prefix><red>Geçersiz UUID biçimi!"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>Bekleme sunucusuna gönderildiniz!"
forceWaitingServer: "<prefix><red>Bakım varken bekleme sunucusundan ayrılamazsınız!"
serverNotFound: "<prefix><red>Bu ada sahip hiçbir sunucu BungeeCord'da kayıtlı değil!"
singleTimerAlreadyRunning: "<prefix><red>Bu sunucu için planlanmış bir zamanlayıcı zaten var!"
singleTimerCancelled: "<prefix><yellow>%SERVER% <red>sunucusu için zamanlayıcı devre dışı bırakıldı."
singleTimerNotRunning: "<prefix><red>Şu anda o sunucu için çalışan bir zamanlayıcı yok."
singleEndtimerBroadcast: "<prefix><gray>%SERVER% sunucusundaki bakım modu <gold>%TIME%<gray> içerisinde devre dışı olacaktır."
singleStarttimerBroadcast: "<prefix><gray>%SERVER% sunucusunda <gold>%TIME%<gray> içerisinde bakım modu etkin olacaktır."
singleScheduletimerBroadcast: "<prefix><gray%SERVER% sunucusunda <gold>%TIME% <gray> içerisinde bakım modu etkin olacaktır, süre: <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>%SERVER% sunucusunda bakım modu aktif!"
singleMaintenanceKickComplete: "<red>%SERVER% sunucusunda bakım modu aktif!"
singleMaintenanceActivated: "<prefix><yellow>%SERVER%<gold> sunucusunda bakım modu aktifleştirildi."
singleMaintenanceDeactivated: "<prefix><yellow>%SERVER%<gold> sunucusunda bakım modu devre dışı bırakıldı."
singleServerAlreadyEnabled: "<prefix><yellow>%SERVER%<red> sunucusunda zaten bakım modu aktif!"
singleServerAlreadyDisabled: "<prefix>%SERVER%<red> sunucusunda zaten bakım modu deaktif!"
singleServerMaintenanceList: "<prefix><gray>Bakımı etkinleştirilmiş sunucular:"
singleServerMaintenanceListEmpty: "<prefix><gray>Bakımda olan sunucu yok."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "saniye"
seconds: "saniye"
minute: "dakika"
minutes: "dakika"
hour: "saat"
hours: "saat"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>Bu numaraya sahip bir sayfa yok!"
helpNextPage: "<aqua>/maintenance help %PAGE% <gray>yazarak bir sonraki yardım sayfasına geçebilirsiniz."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(Eğer çalışıyorsa mevcut zamanlayıcı iptal edilecektir.)"
helpEndtimer: "<gold>/maintenance endtimer <dakika> <gray>(Dakika olarak verilen süreden sonra bakım modu devre dışı bırakılır)"
helpStarttimer: "<gold>/maintenance starttimer <dakika> <gray>(Dakika olarak verilen süreden sonra bakım modu etkinleştirilecektir.)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <bakımın başlması için geçecek zaman> <bakım süresinin zamanı> <gray>(Dakika olarak verilen süreden sonra, dakika olarak verilen süre için bakım modu etkinleştirilecektir.)"
helpDebug: "<gold>/maintenance debug <gray>(Bazı hata ayıklama kaydını etkinleştirir)"
helpDump: "<gold>/maintenance dump <gray>(Hata raporları için kullanılan bazı sunucu bilgilerini atar)"
helpHelp: "<gold>/maintenance help [sayfa] <gray>(Bu güzel yardım penceresini gösterir)"
helpMotd: "<gold>/maintenance motd [zamanlayıcı] <gray>(Halihazırda ayarlanmış bakım MOTD'lerini listeler. Zamanlayıcı belirtilirse, zamanlayıcı modları gösterilir)"
helpRemoveMotd: "<gold>/maintenance removemotd [zamanlayıcı] <dizin> <gray>(Bir bakım MOTD'sini kaldırır. Argüman olarak zamanlayıcı kullanılıyorsa, zamanlayıcıya özel bir MOTD mesajı kaldırılacaktır)"
helpSetMotd: "<gold>/maintenance setmotd [zamanlayıcı] <dizin> <1/2> <mesaj> <gray>(Bakım modu için bir MOTD ayarlar. Argüman olarak zamanlayıcı kullanılıyorsa, zamanlayıcıya özel MOTD ping mesajı ayarlanır)"
helpReload: "<gold>/maintenance reload <gray>(Konfigürasyon dosyasını, beyaz liste dosyasını ve sunucu simgesini yeniden yükler)"
helpToggle: "<gold>/maintenance <on/off> <gray>(Bakım modunu etkinleştirir/devre dışı bırakır)"
helpUpdate: "<gold>/maintenance update <gray>(Eklentinin en yeni sürümünü sunucunuza uzaktan indirir)"
helpWhitelist: "<gold>/maintenance whitelist <gray>(Bakım modu için beyaz listedeki tüm oyuncuları gösterir)"
helpWhitelistAdd: "<gold>/maintenance add <isim/uuid> <gray>(Oyuncuyu bakım beyaz listesine ekler, böylece bakım etkin olsa bile sunucuya katılabilir)"
helpWhitelistRemove: "<gold>/maintenance remove <isim/uuid> <gray>(Oyuncuyu bakım beyaz listesinden kaldırır)"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [sunucu] <gray>(Çalışıyorsa, mevcut zamanlayıcı iptal edilecektir.)"
helpSingleEndtimer: "<gold>/maintenance endtimer [sunucu] <dakika> <gray>(Dakika olarak verilen süreden sonra bakım modu devre dışı bırakılır)"
helpSingleStarttimer: "<gold>/maintenance starttimer [sunucu] <dakika> <gray>(Dakika olarak verilen süreden sonra bakım modu etkinleştirilecektir.)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [sunucu] <dakika> <maintenance duration> <gray>(Dakika olarak verilen süreden sonra, dakika olarak verilen süre için bakım modu etkinleştirilecektir.)"
helpSingleToggle: "<gold>/maintenance <on/off> [sunucu] <gray>(Bakım modunu etkinleştirir/devre dışı bırakır)"
helpStatus: "<gold>/maintenance status <gray>(Şu anda bakımda olan tüm sunucuları listeler)"
#Used for autoupdating the language file, do not change this value.
language-version: 1
+99
View File
@@ -0,0 +1,99 @@
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>У вас недостатньо прав!"
kickmessage: "<red>Сервер зачинено на технічні роботи!"
maintenanceActivated: "<green>Режим технічних робіт увімкнено!"
maintenanceDeactivated: "<gray>Режим технічних робіт вимкнено!"
alreadyEnabled: "<red>Режим технічних робіт вже увімкнено!"
alreadyDisabled: "<red>Режим технічних робіт був включений."
endtimerBroadcast: "<green>Сервер буде відкритий через<white>%TIME%<green>!"
endtimerStarted: "<green>Таймер успішно запущено! Сервер буде відкритий через<white>%TIME%<green>!"
starttimerBroadcast: "<green>Сервер буде закрито на технічні роботи через <white>%TIME%<green>!"
starttimerStarted: "<green>Таймер успішно запущено! Сервер буде закрито на технічні роботи через <white>%TIME%<green>!"
scheduletimerBroadcast: "<prefix><gray>Технічні роботи розпочнуться в<gold>%TIME% <gray>і триватимуть <gold>%DURATION%<gray>."
timerAlreadyRunning: "<red>Таймер вже запущено!"
timerNotRunning: "<red>Таймер не було запущено."
timerCancelled: "<gray>Таймер було зупинено."
timerTooLong: "<red>Число має бути не більше ніж <white>40320 <red>(<white>28 <red>днів)."
timerMotdDisabled: "<red>Повідомлення про таймер вимкнено в налаштуваннях плагіна."
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
joinNotification: "<red>Гравець <white>%PLAYER% <red>намагався зайти на сервер."
motdList: "<gray>Лист титульних рядків у режимі технічних робіт:"
motdListEmpty: "<red>Лист порожній."
reload: "<green>Плагін успішно перезавантажено!"
removedMotd: "<green>Титульний рядок з індексом <white>%INDEX% <green>успішно видалено!"
removeMotdError: "<red>Ви не можете видалити останні 2 титульні рядки."
setMotd: "<green>Титульний рядок <white>%LINE% <green>з індексом<white>%INDEX% <green>успішно змінено: <white>%MOTD%"
setMotdIndexError: "<red>Неправильний індекс, допустимі значення: 1 - %NEWAMOUNT%."
setMotdLineError: "<red>Другий аргумент має бути номером рядка (1 или 2)!"
updateDownloading: "<green>Оновлення завантажується..."
updateFailed: "<red>Оновлення не вдалось!"
updateFinished: "<green>Оновлення успішно пройдено! Перезавантажте сервер, щоб уникнути можливих проблем."
whitelistedPlayers: "<gray>Білий лист у режимі технічних робіт:"
whitelistedPlayersFormat: "<gray>- <white>%NAME% <gray>(<white>%UUID%<gray>)"
whitelistAdded: "<green>Гравець <white>%PLAYER% <green>успішно доданий у білий лист!"
whitelistAlreadyAdded: "<red>Гравець <white>%PLAYER% <red>вже у білому листі!"
whitelistRemoved: "<green>Гравця <white>%PLAYER% <green>успішно видалено з білого листа!"
whitelistNotFound: "<red>Цей гравець не знаходиться у білому листі!"
whitelistEmpty: "<red>Білий лист порожній! Використовуйте /maintenance add [Гравець|uuid] щоб додати когось."
playerNotFound: "<red>Гравець не знайден!"
playerNotFoundUuid: "<red>Гравець з таким UUID не знайден!"
playerNotOnline: "<red>Гравець повинен бути онлайн!"
invalidUuid: "<red>Невірний формат UUID!"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<red>Ви були переміщені у лобі!"
forceWaitingServer: "<red>Ви не можете залишити лобі під час технічних робіт!"
serverNotFound: "<red>Сервер не знайдено!"
singleTimerAlreadyRunning: "<red>Таймер сервера <white>%SERVER% <red>вже запущено!"
singleTimerCancelled: "<gray>Таймер сервера <white>%SERVER% <gray>було зупинено."
singleTimerNotRunning: "<red>Таймер сервера <white>%SERVER% <red>не був запущений."
singleEndtimerBroadcast: "<green>Сервер <white>%SERVER% <green>буде відкрито через <white>%TIME%<green>!"
singleStarttimerBroadcast: "<red>Увага! Сервер <white>%SERVER% <red>буде закрито на технічні роботи через <white>%TIME%<red>!"
singleScheduletimerBroadcast: "<prefix><gray>Технічні роботи на сервері %SERVER% почнуться через <gold>%TIME% <gray>і триватиме <gold>%DURATION%<gray>."
singleMaintenanceKick: "<red>Цей сервер закрито на технічні роботи! Спробуй пізніше."
singleMaintenanceKickComplete: "<red>Цей сервер закрито на технічні роботи!<br>Спробуйте пізніше."
singleMaintenanceActivated: "<green>Режим технічних робіт на сервері <white>%SERVER% <green>увімкнено!"
singleMaintenanceDeactivated: "<green>Режим технічних робіт на сервері <white>%SERVER% <green>вимкнено!"
singleServerAlreadyEnabled: "<red>Режим технічних робіт на сервері <white>%SERVER% <red>вже включений!"
singleServerAlreadyDisabled: "<red>Режим технічних робіт на сервері <white>%SERVER% <red>не був включений."
singleServerMaintenanceList: "<gray>Сервера на яких включено режим технічних робіт:"
singleServerMaintenanceListEmpty: "<gray>Сервера на яких включено режим технічних робіт:<white>порожньо"
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "секунду"
seconds: "секунд"
minute: "хвилину"
minutes: "хвилин"
hour: "година"
hours: "годин"
helpHeader: "<gray>========[ <white>%NAME% <gray>| <gold>%PAGE%<white>/<gold>%MAX% <gray>]========"
helpPageNotFound: "<red>Сторінку не знайдено."
helpNextPage: "<white>Використовуйте <gold>/maintenance help %PAGE% <white>щоб перейти до наступної сторінки."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>- <white>Зупинити таймер увімкнення/вимкнення режиму технічних робіт."
helpEndtimer: "<gold>/maintenance endtimer [час в хвилинах] <gray>- <white>Запустити таймер вимкнення режиму технічних робіт."
helpStarttimer: "<gold>/maintenance starttimer [час в хвилинах] <gray>- <white>Запустити таймер увімкнення режиму технічних робіт."
helpScheduleTimer: "<gold>/maintenance scheduletimer <timer minutes> <maintenance duration> <gray>(Через заданий час у хвилинах технічні роботи буде ввімкнено на заданий час у хвилинах)"
helpDebug: "<gold>/maintenance debug <gray>(Вмикає деяке журналювання налагодження)"
helpDump: "<gold>/maintenance dump <gray>- <white>Створити дамп."
helpHelp: "<gold>/maintenance help [сторінка] <gray>- <white>Відобразити список доступних команд."
helpMotd: "<gold>/maintenance motd <timer> <gray>- <white>Відобразити список титульних повідомлень."
helpRemoveMotd: "<gold>/maintenance removemotd <timer> [індекс] <gray>- <white>Видалити титульне повідомлення."
helpSetMotd: "<gold>/maintenance setmotd <timer> [індекс] [1|2] [сообщение] <gray>- <white>Додати нове титульне повідомлення."
helpReload: "<gold>/maintenance reload <gray>- <white>Перезавантажити плагін."
helpToggle: "<gold>/maintenance [on|off] <gray>- <white>Увімкнути/вимкнути режим технічних робіт."
helpUpdate: "<gold>/maintenance update <gray>- <white>Оновити плагін."
helpWhitelist: "<gold>/maintenance whitelist <gray>- <white>Відобразити всіх гравців із білого листа."
helpWhitelistAdd: "<gold>/maintenance add [ник|uuid] <gray>- <white>Додати гравця до білого листа."
helpWhitelistRemove: "<gold>/maintenance remove [ник|uuid] <gray>- <white>Видалити гравця із білого листа."
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [сервер] <gray>- <white>Зупинити таймер увімкнення/вимкнення режиму технічних робіт."
helpSingleEndtimer: "<gold>/maintenance endtimer [сервер] [время в минутах] <gray>- <white>Запустити таймер вимкнення режиму технічних робіт."
helpSingleStarttimer: "<gold>/maintenance starttimer [сервер] [время в минутах] <gray>- <white>Запустити таймер увімкнення режиму технічних робіт."
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(Через заданий час у хвилинах технічні роботи буде ввімкнено на заданий час у хвилинах)"
helpSingleToggle: "<gold>/maintenance [on|off] [сервер] <gray>- <white>Увімкнути/вимкнути режим технічних робіт."
helpStatus: "<gold>/maintenance status <gray>- <white>Список всіх серверів, закритих на технічні роботи."
#Used for autoupdating the language file, do not change this value.
language-version: 1
+7 -15
View File
@@ -1,9 +1,7 @@
# Maintenance 插件由 kennytv 开发
# 简体中文由 RinAfter 提供
# You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
# For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
# Messages containing the placeholder "<prefix>" will have it replaced with the following string
#Maintenance Plugin by kennytv
#You can use https://webui.adventure.kyori.net/ to edit and preview the formatted text
#For a full list of formats and fancy examples, see https://docs.adventure.kyori.net/minimessage/format.html
#Messages containing the placeholder "<prefix>" will have it replaced with the following string
prefix: "<dark_gray>[<yellow>Maintenance<dark_gray>] "
noPermission: "<red>你没有执行该命令的权限。"
kickmessage: "<red>服务器正在维护!<br>请稍后再试!"
@@ -46,12 +44,10 @@ playerNotFound: "<prefix><red>此服务器上从未出现该名称的玩家"
playerNotFoundUuid: "<prefix><red>找不到具有该UUID的玩家。"
playerNotOnline: "<prefix><red>没有使用该名称的在线玩家"
invalidUuid: "<prefix><red>无效的UUID格式!"
# Bungee/Velocity消息,如果在Spigot/Sponge上使用则可忽略以下内容
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>您已被传送到等待服务器!"
forceWaitingServer: "<prefix><red>启用维护时,您不能离开等待服务器!"
serverNotFound: "<prefix><red>未找到拥有此名称的服务器!"
singleTimerAlreadyRunning: "<prefix><red>该服务器已有计时器正在运行!"
singleTimerCancelled: "<prefix><red>服务器<yellow>%SERVER%<red>的计时器已中止"
singleTimerNotRunning: "<prefix><red>该服务器当前没有正在运行的计时器。"
@@ -67,14 +63,12 @@ singleServerAlreadyDisabled: "<prefix><red>服务器<yellow>%SERVER%<red>的维
singleServerMaintenanceList: "<prefix><gray>已开启维护的服务器有:"
singleServerMaintenanceListEmpty: "<prefix><gray>没有正在维护的服务器"
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "秒"
seconds: "秒"
minute: "分钟"
minutes: "分钟"
hour: "小时"
hours: "小时"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>没有此页码的帮助页!"
helpNextPage: "<gray>使用<aqua>/maintenance help %PAGE% <gray>切换到下一帮助页"
@@ -94,14 +88,12 @@ helpUpdate: "<gold>/maintenance update <gray>(远程下载最新版本插件到
helpWhitelist: "<gold>/maintenance whitelist <gray>(显示所有维护玩家白名单)"
helpWhitelistAdd: "<gold>/maintenance add <name/uuid> <gray>(将玩家加入维护玩家白名单,这样即使开启了维护,他们也能加入服务器)"
helpWhitelistRemove: "<gold>/maintenance remove <name/uuid> <gray>(将玩家从维护玩家白名单中移除)"
# Bungee/Velocity消息,如果在Spigot/Sponge上使用则可忽略以下内容
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [server] <gray>(中止指定服务器开启的计时器)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minutes> <gray>(在以分钟为单位给定时间后将关闭指定服务器的维护模式)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minutes> <gray>(在以分钟为单位给定时间后将开启指定服务器的维护模式)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(After the given time in minutes, maintenance mode will be enabled for the given duration in minutes)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(开启/关闭指定服务器的维护模式)"
helpStatus: "<gold>/maintenance status <gray>(列出当前正在维护的所有服务器)"
# Used for autoupdating the language file, do not change this value.
#Used for autoupdating the language file, do not change this value.
language-version: 1
@@ -25,6 +25,8 @@ import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import static org.junit.jupiter.api.Assertions.*;
// I'm sorry in advance
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ConfigTest {
@@ -39,11 +41,22 @@ class ConfigTest {
copyOriginalToTest("config.yml", "config.yml");
}
@Test
void testHeader() throws Exception {
final Config config = new Config(getTestFile("config.yml"));
config.load();
final String header = config.getHeader();
config.resetAwesomeHeader();
assertTrue(config.getHeader().endsWith("\n"), "Header needs to end with a new line");
assertEquals(config.getHeader(), header);
}
@Test
void testDeep() throws IOException {
final Config config = new Config(getTestFile("config.yml"));
config.load();
assert config.getInt("mysql.port") == 3306;
assertEquals(3306, config.getInt("mysql.port"));
}
@Test
@@ -57,7 +70,7 @@ class ConfigTest {
final Config newlyLoaded = new Config(saveTo);
newlyLoaded.load();
assert newlyLoaded.toString().equals(config.toString());
assertEquals(config.toString(), newlyLoaded.toString());
}
@Test
@@ -85,13 +98,13 @@ class ConfigTest {
final Config newlyLoaded = new Config(saveTo);
newlyLoaded.load();
assert newlyLoaded.contains("waiting-server");
assert newlyLoaded.getComments().get("maintenance-enabled") != null;
assert newlyLoaded.getComments().get("mysql.use-ssl") != null;
assert newlyLoaded.getComments().get("update-checks") != null;
assert newlyLoaded.getHeader().equals(newestConfig.getHeader());
assert newlyLoaded.getSection("mysql").getString("username").equals("useer");
assert newlyLoaded.getInt("config-version") == 4;
assertTrue(newestConfig.contains("waiting-server"));
assertNotNull(newestConfig.getComments().get("maintenance-enabled"));
assertNotNull(newestConfig.getComments().get("mysql.use-ssl"));
assertNotNull(newestConfig.getComments().get("update-checks"));
assertEquals(newlyLoaded.getHeader(), newestConfig.getHeader());
assertEquals("useer", newlyLoaded.getSection("mysql").getString("username"));
assertEquals(4, newlyLoaded.getInt("config-version"));
}
@Test
@@ -100,11 +113,11 @@ class ConfigTest {
config.load();
// Test for pre-existing values
assert config.contains("fallback");
assert config.contains("mysql.password");
assert !config.contains("test");
assert config.getComments().containsKey("fallback");
assert config.getComments().containsKey("mysql.use-ssl");
assertTrue(config.contains("fallback"));
assertTrue(config.contains("mysql.password"));
assertFalse(config.contains("test"));
assertTrue(config.getComments().containsKey("fallback"));
assertTrue(config.getComments().containsKey("mysql.use-ssl"));
config.set("test", "abc");
config.remove("fallback");
@@ -112,12 +125,14 @@ class ConfigTest {
section.set("port", 1000);
section.remove("use-ssl");
assert config.contains("test") && config.getString("test").equals("abc");
assert config.getInt("mysql.port") == 1000;
assert !config.contains("mysql.use-ssl") && !config.getSection("mysql").contains("use-ssl");
assert !config.contains("fallback");
assert !config.getComments().containsKey("fallback");
assert !config.getComments().containsKey("mysql.use-ssl");
assertTrue(config.contains("test"));
assertEquals("abc", config.getString("test"));
assertEquals(1000, config.getInt("mysql.port"));
assertFalse(config.contains("mysql.use-ssl"));
assertFalse(config.getSection("mysql").contains("use-ssl"));
assertFalse(config.contains("fallback"));
assertFalse(config.getComments().containsKey("fallback"));
assertFalse(config.getComments().containsKey("mysql.use-ssl"));
}
private File getTestFile(final String path) {
@@ -139,4 +154,4 @@ class ConfigTest {
file.delete();
}
}
}
}
+61
View File
@@ -0,0 +1,61 @@
# Enables maintenance mode.
maintenance-enabled: true
# Enables maintenance on certain servers managed by your Bungee instance(s).
proxied-maintenance-servers:
- SpigotServer1
# - AnotherServer
# If maintenance is enabled on a proxied server with players on it,
# they will be sent to the fallback server instead of being kicked off the network.
# If the fallback server is not reachable/not set, they will just be kicked off the network.
fallback: ''
# The message shown in the multiplayer server list motd when maintenance is enabled.
# If you put in multiple entries, one of them will be chosen randomly on every ping.
# If running an endtimer, the time left can be displayed by including '%TIMER%' in a pingmessage (also works in playercount(-hover) message).
pingmessages:
- |2-
&2&lX's &b&lServer &f- &7&l(1.12.2-1.15.2)
&4&n&lMANUTENZIONE!
enable-timerspecific-messages: true
timerspecific-pingmessages:
- |2-
&2&lX's &b&lServer &f- &7&l(1.12.2-1.15.2)
&4&n&lMANUTENZIONE! Torneremo tra %TIMER%
enable-playercountmessage: true
playercountmessage: '&41.12.2-1.15.2'
playercounthovermessage: '&n&lStato server: In manutenzione'
custom-maintenance-icon: false
send-join-notification: false
kick-online-players: true
language: de
mysql:
use-mysql: false
host: host
port: 3306
database: database
username: useer
password: password
update-interval: 15
use-ssl: true
continue-endtimer-after-restart:
enabled: false
end: 0
timer-broadcast-for-seconds:
- 1200
- 900
- 600
- 300
- 120
- 60
- 30
- 20
- 10
- 5
- 4
- 3
- 2
- 1
update-checks: true
config-version: 3
+3
View File
@@ -0,0 +1,3 @@
files:
- source: /core/src/main/resources/language-en.yml
translation: /core/src/main/resources/language-%two_letters_code%.yml
+1 -1
View File
@@ -1,4 +1,4 @@
projectVersion=4.0.0
projectVersion=4.1.0
# Gradle properties
org.gradle.daemon=true
+23 -13
View File
@@ -3,28 +3,30 @@ metadata.format.version = "1.1"
[versions]
# Shaded
adventure = "4.10.1"
adventurePlatform = "4.0.1"
mysqlConnector = "8.0.27"
adventure = "4.13.1"
adventurePlatform = "4.3.0"
mysqlConnector = "8.0.32"
hikariCP = "4.0.3"
bstats = "3.0.2"
# Provided
gson = "2.8.8"
guava = "29.0-jre"
snakeyaml = "1.23"
junit = "5.8.2"
jetbrainsAnnotations = "23.0.0"
jetbrainsAnnotations = "24.0.1"
protocollib = "4.7.0"
protocollib = "5.0.0-SNAPSHOT"
authlib = "1.5.25"
luckperms = "5.3"
serverlistplus = "3.4.9-SNAPSHOT"
paper = "1.16.5-R0.1-SNAPSHOT"
bungee = "1.18-R0.1-SNAPSHOT"
bungee = "1.19-R0.1-SNAPSHOT"
sponge = "8.0.0"
velocity = "3.1.0"
junitVer = "5.9.2"
[libraries]
@@ -39,20 +41,28 @@ mysqlConnector = { group = "mysql", name = "mysql-connector-java", version.ref =
jetbrainsAnnotations = { group = "org.jetbrains", name = "annotations", version.ref = "jetbrainsAnnotations" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
bstatsBukkit = { group = "org.bstats", name = "bstats-bukkit", version.ref = "bstats" }
bstatsBungee = { group = "org.bstats", name = "bstats-bungeecord", version.ref = "bstats" }
bstatsSponge = { group = "org.bstats", name = "bstats-sponge", version.ref = "bstats" }
bstatsVelocity = { group = "org.bstats", name = "bstats-velocity", version.ref = "bstats" }
authlib = { group = "com.mojang", name = "authlib", version.ref = "authlib" }
protocollib = { group = "com.comphenix.protocol", name = "ProtocolLib", version.ref = "protocollib" }
hikariCP = { group = "com.zaxxer", name = "HikariCP", version.ref = "hikariCP" }
luckperms = { group = "net.luckperms", name = "api", version.ref = "luckperms" }
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
serverlistplus = { group = "net.minecrell", name = "ServerListPlus", version.ref = "serverlistplus" }
authlib = { group = "com.mojang", name = "authlib", version.ref = "authlib" }
protocollib = { group = "com.comphenix.protocol", name = "ProtocolLib", version.ref = "protocollib" }
hikariCP = { group = "com.zaxxer", name = "HikariCP", version.ref = "hikariCP" }
luckperms = { group = "net.luckperms", name = "api", version.ref = "luckperms" }
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
serverlistplus = { group = "net.minecrell", name = "ServerListPlus", version.ref = "serverlistplus" }
paper = { group = "com.destroystokyo.paper", name = "paper-api", version.ref = "paper" }
bungee = { group = "net.md-5", name = "bungeecord-api", version.ref = "bungee" }
sponge = { group = "org.spongepowered", name = "spongeapi", version.ref = "sponge" }
velocity = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }
jupiterApi = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junitVer" }
jupiterEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junitVer" }
[bundles]
adventure = ["adventureApi", "adventureTextMinimessage", "adventureTextSerializerGson", "adventureTextSerializerLegacy"]
junit = ["jupiterApi", "jupiterEngine"]
Binary file not shown.
+2 -1
View File
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+18 -7
View File
@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,10 @@ do
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -143,12 +140,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
@@ -205,6 +210,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Vendored
+9 -6
View File
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
+2 -2
View File
@@ -2,7 +2,7 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
dependencyResolutionManagement {
repositories {
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.spongepowered.org/repository/maven-public/")
maven("https://repo.minecrell.net/snapshots")
maven("https://repo.dmulloy2.net/repository/public/")
@@ -15,7 +15,7 @@ dependencyResolutionManagement {
pluginManagement {
plugins {
id("net.kyori.blossom") version "1.2.0"
id("com.github.johnrengelman.shadow") version "7.1.1"
id("com.github.johnrengelman.shadow") version "8.1.1"
}
}
+1
View File
@@ -3,6 +3,7 @@ dependencies {
implementation(projects.adventure.adventurePlatformBukkit) {
targetConfiguration = "shadow"
}
implementation(libs.bstatsBukkit)
compileOnly(libs.paper)
compileOnly(libs.authlib)
compileOnly(libs.protocollib)
@@ -32,15 +32,24 @@ import eu.kennytv.maintenance.spigot.listener.PaperServerListPingListener;
import eu.kennytv.maintenance.spigot.listener.PlayerLoginListener;
import eu.kennytv.maintenance.spigot.listener.ServerInfoPacketListener;
import eu.kennytv.maintenance.spigot.listener.ServerListPingListener;
import eu.kennytv.maintenance.spigot.metrics.MetricsLite;
import eu.kennytv.maintenance.spigot.util.BukkitOfflinePlayerInfo;
import eu.kennytv.maintenance.spigot.util.BukkitSenderInfo;
import eu.kennytv.maintenance.spigot.util.BukkitTask;
import eu.kennytv.maintenance.spigot.util.ComponentUtil;
import java.io.File;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.function.Consumer;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import javax.imageio.ImageIO;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bstats.bukkit.Metrics;
import org.bukkit.OfflinePlayer;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -50,17 +59,8 @@ import org.bukkit.plugin.PluginManager;
import org.bukkit.util.CachedServerIcon;
import org.jetbrains.annotations.Nullable;
import javax.imageio.ImageIO;
import java.io.File;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.function.Consumer;
import java.util.logging.Logger;
import java.util.stream.Collectors;
public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
private static final boolean FOLIA = hasClass("io.papermc.paper.threadedregions.RegionizedServer");
private final MaintenanceSpigotBase plugin;
private final BukkitAudiences audiences;
private CachedServerIcon favicon;
@@ -91,7 +91,7 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
}
continueLastEndtimer();
new MetricsLite(plugin);
new Metrics(plugin, 2205);
final Plugin serverListPlus = pm.getPlugin("ServerListPlus");
if (pm.isPluginEnabled(serverListPlus)) {
@@ -108,6 +108,15 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
}
}
private static boolean hasClass(final String className) {
try {
Class.forName(className);
return true;
} catch (final ReflectiveOperationException e) {
return false;
}
}
private boolean canUsePaperListener() {
try {
Class.forName("com.destroystokyo.paper.event.server.PaperServerListPingEvent");
@@ -124,6 +133,9 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
@Override
public Task startMaintenanceRunnable(final Runnable runnable) {
if (FOLIA) {
throw new UnsupportedOperationException("Scheduling tasks is not yet supported on Folia");
}
return new BukkitTask(getServer().getScheduler().scheduleSyncRepeatingTask(plugin, runnable, 0, 20));
}
@@ -141,6 +153,11 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
@Override
public void async(final Runnable runnable) {
if (FOLIA) {
// Preliminary Folia support
runnable.run();
return;
}
getServer().getScheduler().runTaskAsynchronously(plugin, runnable);
}
@@ -157,13 +174,13 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
@Override
public void sendUpdateNotification(final SenderInfo sender) {
final TextComponent tc1 = new TextComponent(TextComponent.fromLegacyText(getPrefix()));
final TextComponent tc2 = new TextComponent(TextComponent.fromLegacyText("§cDownload it at: §6https://www.spigotmc.org/resources/maintenance.40699/"));
final TextComponent tc2 = new TextComponent(TextComponent.fromLegacyText("§cDownload it at: §6" + HANGAR_URL));
final TextComponent click = new TextComponent(TextComponent.fromLegacyText(" §7§l§o(CLICK ME)"));
click.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.spigotmc.org/resources/maintenance.40699/"));
click.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, HANGAR_URL));
click.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§aDownload the latest version").create()));
tc1.addExtra(tc2);
tc1.addExtra(click);
((BukkitSenderInfo) sender).sendMessage(tc1, getPrefix() + "§cDownload it at: §6https://www.spigotmc.org/resources/maintenance.40699/");
((BukkitSenderInfo) sender).sendMessage(tc1, getPrefix() + "§cDownload it at: §6" + HANGAR_URL);
}
@Override
@@ -24,14 +24,17 @@ import com.mojang.authlib.GameProfile;
import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.spigot.MaintenanceSpigotPlugin;
import eu.kennytv.maintenance.spigot.util.ComponentUtil;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
public final class PaperServerListPingListener implements Listener {
private final MaintenanceSpigotPlugin plugin;
private final Settings settings;
@@ -43,25 +46,29 @@ public final class PaperServerListPingListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void serverListPing(final PaperServerListPingEvent event) {
if (!settings.isMaintenance()) return;
if (!settings.isMaintenance()) {
return;
}
if (ComponentUtil.PAPER) {
event.motd(ComponentUtil.toPaperComponent(settings.getRandomPingMessage()));
} else {
event.setMotd(ComponentUtil.toLegacy(settings.getRandomPingMessage()));
if (settings.isEnablePingMessages()) {
if (ComponentUtil.PAPER) {
event.motd(ComponentUtil.toPaperComponent(settings.getRandomPingMessage()));
} else {
event.setMotd(ComponentUtil.toLegacy(settings.getRandomPingMessage()));
}
}
if (settings.hasCustomPlayerCountMessage()) {
event.setProtocolVersion(-1);
event.setVersion(settings.getPlayerCountMessage()
.replace("%ONLINE%", Integer.toString(plugin.getServer().getOnlinePlayers().size()))
.replace("%MAX%", Integer.toString(plugin.getServer().getMaxPlayers())));
event.setVersion(settings.getPlayerCountMessage());
}
final List<PlayerProfile> sample = event.getPlayerSample();
sample.clear();
for (final String string : settings.getPlayerCountHoverLines()) {
sample.add(new DummyProfile(string));
if (settings.hasCustomPlayerCountHoverMessage()) {
final List<PlayerProfile> sample = event.getPlayerSample();
sample.clear();
for (final String string : settings.getPlayerCountHoverLines()) {
sample.add(new DummyProfile(string));
}
}
if (settings.hasCustomIcon() && plugin.getFavicon() != null) {
@@ -138,12 +145,12 @@ public final class PaperServerListPingListener implements Listener {
}
@Override
public boolean completeFromCache(boolean b) {
public boolean completeFromCache(final boolean b) {
return false;
}
@Override
public boolean completeFromCache(boolean b, boolean b1) {
public boolean completeFromCache(final boolean b, final boolean b1) {
return false;
}
@@ -153,11 +160,12 @@ public final class PaperServerListPingListener implements Listener {
}
@Override
public boolean complete(boolean b, boolean b1) {
public boolean complete(final boolean b, final boolean b1) {
return false;
}
// Keep this here for backwards compatibility
@SuppressWarnings("unused")
public GameProfile getGameProfile() {
return null;
}
@@ -28,15 +28,14 @@ import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.spigot.MaintenanceSpigotBase;
import eu.kennytv.maintenance.spigot.MaintenanceSpigotPlugin;
import eu.kennytv.maintenance.spigot.util.ComponentUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.server.ServerListPingEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public final class ServerInfoPacketListener extends PacketAdapter implements Listener {
private final UUID uuid = new UUID(0, 0);
private final MaintenanceSpigotPlugin plugin;
@@ -51,23 +50,27 @@ public final class ServerInfoPacketListener extends PacketAdapter implements Lis
@Override
public void onPacketSending(final PacketEvent event) {
if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return;
if (!settings.isMaintenance()) {
return;
}
final WrappedServerPing ping = event.getPacket().getServerPings().read(0);
ping.setMotD(ComponentUtil.toLegacy(settings.getRandomPingMessage()));
if (settings.isEnablePingMessages()) {
ping.setMotD(ComponentUtil.toLegacy(settings.getRandomPingMessage()));
}
if (settings.hasCustomPlayerCountMessage()) {
ping.setVersionProtocol(1);
ping.setVersionName(settings.getPlayerCountMessage()
.replace("%ONLINE%", Integer.toString(plugin.getServer().getOnlinePlayers().size()))
.replace("%MAX%", Integer.toString(plugin.getServer().getMaxPlayers())));
ping.setVersionName(settings.getPlayerCountMessage());
}
final List<WrappedGameProfile> players = new ArrayList<>();
for (final String string : settings.getPlayerCountHoverLines()) {
players.add(new WrappedGameProfile(uuid, string));
if (settings.hasCustomPlayerCountHoverMessage()) {
final List<WrappedGameProfile> players = new ArrayList<>();
for (final String string : settings.getPlayerCountHoverLines()) {
players.add(new WrappedGameProfile(uuid, string));
}
ping.setPlayers(players);
}
ping.setPlayers(players);
}
@EventHandler(priority = EventPriority.HIGHEST)
@@ -36,16 +36,20 @@ public final class ServerListPingListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void serverListPing(final ServerListPingEvent event) {
if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return;
if (!settings.isMaintenance()) {
return;
}
if (settings.hasCustomPlayerCountMessage()) {
event.setMaxPlayers(0);
}
if (ComponentUtil.PAPER) {
event.motd(ComponentUtil.toPaperComponent(settings.getRandomPingMessage()));
} else {
event.setMotd(ComponentUtil.toLegacy(settings.getRandomPingMessage()));
if (settings.isEnablePingMessages()) {
if (ComponentUtil.PAPER) {
event.motd(ComponentUtil.toPaperComponent(settings.getRandomPingMessage()));
} else {
event.setMotd(ComponentUtil.toLegacy(settings.getRandomPingMessage()));
}
}
if (settings.hasCustomIcon() && plugin.getFavicon() != null) {
@@ -1,255 +0,0 @@
package eu.kennytv.maintenance.spigot.metrics;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.ServicePriority;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Timer;
import java.util.TimerTask;
import java.util.UUID;
import java.util.logging.Level;
import java.util.zip.GZIPOutputStream;
/**
* bStats collects some data for plugin authors.
* <p>
* Check out https://bStats.org/ to learn more about bStats!
*/
public final class MetricsLite {
public static final int B_STATS_VERSION = 1;
private static final int PLUGIN_ID = 2205;
private static final String URL = "https://bStats.org/submitData/bukkit";
private final boolean enabled;
private static boolean logFailedRequests;
private static boolean logSentData;
private static boolean logResponseStatusText;
private static String serverUUID;
private final Plugin plugin;
public MetricsLite(final Plugin plugin) {
if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null!");
}
this.plugin = plugin;
final File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
final File configFile = new File(bStatsFolder, "config.yml");
final YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
if (!config.isSet("serverUuid")) {
config.addDefault("enabled", true);
config.addDefault("serverUuid", UUID.randomUUID().toString());
config.addDefault("logFailedRequests", false);
config.addDefault("logSentData", false);
config.addDefault("logResponseStatusText", false);
config.options().header(
"bStats collects some data for plugin authors like how many servers are using their plugins.\n" +
"To honor their work, you should not disable it.\n" +
"This has nearly no effect on the server performance!\n" +
"Check out https://bStats.org/ to learn more :)"
).copyDefaults(true);
try {
config.save(configFile);
} catch (final IOException ignored) {
}
}
serverUUID = config.getString("serverUuid");
logFailedRequests = config.getBoolean("logFailedRequests", false);
enabled = config.getBoolean("enabled", true);
logSentData = config.getBoolean("logSentData", false);
logResponseStatusText = config.getBoolean("logResponseStatusText", false);
if (enabled) {
boolean found = false;
for (final Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
try {
service.getField("B_STATS_VERSION");
found = true;
break;
} catch (final NoSuchFieldException ignored) {
}
}
Bukkit.getServicesManager().register(MetricsLite.class, this, plugin, ServicePriority.Normal);
if (!found) {
startSubmitting();
}
}
}
public boolean isEnabled() {
return enabled;
}
private void startSubmitting() {
final Timer timer = new Timer(true);
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
if (!plugin.isEnabled()) { // Plugin was disabled
timer.cancel();
return;
}
Bukkit.getScheduler().runTask(plugin, () -> submitData());
}
}, 1000 * 60 * 5, 1000 * 60 * 30);
}
public JsonObject getPluginData() {
final JsonObject data = new JsonObject();
//final String pluginName = plugin.getDescription().getName();
final String pluginName = "MaintenanceSpigot"; // I cut off the suffix, not sure how bStats would like the name change
final String pluginVersion = plugin.getDescription().getVersion();
data.addProperty("pluginName", pluginName);
data.addProperty("id", PLUGIN_ID);
data.addProperty("pluginVersion", pluginVersion);
data.add("customCharts", new JsonArray());
return data;
}
private JsonObject getServerData() {
final int playerAmount = Bukkit.getOnlinePlayers().size();
final int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
final String bukkitVersion = Bukkit.getVersion();
final String bukkitName = Bukkit.getName();
final String javaVersion = System.getProperty("java.version");
final String osName = System.getProperty("os.name");
final String osArch = System.getProperty("os.arch");
final String osVersion = System.getProperty("os.version");
final int coreCount = Runtime.getRuntime().availableProcessors();
final JsonObject data = new JsonObject();
data.addProperty("serverUUID", serverUUID);
data.addProperty("playerAmount", playerAmount);
data.addProperty("onlineMode", onlineMode);
data.addProperty("bukkitVersion", bukkitVersion);
data.addProperty("bukkitName", bukkitName);
data.addProperty("javaVersion", javaVersion);
data.addProperty("osName", osName);
data.addProperty("osArch", osArch);
data.addProperty("osVersion", osVersion);
data.addProperty("coreCount", coreCount);
return data;
}
private void submitData() {
final JsonObject data = getServerData();
final JsonArray pluginData = new JsonArray();
for (final Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
try {
service.getField("B_STATS_VERSION");
for (final RegisteredServiceProvider<?> provider : Bukkit.getServicesManager().getRegistrations(service)) {
try {
final Object plugin = provider.getService().getMethod("getPluginData").invoke(provider.getProvider());
if (plugin instanceof JsonObject) {
pluginData.add((JsonObject) plugin);
} else {
try {
final Class<?> jsonObjectJsonSimple = Class.forName("org.json.simple.JSONObject");
if (plugin.getClass().isAssignableFrom(jsonObjectJsonSimple)) {
final Method jsonStringGetter = jsonObjectJsonSimple.getDeclaredMethod("toJSONString");
jsonStringGetter.setAccessible(true);
final String jsonString = (String) jsonStringGetter.invoke(plugin);
final JsonObject object = new JsonParser().parse(jsonString).getAsJsonObject();
pluginData.add(object);
}
} catch (final ClassNotFoundException e) {
if (logFailedRequests) {
this.plugin.getLogger().log(Level.SEVERE, "Encountered unexpected exception ", e);
}
}
}
} catch (final NullPointerException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
}
}
} catch (final NoSuchFieldException ignored) {
}
}
data.add("plugins", pluginData);
new Thread(() -> {
try {
sendData(plugin, data);
} catch (final Exception e) {
if (logFailedRequests) {
plugin.getLogger().log(Level.WARNING, "Could not submit plugin stats of " + plugin.getName(), e);
}
}
}).start();
}
private static void sendData(final Plugin plugin, final JsonObject data) throws Exception {
if (data == null) {
throw new IllegalArgumentException("Data cannot be null!");
}
if (Bukkit.isPrimaryThread()) {
throw new IllegalAccessException("This method must not be called from the main thread!");
}
if (logSentData) {
plugin.getLogger().info("Sending data to bStats: " + data);
}
final HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();
final byte[] compressedData = compress(data.toString());
connection.setRequestMethod("POST");
connection.addRequestProperty("Accept", "application/json");
connection.addRequestProperty("Connection", "close");
connection.addRequestProperty("Content-Encoding", "gzip");
connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("User-Agent", "MC-Server/" + B_STATS_VERSION);
connection.setDoOutput(true);
try (final DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {
outputStream.write(compressedData);
}
if (logResponseStatusText) {
final StringBuilder builder = new StringBuilder();
try (final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
String line;
while ((line = bufferedReader.readLine()) != null) {
builder.append(line);
}
}
plugin.getLogger().info("Sent data to bStats and received response: " + builder);
} else {
connection.getInputStream().close();
}
}
private static byte[] compress(final String str) throws IOException {
if (str == null) {
return null;
}
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try (final GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) {
gzip.write(str.getBytes(StandardCharsets.UTF_8));
}
return outputStream.toByteArray();
}
}
@@ -68,7 +68,7 @@ public final class BukkitSenderInfo implements SenderInfo {
public void sendMessage(final TextComponent textComponent, final String backup) {
try {
sender.spigot().sendMessage(textComponent);
} catch (final NoSuchMethodError e) {
} catch (final NoSuchMethodError ignored) {
if (backup != null) {
sender.sendMessage(backup);
}
+3 -2
View File
@@ -4,11 +4,12 @@ main: eu.kennytv.maintenance.spigot.MaintenanceSpigotBase
author: kennytv
description: ${description}
softdepend: [ProtocolLib, ServerListPlus, ProtocolSupport, LuckPerms]
website: https://www.spigotmc.org/resources/maintenance.40699/
website: https://hangar.papermc.io/kennytv/Maintenance
api-version: 1.13
folia-supported: true
commands:
maintenance:
description: Maintenance main-command
aliases: [maintenancespigot, mt]
aliases: [mt]
permission: maintenance.command
+1
View File
@@ -1,4 +1,5 @@
dependencies {
implementation(projects.maintenanceCore)
implementation(libs.bstatsSponge)
compileOnly(libs.sponge)
}
@@ -39,6 +39,7 @@ import eu.kennytv.maintenance.sponge.util.SpongeUser;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bstats.sponge.Metrics;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.api.Game;
import org.spongepowered.api.Platform;
@@ -87,11 +88,12 @@ public final class MaintenanceSpongePlugin extends MaintenancePlugin {
@SuppressWarnings("SpongeInjection")
@Inject
public MaintenanceSpongePlugin(final PluginContainer container, final Game game, final org.apache.logging.log4j.Logger logger) {
public MaintenanceSpongePlugin(final PluginContainer container, final Game game, final org.apache.logging.log4j.Logger logger, final Metrics.Factory metricsFactory) {
super(MaintenanceVersion.VERSION, ServerType.SPONGE);
this.container = container;
this.game = game;
this.logger = new LoggerWrapper(logger);
metricsFactory.make(16501);
}
@Listener
@@ -103,7 +105,7 @@ public final class MaintenanceSpongePlugin extends MaintenancePlugin {
final MaintenanceSpongeCommand command = new MaintenanceSpongeCommand(this, settings);
commandManager = command;
game.server().commandManager().registrar(Command.Raw.class).get().register(container, command, "maintenance", "maintenancesponge", "mt");
game.server().commandManager().registrar(Command.Raw.class).get().register(container, command, "maintenance", "mt");
final EventManager em = game.eventManager();
em.registerListeners(container, new ClientPingServerListener(this, settings));
em.registerListeners(container, new ClientConnectionListener(this, settings));
@@ -165,10 +167,10 @@ public final class MaintenanceSpongePlugin extends MaintenancePlugin {
@Override
public void sendUpdateNotification(final SenderInfo sender) {
try {
net.kyori.adventure.text.Component component = net.kyori.adventure.text.Component.text().append(translate(getPrefix()))
.append(translate("§cDownload it at: §6https://www.spigotmc.org/resources/maintenance.40699/ "))
.append(translate("§7§l§o(CLICK ME)"))
.clickEvent(ClickEvent.openUrl(new URL("https://www.spigotmc.org/resources/maintenance.40699/")))
final net.kyori.adventure.text.Component component = net.kyori.adventure.text.Component.text().append(translate(getPrefix()))
.append(translate("§cDownload it at: §6" + HANGAR_URL))
.append(translate(" §7§l§o(CLICK ME)"))
.clickEvent(ClickEvent.openUrl(new URL(HANGAR_URL)))
.hoverEvent(HoverEvent.showText(translate("§7§l§o(CLICK ME)"))).build();
((SpongePlayer) sender).send(component);
} catch (final MalformedURLException e) {
@@ -20,14 +20,13 @@ package eu.kennytv.maintenance.sponge.listener;
import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.sponge.MaintenanceSpongePlugin;
import eu.kennytv.maintenance.sponge.util.ComponentUtil;
import java.util.List;
import java.util.UUID;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.Order;
import org.spongepowered.api.event.server.ClientPingServerEvent;
import org.spongepowered.api.profile.GameProfile;
import java.util.List;
import java.util.UUID;
public final class ClientPingServerListener {
private final MaintenanceSpongePlugin plugin;
private final Settings settings;
@@ -39,7 +38,9 @@ public final class ClientPingServerListener {
@Listener(order = Order.LAST)
public void proxyPing(final ClientPingServerEvent event) {
if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return;
if (!settings.isMaintenance()) {
return;
}
final ClientPingServerEvent.Response response = event.response();
if (settings.hasCustomPlayerCountMessage()) {
@@ -48,14 +49,19 @@ public final class ClientPingServerListener {
response.players().ifPresent(players -> players.setMax(0));
}
response.setDescription(ComponentUtil.toSponge(settings.getRandomPingMessage()));
response.players().ifPresent(players -> {
final List<GameProfile> profiles = players.profiles();
profiles.clear();
for (final String string : settings.getPlayerCountHoverLines()) {
profiles.add(GameProfile.of(UUID.randomUUID(), string));
}
});
if (settings.isEnablePingMessages()) {
response.setDescription(ComponentUtil.toSponge(settings.getRandomPingMessage()));
}
if (settings.hasCustomPlayerCountHoverMessage()) {
response.players().ifPresent(players -> {
final List<GameProfile> profiles = players.profiles();
profiles.clear();
for (final String string : settings.getPlayerCountHoverLines()) {
profiles.add(GameProfile.of(UUID.randomUUID(), string));
}
});
}
if (settings.hasCustomIcon() && plugin.getFavicon() != null) {
response.setFavicon(plugin.getFavicon());
+1
View File
@@ -8,6 +8,7 @@ tasks {
dependencies {
implementation(projects.maintenanceCoreProxy)
implementation(libs.mysqlConnector)
implementation(libs.bstatsVelocity)
compileOnly(libs.velocity)
annotationProcessor(libs.velocity)
}
@@ -36,6 +36,7 @@ import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.util.Favicon;
import eu.kennytv.maintenance.api.proxy.Server;
import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.dump.PluginDump;
import eu.kennytv.maintenance.core.hook.ServerListPlusHook;
import eu.kennytv.maintenance.core.proxy.MaintenanceProxyPlugin;
@@ -60,6 +61,7 @@ import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bstats.velocity.Metrics;
import org.jetbrains.annotations.Nullable;
import javax.imageio.ImageIO;
@@ -76,20 +78,22 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
@Plugin(id = "maintenance", name = "Maintenance", version = MaintenanceVersion.VERSION, authors = "kennytv",
description = "Enable maintenance mode with a custom maintenance motd and icon.", url = "https://forums.velocitypowered.com/t/maintenance/129",
description = "Enable maintenance mode with a custom maintenance motd and icon.", url = MaintenancePlugin.HANGAR_URL,
dependencies = {@Dependency(id = "serverlistplus", optional = true), @Dependency(id = "luckperms", optional = true)})
public final class MaintenanceVelocityPlugin extends MaintenanceProxyPlugin {
private final ProxyServer server;
private final Logger logger;
private final File dataFolder;
private final Metrics.Factory metricsFactory;
private Favicon favicon;
@Inject
public MaintenanceVelocityPlugin(final ProxyServer server, final org.slf4j.Logger logger, @DataDirectory final Path folder) {
public MaintenanceVelocityPlugin(final ProxyServer server, final org.slf4j.Logger logger, @DataDirectory final Path folder, final Metrics.Factory metricsFactory) {
super(MaintenanceVersion.VERSION, ServerType.VELOCITY);
this.server = server;
this.logger = new LoggerWrapper(logger);
this.dataFolder = folder.toFile();
this.metricsFactory = metricsFactory;
}
@Subscribe
@@ -97,11 +101,13 @@ public final class MaintenanceVelocityPlugin extends MaintenanceProxyPlugin {
settingsProxy = new SettingsProxy(this);
settings = settingsProxy;
metricsFactory.make(this, 16502);
sendEnableMessage();
final MaintenanceVelocityCommand command = new MaintenanceVelocityCommand(this, settingsProxy);
commandManager = command;
server.getCommandManager().register(server.getCommandManager().metaBuilder("maintenance").aliases("maintenancevelocity", "mt").build(), command);
server.getCommandManager().register(server.getCommandManager().metaBuilder("maintenance").aliases("mt").build(), command);
final EventManager em = server.getEventManager();
em.register(this, ProxyPingEvent.class, PostOrder.LAST, new ProxyPingListener(this, settingsProxy));
@@ -137,9 +143,9 @@ public final class MaintenanceVelocityPlugin extends MaintenanceProxyPlugin {
@Override
public void sendUpdateNotification(final SenderInfo sender) {
final TextComponent component = translate(getPrefix()).append(translate("§cDownload it at: §6https://www.spigotmc.org/resources/maintenance.40699/"));
final TextComponent component = translate(getPrefix()).append(translate("§cDownload it at: §6" + HANGAR_URL));
final TextComponent clickText = translate(" §7§l§o(CLICK ME)")
.clickEvent(ClickEvent.openUrl("https://www.spigotmc.org/resources/maintenance.40699/"))
.clickEvent(ClickEvent.openUrl(HANGAR_URL))
.hoverEvent(HoverEvent.showText(translate("§aDownload the latest version")));
((VelocitySenderInfo) sender).sendMessage(component.append(clickText));
}
@@ -23,7 +23,6 @@ import com.velocitypowered.api.proxy.server.ServerPing;
import eu.kennytv.maintenance.core.proxy.SettingsProxy;
import eu.kennytv.maintenance.velocity.MaintenanceVelocityPlugin;
import eu.kennytv.maintenance.velocity.util.ComponentUtil;
import java.util.UUID;
public final class ProxyPingListener implements EventHandler<ProxyPingEvent> {
@@ -38,24 +37,28 @@ public final class ProxyPingListener implements EventHandler<ProxyPingEvent> {
@Override
public void execute(final ProxyPingEvent event) {
if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return;
if (!settings.isMaintenance()) {
return;
}
final ServerPing ping = event.getPing();
final ServerPing.Builder builder = ping.asBuilder();
if (settings.hasCustomPlayerCountMessage()) {
builder.version(new ServerPing.Version(1, settings.getPlayerCountMessage()
.replace("%ONLINE%", Integer.toString(builder.getMaximumPlayers()))
.replace("%MAX%", Integer.toString(builder.getOnlinePlayers()))));
builder.version(new ServerPing.Version(1, settings.getPlayerCountMessage()));
}
final String[] lines = settings.getPlayerCountHoverLines();
final ServerPing.SamplePlayer[] samplePlayers = new ServerPing.SamplePlayer[lines.length];
for (int i = 0; i < lines.length; i++) {
samplePlayers[i] = new ServerPing.SamplePlayer(lines[i], uuid);
if (settings.hasCustomPlayerCountHoverMessage()) {
final String[] lines = settings.getPlayerCountHoverLines();
final ServerPing.SamplePlayer[] samplePlayers = new ServerPing.SamplePlayer[lines.length];
for (int i = 0; i < lines.length; i++) {
samplePlayers[i] = new ServerPing.SamplePlayer(lines[i], uuid);
}
builder.samplePlayers(samplePlayers);
}
builder.description(ComponentUtil.toVelocity(settings.getRandomPingMessage()))
.samplePlayers(samplePlayers);
if (settings.isEnablePingMessages()) {
builder.description(ComponentUtil.toVelocity(settings.getRandomPingMessage()));
}
if (settings.hasCustomIcon() && plugin.getFavicon() != null) {
builder.favicon(plugin.getFavicon());