Compare commits

...
58 Commits
Author SHA1 Message Date
Nassim Jahnke ced1651c05 Update changelog title 2023-09-17 19:43:53 +10:00
Nassim Jahnke 6be27d05bb 4.2.0 Release 2023-09-17 18:31:33 +10:00
Maintenancer c39bb44e42 New Crowdin updates (#109) 2023-09-17 18:19:30 +10:00
Nassim Jahnke b71e1ce25d Add server specific timer command messages 2023-09-17 13:25:38 +10:00
Nassim Jahnke b5cfc47524 Update Blossom 2023-09-17 12:50:37 +10:00
Nassim Jahnke c32698fc76 Update maven repo for SLP and readd hook 2023-09-11 13:35:19 +10:00
Nassim Jahnke b177c5e2f8 Don't publish adventure modules 2023-09-10 15:14:57 +10:00
Nassim Jahnke d0e0aff78e Configure (manual) publishing 2023-09-10 14:47:48 +10:00
Nassim Jahnke 9f5ecd590e Remove SLP dependency for now
The repository is not available and thus breaks building...
2023-09-10 14:11:41 +10:00
Nassim Jahnke bc93f1f36d Update Gradle wrapper 2023-09-10 13:44:08 +10:00
Maintenancer 3c1c1e48fb New translations language-en.yml (Japanese) (#108) 2023-09-08 11:05:24 +10:00
c8e14e1d74 New Crowdin updates (#105)
* New translations language-en.yml (Portuguese)

* New translations language-en.yml (Danish)

* New translations language-en.yml (Korean)

Co-authored-by: JaeWoong Suh <90325840+SuhJae@users.noreply.github.com>
Co-authored-by: Jan CHristensen <skrivtiljan@gmail.com>
2023-08-08 17:04:49 +10:00
Maintenancer 29300d5fe2 Hungarian translation file (thanks to Kende) 2023-06-26 11:46:40 +02:00
Nassim Jahnke 7da9365e23 Add config options for commands on single server maintenance enable/disable 2023-06-15 13:08:28 +02:00
Nassim Jahnke ded84cd1c9 Update gradle wrapper 2023-06-15 12:30:01 +02:00
Maintenancer 62cc71675b New Crowdin updates (#99) 2023-06-15 11:41:00 +02:00
Nassim Jahnke 0752d3dc93 Update dependencies 2023-06-15 11:39:38 +02:00
Nassim Jahnke d352e44e50 Send user-agent to Hangar API 2023-06-15 11:36:28 +02:00
Nassim Jahnke 83877a6c3a Bump version to 4.2.0-SNAPSHOT 2023-06-15 11:34:24 +02:00
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
83 changed files with 1733 additions and 1227 deletions

No files matched your search

+30
View File
@@ -1,6 +1,36 @@
# 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.2.0 - September 17th 2023
### Changed
* Velocity/Bungee: Added `commands-on-single-maintenance-enable` and `commands-on-single-maintenance-disable` config options to define commands to be executed after maintenance has been toggled on a proxied server
* Commands inside the `all` list will be executed for any proxied server, but you can also define commands for specific servers by adding arrays with the server names as keys
* You can use the placeholder `%SERVER%` in commands to be replaced with the server name
* Start-, end-, and schedule timers for proxied servers now also include the server in the feedback message
* Updated language files from [Crowdin](https://crowdin.com/translate/maintenance) (including new language files for Danish, Japanese, Korean, and Hungarian)
---
## 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")
}
@@ -1,12 +1,13 @@
plugins {
`java-library`
`maven-publish`
signing
}
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 +19,9 @@ tasks {
options.encoding = Charsets.UTF_8.name()
options.compilerArgs.addAll(listOf("-nowarn", "-Xlint:-unchecked", "-Xlint:-deprecation"))
}
test {
useJUnitPlatform()
}
}
java {
@@ -25,10 +29,43 @@ java {
withSourcesJar()
}
signing {
useGpgCmd()
sign(publishing.publications)
}
publishing {
publications.create<MavenPublication>("mavenJava") {
groupId = rootProject.group as String
artifactId = project.name
version = rootProject.version as String
pom {
name.set("Maintenance")
description.set("Paper plugin to enable maintenance mode on your Minecraft server.")
url.set("https://github.com/kennytv/Maintenance")
licenses {
license {
name.set("GNU GPLv3")
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
}
}
developers {
developer {
id.set("kennytv")
name.set("Nassim Jahnke")
}
}
}
}
}
if (!name.startsWith("adventure")) {
repositories.maven {
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
}
@@ -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
@@ -36,8 +36,8 @@ import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -83,11 +83,23 @@ public abstract class MaintenanceProxyPlugin extends MaintenancePlugin implement
@Override
public boolean setMaintenanceToServer(final Server server, final boolean maintenance) {
if (maintenance) {
if (!settingsProxy.addMaintenanceServer(server.getName())) return false;
} else {
if (!settingsProxy.removeMaintenanceServer(server.getName())) return false;
if (!settingsProxy.addMaintenanceServer(server.getName())) {
return false;
}
} else if (!settingsProxy.removeMaintenanceServer(server.getName())) {
return false;
}
serverActions(server, maintenance);
for (final String command : (maintenance ? settingsProxy.getCommandsOnMaintenanceEnable(server) : settingsProxy.getCommandsOnMaintenanceDisable(server))) {
try {
executeConsoleCommand(command.replace("%SERVER%", server.getName()));
} catch (final Exception e) {
getLogger().severe("Error while executing extra maintenance " + (maintenance ? "enable" : "disable") + " command: " + command);
e.printStackTrace();
}
}
return true;
}
@@ -177,7 +189,7 @@ public abstract class MaintenanceProxyPlugin extends MaintenancePlugin implement
protected ProfileLookup doUUIDLookup(final String name) throws IOException {
final URL url = new URL("https://api.ashcon.app/mojang/v2/user/" + name);
final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
final URLConnection connection = url.openConnection();
try (final InputStream in = connection.getInputStream()) {
final String output = CharStreams.toString(new InputStreamReader(in));
final JsonObject json = GSON.fromJson(output, JsonObject.class);
@@ -27,8 +27,11 @@ import org.jetbrains.annotations.Nullable;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
public final class SettingsProxy extends Settings {
@@ -37,6 +40,8 @@ public final class SettingsProxy extends Settings {
private List<String> fallbackServers;
private String waitingServer;
private Map<String, List<String>> commandsOnMaintenanceEnable;
private Map<String, List<String>> commandsOnMaintenanceDisable;
private String mySQLTable;
private String serverTable;
private String maintenanceQuery;
@@ -99,6 +104,18 @@ public final class SettingsProxy extends Settings {
waitingServer = null;
}
commandsOnMaintenanceEnable = new HashMap<>();
final ConfigSection enableCommandsSection = config.getSection("commands-on-single-maintenance-enable");
for (final String key : enableCommandsSection.getKeys()) {
commandsOnMaintenanceEnable.put(key.toLowerCase(Locale.ROOT), enableCommandsSection.getStringList(key));
}
commandsOnMaintenanceDisable = new HashMap<>();
final ConfigSection disableCommandsSection = config.getSection("commands-on-single-maintenance-disable");
for (final String key : disableCommandsSection.getKeys()) {
commandsOnMaintenanceDisable.put(key.toLowerCase(Locale.ROOT), disableCommandsSection.getStringList(key));
}
if (hasMySQL()) {
maintenance = loadMaintenance();
maintenanceServers = loadMaintenanceServersFromSQL();
@@ -151,20 +168,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() {
@@ -262,6 +279,24 @@ public final class SettingsProxy extends Settings {
return waitingServer;
}
public List<String> getCommandsOnMaintenanceEnable(final Server server) {
final List<String> enableCommands = commandsOnMaintenanceEnable.getOrDefault("all", new ArrayList<>());
final List<String> serverEnableCommands = commandsOnMaintenanceEnable.get(server.getName().toLowerCase(Locale.ROOT));
if (serverEnableCommands != null) {
enableCommands.addAll(serverEnableCommands);
}
return enableCommands;
}
public List<String> getCommandsOnMaintenanceDisable(final Server server) {
final List<String> disableCommands = commandsOnMaintenanceDisable.getOrDefault("all", new ArrayList<>());
final List<String> serverDisableCommands = commandsOnMaintenanceDisable.get(server.getName().toLowerCase(Locale.ROOT));
if (serverDisableCommands != null) {
disableCommands.addAll(serverDisableCommands);
}
return disableCommands;
}
@Nullable
MySQL getMySQL() {
return mySQL;
@@ -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());
}
@@ -22,7 +22,6 @@ import eu.kennytv.maintenance.core.proxy.MaintenanceProxyPlugin;
import eu.kennytv.maintenance.core.proxy.command.ProxyCommandInfo;
import eu.kennytv.maintenance.core.runnable.MaintenanceRunnableBase;
import eu.kennytv.maintenance.core.util.SenderInfo;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -68,7 +67,11 @@ public final class SingleEndtimerCommand extends ProxyCommandInfo {
}
final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), TimeUnit.MINUTES, false);
sender.send(getMessage("endtimerStarted", "%TIME%", runnable.getTime()));
sender.send(getMessage(
"singleEndtimerStarted",
"%TIME%", runnable.getTime(),
"%SERVER%", server.getName()
));
} else {
sender.send(getHelpMessage());
}
@@ -22,7 +22,6 @@ import eu.kennytv.maintenance.core.proxy.MaintenanceProxyPlugin;
import eu.kennytv.maintenance.core.proxy.command.ProxyCommandInfo;
import eu.kennytv.maintenance.core.runnable.MaintenanceRunnableBase;
import eu.kennytv.maintenance.core.util.SenderInfo;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -52,8 +51,13 @@ public final class SingleScheduleTimerCommand extends ProxyCommandInfo {
return;
}
plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), Integer.parseInt(args[2]), TimeUnit.MINUTES);
sender.send(getMessage("starttimerStarted", "%TIME%", plugin.getRunnable().getTime()));
final int duration = Integer.parseInt(args[2]);
plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), duration, TimeUnit.MINUTES);
sender.send(getMessage(
"scheduletimerStarted",
"%TIME%", plugin.getRunnable().getTime(),
"%DURATION%", plugin.getFormattedTime(duration * 60)
));
} else if (args.length == 4) {
if (checkPermission(sender, "singleserver.timer")) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false)
@@ -69,8 +73,14 @@ public final class SingleScheduleTimerCommand extends ProxyCommandInfo {
return;
}
final MaintenanceRunnableBase runnable = plugin.scheduleSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), Integer.parseInt(args[3]), TimeUnit.MINUTES);
sender.send(getMessage("starttimerStarted", "%TIME%", runnable.getTime()));
final int duration = Integer.parseInt(args[3]);
final MaintenanceRunnableBase runnable = plugin.scheduleSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), duration, TimeUnit.MINUTES);
sender.send(getMessage(
"singleScheduletimerStarted",
"%TIME%", runnable.getTime(),
"%DURATION%", plugin.getFormattedTime(duration * 60),
"%SERVER%", server.getName()
));
} else {
sender.send(getHelpMessage());
}
@@ -22,7 +22,6 @@ import eu.kennytv.maintenance.core.proxy.MaintenanceProxyPlugin;
import eu.kennytv.maintenance.core.proxy.command.ProxyCommandInfo;
import eu.kennytv.maintenance.core.runnable.MaintenanceRunnableBase;
import eu.kennytv.maintenance.core.util.SenderInfo;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -68,7 +67,11 @@ public final class SingleStarttimerCommand extends ProxyCommandInfo {
}
final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), TimeUnit.MINUTES, true);
sender.send(getMessage("starttimerStarted", "%TIME%", runnable.getTime()));
sender.send(getMessage(
"singleStarttimerStarted",
"%TIME%", runnable.getTime(),
"%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> {
+10 -3
View File
@@ -1,10 +1,17 @@
plugins {
id("net.kyori.blossom")
id("org.jetbrains.gradle.plugin.idea-ext")
}
blossom {
replaceToken("\$VERSION", project.version)
replaceToken("\$IMPL_VERSION", "git-Maintenance-${project.version}:${rootProject.latestCommitHash()}")
sourceSets {
main {
blossom {
javaSources {
property("version", project.version.toString())
property("impl_version", "git-Maintenance-${project.version}:${rootProject.latestCommitHash()}")
}
}
}
}
dependencies {
@@ -0,0 +1,37 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package eu.kennytv.maintenance.core.util;
public final class MaintenanceVersion {
public static final String VERSION = "{{ version }}";
private static final String IMPLEMENTATION_VERSION = "{{ impl_version }}";
public static String getVersion() {
return VERSION;
}
public static String getImplementationVersion() {
return IMPLEMENTATION_VERSION;
}
}
@@ -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;
@@ -44,8 +43,6 @@ 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 +51,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;
@@ -64,6 +64,7 @@ import java.util.logging.Logger;
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 +124,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 +182,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 +213,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 +230,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 +264,12 @@ 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 URLConnection connection = new URL("https://hangar.papermc.io/api/v1/projects/kennytv/Maintenance/latestrelease").openConnection();
connection.setRequestProperty("User-Agent", "Maintenance/" + getVersion());
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 +454,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,7 +23,6 @@ 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;
@@ -32,18 +31,11 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import java.util.*;
public class Settings implements eu.kennytv.maintenance.api.Settings {
public static final String NEW_LINE_REPLACEMENT = "<br>";
private static final int CONFIG_VERSION = 6;
private static final int CONFIG_VERSION = 7;
private static final int LANGUAGE_VERSION = 1;
private static final Random RANDOM = new Random();
protected final MaintenancePlugin plugin;
@@ -51,16 +43,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 +109,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 +176,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 +186,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);
@@ -248,8 +240,8 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
plugin.getLogger().info("Updating config to the latest version...");
if (version < 6) {
// Legacy text to MiniMessage
legacyToMinimessage(config.getStringList("pingmessages"));
legacyToMinimessage(config.getStringList("timerspecific-pingmessages"));
config.getStringList("pingmessages").replaceAll(this::legacyToMinimessage);
config.getStringList("timerspecific-pingmessages").replaceAll(this::legacyToMinimessage);
config.set("playercounthovermessage", legacyToMinimessage(config.getString("playercounthovermessage")));
config.set("playercountmessage", legacyToMinimessage(config.getString("playercountmessage")));
}
@@ -322,26 +314,20 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return serialized.replaceAll("</[a-z_]+>", "");
}
private void legacyToMinimessage(final List<String> list) {
for (int i = 0; i < list.size(); i++) {
list.set(i, legacyToMinimessage(list.get(i)));
}
}
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 +339,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 +358,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 +383,6 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return true;
}
@Deprecated
@Override
public boolean removeWhitelistedPlayer(final String name) {
UUID uuid = null;
@@ -484,7 +471,10 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
}
public void setSavedEndtimer(final long millis) {
if (savedEndtimer == millis) return;
if (savedEndtimer == millis) {
return;
}
this.savedEndtimer = millis;
config.getSection("continue-endtimer-after-restart").set("end", millis);
saveConfig();
@@ -494,7 +484,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return config;
}
public List<Component> getPingMessages() {
public List<String> getPingMessages() {
return pingMessages;
}
@@ -507,7 +497,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
}
@Nullable
public List<Component> getTimerSpecificPingMessages() {
public List<String> getTimerSpecificPingMessages() {
return timerSpecificPingMessages;
}
@@ -517,20 +507,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 +532,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);
@@ -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 java.util.concurrent.TimeUnit;
public final class ScheduleTimerCommand extends CommandInfo {
@@ -42,7 +41,12 @@ public final class ScheduleTimerCommand extends CommandInfo {
return;
}
plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), Integer.parseInt(args[2]), TimeUnit.MINUTES);
sender.send(getMessage("starttimerStarted", "%TIME%", plugin.getRunnable().getTime()));
final int duration = Integer.parseInt(args[2]);
plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), duration, TimeUnit.MINUTES);
sender.send(getMessage(
"scheduletimerStarted",
"%TIME%", plugin.getRunnable().getTime(),
"%DURATION%", plugin.getFormattedTime(duration * 60)
));
}
}
@@ -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) {
@@ -1,23 +0,0 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package eu.kennytv.maintenance.core.util;
public final class MaintenanceVersion {
public static final String VERSION = "$VERSION";
}
@@ -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();
}
+13 -2
View File
@@ -41,6 +41,15 @@ enable-pingmessages: true
commands-on-maintenance-enable: []
commands-on-maintenance-disable: []
# Any extra commands inside the "all" array will be executed when maintenance is enabled/disabled on a proxied server.
# You can also add commands for specific servers by adding a new array with the server name as key.
# In the commands, you can use the %SERVER% placeholder to get the server name.
# Example: coolserver: ["say hello", "othercommand %SERVER%"]
commands-on-single-maintenance-enable:
all: []
commands-on-single-maintenance-disable:
all: []
# If set to true and an endtimer is currently running, a pingmessage from this pool will be chosen
# instead of the ones above, so you can have different messages for when an endtimer is running/not running.
enable-timerspecific-messages: true
@@ -59,6 +68,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 +84,8 @@ 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), da (Danish), ko (Korean), hu (Hungarian)
language: en
# If you have 2 or more proxy instances, the database connection will make sure all proxies
@@ -112,4 +123,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
+103
View File
@@ -0,0 +1,103 @@
#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 har ikke tilladelse til at udføre denne kommando."
kickmessage: "<red>Serveren er i øjeblikket under vedligeholdelse!<br>Prøv igen senere!"
maintenanceActivated: "<prefix><gold>Vedligeholdelsestilstand er nu aktiveret."
maintenanceDeactivated: "<prefix><gold>Vedligeholdelsestilstand er nu deaktiveret."
alreadyEnabled: "<prefix><red>Vedligeholdelsestilstand er allerede aktiveret!"
alreadyDisabled: "<prefix><red>Vedligeholdelsestilstand er allerede deaktiveret!"
endtimerBroadcast: "<prefix><gray>Vedligeholdelsestilstand vil blive deaktiveret om <gold>%TIME%<gray>."
endtimerStarted: "<prefix><green>Startet timer: <gray>Vedligeholdelsestilstand vil blive deaktiveret om <gold>%TIME%<gray>."
starttimerBroadcast: "<prefix><gray>Vedligeholdelsestilstand vil blive aktiveret om <gold>%TIME%<gray>."
starttimerStarted: "<prefix><green>Startet timer: <gray>Vedligeholdelsestilstand vil blive aktiveret om <gold>%TIME%<gray>."
scheduletimerBroadcast: "<prefix><gray>Vedligeholdelsestilstand vil blive aktiveret om <gold>%TIME% <gray>og vil vare i <gold>%DURATION%<gray>."
scheduletimerStarted: "<prefix><green>Startet timer: <gray>Vedligeholdelsestilstand vil blive aktiveret om <gold>%TIME% <gray>og vil vare i <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>Der er allerede planlagt en timer!"
timerNotRunning: "<prefix><red>Der er i øjeblikket ingen timer."
timerCancelled: "<prefix><red>Den aktuelle timer er blevet deaktiveret."
timerTooLong: "<prefix><red>Tallet skal være mindre end 40320 (28 days)!"
timerMotdDisabled: "<prefix><red>Du skal angive 'enable-timerspecific-messages' i konfigurationsfilen til 'true', hvis du vil bruge/redigere tidsbestemte motds."
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
joinNotification: "<prefix><yellow>%PLAYER% <red>prøvede at forbinde til serveren."
motdList: "<prefix><gray>Liste over dine vedligeholdelses motds:"
motdListEmpty: "<prefix><red>Du har ikke oprettet nogen vedligeholdelses motds!"
reload: "<prefix><green>Genindlæs konfigurationsfilen, hvidlistede spillere, sprogfilen og vedligeholdelsesikonet."
removedMotd: "<prefix><green>Slet motd nummer %INDEX%."
removeMotdError: "<prefix><red>Du har kun én motd, så du kan ikke slette nogen!"
setMotd: "<prefix><green>Angiv linje %LINE% af %INDEX%. vedligeholdelses motd til %MOTD%"
setMotdIndexError: "<prefix><red>Du har %MOTDS% motds, så du skal angive et nummer mellem 1 og %NEWAMOUNT%."
setMotdLineError: "<prefix><red>Det andet argument skal være linjenummer (1 or 2)!"
updateDownloading: "<prefix><red><bold>Downloader opdatering..."
updateFailed: "<prefix><dark_red><bold>Opdatering fejlede!"
updateFinished: "<prefix><green><bold>Opdateringen lykkedes! For at forhindre problemer og for at fuldføre opdateringen skal du genstarte serveren!"
whitelistedPlayers: "<prefix><gold>Hvidlistede spillere til vedligeholdelse:"
whitelistedPlayersFormat: "<dark_gray>- <yellow>%NAME% <dark_gray>(<gray>%UUID%<dark_gray>)"
whitelistAdded: "<prefix><green>Tilføj <aqua>%PLAYER% <green>til vedligeholdelseshvidlisten!"
whitelistAlreadyAdded: "<prefix><aqua>%PLAYER% <red>findes allerede i vedligeholdelseshvidlisten!"
whitelistRemoved: "<prefix><green>Fjern <aqua>%PLAYER% <green>fra vedligeholdelseshvidlisten!"
whitelistNotFound: "<prefix><red>Denne spiller er ikke på vedligeholdelseshvidlisten!"
whitelistEmpty: "<prefix><red>Vedligeholdelseshvidlisten er tom! Brug <yellow>/maintenance add <player/uuid> <red>til at tilføje spillere!"
playerNotFound: "<prefix><red>Ingen spillere med dette navn har spillet på denne server før."
playerNotFoundUuid: "<prefix><red>Ingen spiller med den uuid kunne findes."
playerNotOnline: "<prefix><red>Der er ingen spiller online med det navn."
invalidUuid: "<prefix><red>Ugyldigt uuid-format!"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>Du er blevet sendt til en venteserver!"
forceWaitingServer: "<prefix><red>Du kan ikke forlade venteserveren, mens vedligeholdelsetilstand er aktiveret!"
serverNotFound: "<prefix><red>Ingen server med dette navn er registreret på proxyen!"
singleTimerAlreadyRunning: "<prefix><red>Der er allerede planlagt en timer for den server!"
singleTimerCancelled: "<prefix><red>Den aktuelle timer for serveren <yellow>%SERVER% <red>er deaktiveret."
singleTimerNotRunning: "<prefix><red>Der er i øjeblikket ingen kørende timer for den server."
singleEndtimerBroadcast: "<prefix><gray>Vedligeholdelsestilstand på server %SERVER% vil blive deaktiveret om <gold>%TIME%<gray>."
singleEndtimerStarted: "<prefix><green>Startet timer: <gray>Vedligeholdelsestilstand på server %SERVER% vil blive deaktiveret om <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>Vedligeholdelsestilstand på server %SERVER% vil blive aktiveret om <gold>%TIME%<gray>."
singleStarttimerStarted: "<prefix><green>Startet timer: <gray>Vedligeholdelsestilstand på server %SERVER% vil blive aktiveret om <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>Vedligeholdelsestilstand på server %SERVER% vil blive aktiveret om <gold>%TIME% <gray>og vil vare i <gold>%DURATION%<gray>."
singleScheduletimerStarted: "<prefix><green>Startet timer: <gray>Vedligeholdelsestilstand på server %SERVER% vil blive aktiveret om <gold>%TIME% <gray>og vil vare i <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>Serveren %SERVER% er i øjeblikket under vedligeholdelse! Prøv igen senere!"
singleMaintenanceKickComplete: "<red>Serveren %SERVER% er under vedligeholdelse!<br>Du kan prøve at forbinde igen for at gå ind på en anden server!"
singleMaintenanceActivated: "<prefix><gold>Vedligeholdelsestilstand er nu aktiveret på serveren <yellow>%SERVER%<gold>."
singleMaintenanceDeactivated: "<prefix><gold>Vedligeholdelsestilstand er nu deaktiveret på serveren <yellow>%SERVER%<gold>."
singleServerAlreadyEnabled: "<prefix><red>Vedligeholdelsestilstand er allerede aktiveret på serveren <yellow>%SERVER%<red>!"
singleServerAlreadyDisabled: "<prefix><red>Vedligeholdelsestilstand er allerede deaktiveret på serveren <yellow>%SERVER%<red>!"
singleServerMaintenanceList: "<prefix><gray>Proxyservere, der har Vedligeholdelsestilstand aktiveret:"
singleServerMaintenanceListEmpty: "<prefix><gray>Der er ingen proxy-servere, der er under vedligeholdelse."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "sekund"
seconds: "sekunder"
minute: "minut"
minutes: "minutter"
hour: "time"
hours: "timer"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>Der er ingen side med det nummer!"
helpNextPage: "<gray>Brug <aqua>/maintenance help %PAGE% <gray>for at komme til næste hjælpevindue."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(Hvis timeren kører, vil den blive afbrudt)"
helpEndtimer: "<gold>/maintenance endtimer <minutes> <gray>(Efter den givne tid i minutter deaktiveres vedligeholdelsestilstanden)"
helpStarttimer: "<gold>/maintenance starttimer <minutes> <gray>(Efter den givne tid i minutter, vil vedligeholdelsestilstand være aktiveret)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <timer minutes> <maintenance duration> <gray>(Efter den givne tid i minutter vil vedligeholdelsestilstand være aktiveret for den givne varighed i minutter)"
helpDebug: "<gold>/maintenance debug <gray>(Aktiverer noget fejlretningslogning)"
helpDump: "<gold>/maintenance dump <gray>(Dumper nogle serveroplysninger, brugt til fejlrapporter)"
helpHelp: "<gold>/maintenance help [page] <gray>(Viser dette smukke hjælpevindue)"
helpMotd: "<gold>/maintenance motd [timer] <gray>(Viser den aktuelle vedligeholdelses motds. Hvis 'timer' er angivet, bliver dennes motds vist)"
helpRemoveMotd: "<gold>/maintenance removemotd [timer] <index> <gray>(Sletter en vedligeholdelses motd. Hvis 'timer' er angivet, vil en tidsspecifik pingbesked blive slettet)"
helpSetMotd: "<gold>/maintenance setmotd [timer] <index> <1/2> <message> <gray>(Angiver en motd for vedligeholdelsestilstand. Hvis 'timer' er angivet, vil en tidsspecifik pingbesked blive angivet)"
helpReload: "<gold>/maintenance reload <gray>(Genindlæser konfigurationsfilen, hvidlisten og serverikonet)"
helpToggle: "<gold>/maintenance <on/off> <gray>(Aktiverer/deaktiverer vedligeholdelsestilstand)"
helpUpdate: "<gold>/maintenance update <gray>(Downloader den nyeste version af plugin'et på din server)"
helpWhitelist: "<gold>/maintenance whitelist <gray>(Viser alle hvidlistede spillere for vedligeholdelsestilstand)"
helpWhitelistAdd: "<gold>/maintenance add <name/uuid> <gray>(Tilføjer spilleren til vedligeholdelseshvidlisten, så de kan forbinde til serveren, selvom vedligeholdelsestilstand er aktiveret)"
helpWhitelistRemove: "<gold>/maintenance remove <name/uuid> <gray>(Sletter spilleren fra vedligeholdelseshvidlisten)"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [server] <gray>(Hvis timeren kører, vil den blive afbrudt)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minutes> <gray>(Efter den givne tid i minutter deaktiveres vedligeholdelsestilstanden)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minutes> <gray>(Efter den givne tid i minutter, vil vedligeholdelsestilstand blive aktiveret)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(Efter den givne tid i minutter vil vedligeholdelsestilstand være aktiveret for den givne varighed i minutter)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(Aktiverer/deaktiverer vedligeholdelsestilstand)"
helpStatus: "<gold>/maintenance status <gray>(Viser alle proxyservere, der har Vedligeholdelsestilstand aktiveret)"
#Used for autoupdating the language file, do not change this value.
language-version: 1
+33 -36
View File
@@ -1,62 +1,63 @@
# 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!"
maintenanceActivated: "<prefix><gold>Der Wartungsmodus ist nun aktiviert."
noPermission: "<red>Du hast nicht die erforderliche Berechtigung, um diesen Befehl auszuführen."
kickmessage: "<red>Der Server befindet sich momentan im Wartungsmodus!<br>Bitte versuche es später nochmal!"
maintenanceActivated: "<prefix><gold>Der Wartungsmodus ist jetzt aktiviert."
maintenanceDeactivated: "<prefix><gold>Der Wartungsmodus ist nun deaktiviert."
alreadyEnabled: "<prefix><red>Der Wartungsmodus ist bereits aktiviert!"
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."
scheduletimerStarted: "<prefix><green>Gestarteter Timer: <gray>Der Wartungsmodus ist in <gold>%TIME% <gray>aktiv und wird <gold>%DURATION% <gray>dauern."
timerAlreadyRunning: "<prefix><red>Momentan läuft bereits ein Timer!"
timerNotRunning: "<prefix><red>Momentan läuft kein Timer."
timerCancelled: "<prefix><red>Der laufende Timer wurde beendet."
timerTooLong: "<prefix><red>Die angegebene Nummer muss kleiner als 40320 sein (= 28 Tage)!"
timerMotdDisabled: "<prefix><red>Du musst 'enable-timerspecific-messages' in der Config auf 'true' stellen, wenn du timerspezifische Motds benutzen/editieren möchtest."
timerTooLong: "<prefix><red>Die angegebene Zahl muss kleiner als 40320 sein, also 28 Tage!"
timerMotdDisabled: "<prefix><red>Du musst den Wert 'enable-timerspecific-messages' in der Config auf 'true' stellen, wenn du timerspezifische Motds benutzen/bearbeiten möchtest."
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
joinNotification: "<prefix><yellow>%PLAYER% <red>hat versucht den Server beizutreten."
motdList: "<prefix><gray>Liste der Maintenance MOTDs:"
joinNotification: "<prefix><yellow>%PLAYER% <red>hat versucht dem Server beizutreten."
motdList: "<prefix><gray>Liste deiner Motds, die während Maintenance angezeigt werden:"
motdListEmpty: "<prefix><red>Du hast keine Maintenance MOTDs gesetzt!"
reload: "<prefix><green>Config, WhitelistedPlayers, Language Datei und Maintenance Icon wurden neugeladen."
reload: "<prefix><green>Die Config, die Liste der Spieler die während Maintenance beitreten können, die Sprachdateien und das Icon, das während der Maintenance angezeigt wird, wurden reloaded."
removedMotd: "<prefix><green>Die %INDEX%. Maintenance MOTD wurde entfernt."
removeMotdError: "<prefix><red>Du hast nur eine Maintenance MOTD, daher kannst du auch keine entfernen!"
removeMotdError: "<prefix><red>Du hast nur eine Maintenance MOTD eingestellt, daher kannst du auch keine entfernen!"
setMotd: "<prefix><green>Die %LINE%. Zeile der %INDEX%. Maintenance MOTD wurde geändert zu: %MOTD%"
setMotdIndexError: "<prefix><red>Momentan gibt es %MOTDS% MOTDs, du musst also eine Zahl zwischen 1 and %NEWAMOUNT% wählen."
setMotdLineError: "<prefix><red>Das zweite Argument muss die Zeilennummer sein (1 oder 2)!"
updateDownloading: "<prefix><red><bold>Update wird heruntergeladen..."
updateFailed: "<prefix><dark_red><bold>Update fehlgeschlagen!"
updateFinished: "<prefix><green><bold>Das Update war erfolgreich! Um Probleme mit Timern zu vermeiden und das Update zu vervollständigen, musst du den Server neustarten!"
setMotdIndexError: "<prefix><red>Momentan gibt es %MOTDS% MOTDs, du musst also eine Zahl, die zwischen 1 und %NEWAMOUNT% liegt, wählen."
setMotdLineError: "<prefix><red>Das zweite Argument des Befehls muss die Zeilennummer sein (1 oder 2)!"
updateDownloading: "<prefix><red><bold>Das Update wird heruntergeladen..."
updateFailed: "<prefix><dark_red><bold>Das Update ist fehlgeschlagen!"
updateFinished: "<prefix><green><bold>Das Update war erfolgreich! Um keine Fehler mit Timern zu erhalten und das Update abzuschließen, wäre ein Serverneustart erforderlich!"
whitelistedPlayers: "<prefix><gold>Spieler in der Maintenance Whitelist:"
whitelistedPlayersFormat: "<dark_gray>- <yellow>%NAME% <dark_gray>(<gray>%UUID%<dark_gray>)"
whitelistAdded: "<prefix><aqua>%PLAYER% <green>wurde zur Maintenance Whitelist hinzugefügt!"
whitelistAlreadyAdded: "<prefix><aqua>%PLAYER% <red>ist bereits in der Maintenance Whitelist!"
whitelistRemoved: "<prefix><aqua>%PLAYER% <green>wurde von der Maintenance Whitelist entfernt!"
whitelistNotFound: "<prefix><red>Dieser Spieler ist nicht in der Maintenance Whitelist!"
whitelistEmpty: "<prefix><red>Die Maintenance Whitelist ist leer! Nutze <yellow>/maintenance add <Spieler/UUID><red>, um jemanden hinzuzufügen!"
playerNotFound: "<prefix><red>Bisher hat kein Spieler mit diesem Namen jemals auf diesem Server gespielt."
whitelistEmpty: "<prefix><red>In der Maintenance Whitelist befinden sich keine Spieler! Nutze <yellow>/maintenance add <player/uuid><red>, um jemanden hinzuzufügen!"
playerNotFound: "<prefix><red>Bisher hat kein Spieler mit diesem Namen auf diesem Server gespielt."
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
sentToWaitingServer: "<prefix><red>Du wurdest auf den Warteserver verbunden!"
forceWaitingServer: "<prefix><red>Du kannst den Warteserver nicht verlassen solange der Wartungsmodus aktiviert ist!"
invalidUuid: "<prefix><red>Das UUID Format ist ungültig!"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>Du wurdest auf einen 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!"
singleTimerCancelled: "<prefix><red>Der laufende Timer von <yellow>%SERVER% <red>wurde beendet."
singleTimerNotRunning: "<prefix><red>Momentan läuft kein Timer auf diesem Server."
singleTimerCancelled: "<prefix><red>Der laufende Timer dieses Servers wurde beendet."
singleEndtimerBroadcast: "<prefix><gray>Der Wartungsmodus auf Server %SERVER% wird deaktiviert in: <gold>%TIME%<gray>."
singleEndtimerStarted: "<prefix><green>Gestarteter Timer: <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>."
singleStarttimerStarted: "<prefix><green>Gestarteter Timer: <gray>Der Wartungsmodus auf Server %SERVER% ist aktiv in: <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>Der Wartungsmodus auf Server %SERVER% wird aktiviert in <gold>%TIME% <gray>und wird <gold>%DURATION% <gray>dauern."
singleScheduletimerStarted: "<prefix><green>Gestarteter Timer: <gray>Der Wartungsmodus auf Server %SERVER% ist in <gold>%TIME% <gray>aktiv und wird <gold>%DURATION% <gray>dauern."
singleMaintenanceKick: "<prefix><red>Der Server %SERVER% befindet sich momentan im Wartungsmodus! Probier es später nochmal!"
singleMaintenanceKickComplete: "<red>Der Server %SERVER% befindet sich in Wartung!<br>Du kannst versuchen zu rejoinen, um andere Server zu betreten!"
singleMaintenanceActivated: "<prefix><gold>Der Wartungsmodus wurde auf <yellow>%SERVER% <gold>aktiviert."
@@ -66,14 +67,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."
@@ -86,21 +85,19 @@ helpDump: "<gold>/maintenance dump <gray>(Sammelt wichtige Informationen für Bu
helpHelp: "<gold>/maintenance help [Seite] <gray>(Zeigt diese wunderschöne Hilfe)"
helpMotd: "<gold>/maintenance motd [Timer] <gray>(Zeigt die momentan gesetzten Maintenance Motds an. Mit dem 'timer' Argument werden die timerspezifischen Motds angezeigt)"
helpRemoveMotd: "<gold>/maintenance removemotd [Timer] <Index> <gray>(Entfernt eine Maintenance Motd. Mit dem 'timer' Argument wird eine timerspezifischen Motd entfernt)"
helpSetMotd: "<gold>/maintenance setmotd [Timer] <Index> <1/2> <Nachricht> <gray>(Setzte eine Motd für den Wartungsmodus. Mit dem 'timer' Argument as an argument wird eine timerspezifische Motd gesetzt)"
helpSetMotd: "<gold>/maintenance setmotd [Timer] <Index> <1/2> <Nachricht> <gray>(Setzte eine Motd für den Wartungsmodus. Mit dem 'timer' Argument wird eine timerspezifische Motd gesetzt)"
helpReload: "<gold>/maintenance reload <gray>(Lädt Config, Language und Whitelist Dateien sowie das Maintenance Icon neu)"
helpToggle: "<gold>/maintenance <on/off> <gray>(Aktiviert/deaktiviert den Wartungsmodus)"
helpUpdate: "<gold>/maintenance update <gray>(Sucht nach neuen Updates für das Plugin und lädt diese auf den Server)"
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
+11 -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!"
@@ -15,6 +14,7 @@ endtimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will be d
starttimerBroadcast: "<prefix><gray>Maintenance mode will be enabled in <gold>%TIME%<gray>."
starttimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will be activated in <gold>%TIME%<gray>."
scheduletimerBroadcast: "<prefix><gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
scheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>There is already a timer scheduled!"
timerNotRunning: "<prefix><red>There is currently no running timer."
timerCancelled: "<prefix><red>The current timer has been disabled."
@@ -45,18 +45,19 @@ 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."
singleEndtimerBroadcast: "<prefix><gray>Maintenance mode on server %SERVER% will be disabled in <gold>%TIME%<gray>."
singleEndtimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be deactivated in <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME%<gray>."
singleStarttimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be activated in <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>."
singleScheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>The server %SERVER% is currently under maintenance! Try again later!"
singleMaintenanceKickComplete: "<red>The server %SERVER% is under maintenance!<br>You may try to rejoin to go onto another server!"
singleMaintenanceActivated: "<prefix><gold>Maintenance mode is now activated on server <yellow>%SERVER%<gold>."
@@ -66,14 +67,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 +92,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
+12 -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!"
@@ -16,6 +14,7 @@ endtimerStarted: "<prefix><gray>Temporizador iniciado: El modo mantenimiento se
starttimerBroadcast: "<prefix><gray>El modo mantenimiento se habilitara en <gold>%TIME%<gray>."
starttimerStarted: "<prefix><gray>Temporizador iniciado: El modo mantenimiento se activará en <gold>%TIME%<gray>."
scheduletimerBroadcast: "<prefix><gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
scheduletimerStarted: "<prefix><gray>Temporizador iniciado: El modo mantenimiento se activará en <gold>%TIME% <gray>y durará <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>Ya hay un temporizador programado!"
timerNotRunning: "<prefix><gray>Actualmente no hay temporizador."
timerCancelled: "<prefix><red>El Temporizador actual ha sido deshabilitado."
@@ -46,18 +45,19 @@ 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>."
singleEndtimerStarted: "<prefix><gray>Temporizador iniciado: El modo mantenimiento en el servidor <gold>%SERVER%<gray> se desactivará en <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>El modo mantenimiento en el servidor <gold>%SERVER%<gray> se activará en <green>%TIME%<gray>"
singleStarttimerStarted: "<prefix><gray>Temporizador iniciado: El modo mantenimiento en el servidor <gold>%SERVER%<gray> se activará en <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>El modo mantenimiento en el servidor %SERVER% se activará en <gold>%TIME% <gray>y durará <gold>%DURATION%<gray>."
singleScheduletimerStarted: "<prefix><gray>Temporizador iniciado: El modo mantenimiento en el servidor <gold>%SERVER%<gray> se activará en <gold>%TIME% <gray>y durará <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><gray>El servidor <gold>%SERVER% <gray>se encuentra en mantenimiento! Intentalo mas tarde!"
singleMaintenanceKickComplete: "<gray>El Servidor <gold>%SERVER% <gray>esta en mantenimiento!<br><red>Vuelve Mas Tarde!"
singleMaintenanceActivated: "<prefix><gray>El modo mantenimiento esta activado en el servidor <gold>%SERVER%<gray>."
@@ -67,14 +67,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 +92,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
+12 -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 !"
@@ -15,6 +14,7 @@ endtimerStarted: "<prefix><green>Minuterie : <gray>Le mode maintenance sera dés
starttimerBroadcast: "<prefix><gray>Le mode de maintenance sera activé dans <gold>%TIME%<gray>."
starttimerStarted: "<prefix><green>Minuterie : <gray>Le mode maintenance sera activé dans <gold>%TIME%<gray>."
scheduletimerBroadcast: "<prefix><gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
scheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>Il y a déjà un horaire prévu !"
timerNotRunning: "<prefix><red>Il n'y a actuellement aucune maintenance prévue."
timerCancelled: "<prefix><red>La minuterie actuelle a été désactivée."
@@ -45,18 +45,19 @@ 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>."
singleEndtimerStarted: "<prefix><green>Minuterie : <gray>Le mode maintenance sur le serveur %SERVER% sera désactivé dans <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>La maintenance sur le serveur %SERVER% sera activée dans <gold>%TIME%<gray>."
singleStarttimerStarted: "<prefix><green>Minuterie : <gray>Le mode maintenance sur le serveur %SERVER% sera activé 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>."
singleScheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>Le serveur %SERVER% est actuellement en maintenance ! Réessayez plus tard !"
singleMaintenanceKickComplete: "<red>Le serveur %SERVER% est en maintenance !<br>Vous pouvez essayer un autre serveur !"
singleMaintenanceActivated: "<prefix><gold>La maintenance est maintenant activée sur le serveur <yellow>%SERVER%<gold>."
@@ -66,14 +67,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 +92,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
+103
View File
@@ -0,0 +1,103 @@
#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>Nincs engedélyed a parancs használatához."
kickmessage: "<red>A szerver karbantartás alatt áll!<br>Próbáld újra később!"
maintenanceActivated: "<prefix><gold>Karbantartás elindítva."
maintenanceDeactivated: "<prefix><gold>Karbantartás befejezve."
alreadyEnabled: "<prefix><red>Már engedélyezve van!"
alreadyDisabled: "<prefix><red>Már le van tiltva!"
endtimerBroadcast: "<prefix><gray>Felléphetsz <gold>%TIME%<gray> múlva."
endtimerStarted: "<prefix><green>Időzítő Elindítva: <gray>Felléphetsz <gold>%TIME%<gray> múlva."
starttimerBroadcast: "<prefix><gray>Karbantartás lesz <gold>%TIME%<gray> múlva."
starttimerStarted: "<prefix><green>Időzítő elindítva: <gray>Karbantartás lesz <gold>%TIME%<gray> múlva."
scheduletimerBroadcast: "<prefix><gray>Karbantartás lesz <gold>%TIME%<gray> múlva és <gold>%DURATION%<gray>-ig fog tartani."
scheduletimerStarted: "<prefix><green>Időzítő elindítva: <gray>Karbantartás lesz <gold>%TIME%<gray> múlva és <gold>%DURATION%<gray>-ig fog tartani."
timerAlreadyRunning: "<prefix><red>Már van ídőzítő beállítva!"
timerNotRunning: "<prefix><red>Nincs időzítő beállítva."
timerCancelled: "<prefix><red>Az időzítő letiltva."
timerTooLong: "<prefix><red>A számnak kevesebbnek kell lennie 40320-nál (28 nap)!"
timerMotdDisabled: "<prefix><red>Be kell állítanod a 'enable-timerspecific-messages' beállítást 'true'-ra, ha ezt szeretnéd."
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
joinNotification: "<prefix><yellow>%PLAYER% <red>megpróbált belépni a szerverre."
motdList: "<prefix><gray>Lista a karbantartás motd-(k)ről:"
motdListEmpty: "<prefix><red>Nincs beállítva karbantartás motd!"
reload: "<prefix><green>Újratöltve."
removedMotd: "<prefix><green>Motd szám törölve: %INDEX%."
removeMotdError: "<prefix><red>Csak egy motd van,nem törölheted!"
setMotd: "<prefix><green>Sor %LINE% beállítva %INDEX%-re. motd %MOTD%-ra"
setMotdIndexError: "<prefix><red>Csak %MOTDS%-d van, úgyhogy válassz egy számot 1 és %NEWAMOUNT% között."
setMotdLineError: "<prefix><red>Ennek egy sornak kell lennie (1 vagy 2)!"
updateDownloading: "<prefix><red><bold>Frissítés letöltése..."
updateFailed: "<prefix><dark_red><bold>Hiba!"
updateFinished: "<prefix><green><bold>Telepítve,indítsd újra a szervered!"
whitelistedPlayers: "<prefix><gold>Emberek akik beléphetnek karbantartáskor:"
whitelistedPlayersFormat: "<dark_gray>- <yellow>%NAME% <dark_gray>(<gray>%UUID%<dark_gray>)"
whitelistAdded: "<prefix><green>Hozzáadva <aqua>%PLAYER% <green>a karbantartás fehérlistához!"
whitelistAlreadyAdded: "<prefix><aqua>%PLAYER% <red>már benne van a karbantartás fehérlistában!"
whitelistRemoved: "<prefix><green>Törölve <aqua>%PLAYER% <green>a listából!"
whitelistNotFound: "<prefix><red>Ez a játékos nincs a karbantartás fehérlistában!"
whitelistEmpty: "<prefix><red>A lista üres!"
playerNotFound: "<prefix><red>Ez a játékos soha nem lépett fel a szerverre."
playerNotFoundUuid: "<prefix><red>A játékos nem található."
playerNotOnline: "<prefix><red>A játékos nincs online."
invalidUuid: "<prefix><red>Rossz UUID!"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>El lettél küldve egy várakozós szerverre!"
forceWaitingServer: "<prefix><red>Ezt a szervert a karbantartás végéig nem hagyhatod el!"
serverNotFound: "<prefix><red>Nincs a proxy-n ilyen nevű szerver regisztrálva!"
singleTimerAlreadyRunning: "<prefix><red>Már van egy visszaszámláló!"
singleTimerCancelled: "<prefix><red>Az aktuális visszaszámláló <yellow>%SERVER% <red>szervernek letiltva."
singleTimerNotRunning: "<prefix><red>Nem fut időzító a szerveren."
singleEndtimerBroadcast: "<prefix><gray>A karbantartás a(z) %SERVER% szerveren le lesz tiltva <gold>%TIME%<gray> múlva."
singleEndtimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be deactivated in <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix>A karbantartás a(z) %SERVER% szerveren engedélyezve lesz <gold>%TIME%<gray> múlva."
singleStarttimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be activated in <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>A karbantartás a(z) %SERVER% szerveren le lesz tiltva <gold>%TIME%<gray> múlva,és <gold>%DURATION<gray>-ig fog tartani."
singleScheduletimerStarted: "<prefix><green>Időzítő Elindítva: <gray>A karbantartás a(z) %SERVER% szerveren le lesz tiltva <gold>%TIME%<gray> múlva,és <gold>%DURATION<gray>-ig fog tartani."
singleMaintenanceKick: "<prefix><red>A(z) %SERVER% szerver jelenleg karbantartás alatt van! Próbáld újra később!"
singleMaintenanceKickComplete: "<red>A(z) %SERVER% karbantartás alatt van!<br>Megpróbálhatsz belépni újra!"
singleMaintenanceActivated: "<prefix><gold>A karbantartás engedélyezve a(z) <yellow>%SERVER%<gold> szerveren."
singleMaintenanceDeactivated: "<prefix><gold>A karbantartás letiltva a(z) <yellow>%SERVER%<gold>."
singleServerAlreadyEnabled: "<prefix><red>A karbantartás már engedélyezve van a(z) <yellow>%SERVER%<red> szerveren!"
singleServerAlreadyDisabled: "<prefix><red>A karbantartás már le van tiltva a(z) <yellow>%SERVER%<red> szerveren!"
singleServerMaintenanceList: "<prefix><gray>Proxy szerverek,karbantartási móddal engedélyezve:"
singleServerMaintenanceListEmpty: "<prefix><gray>Nincsenek proxy szerverek karbantartás alatt."
singleServerMaintenanceListEntry: "<dark_grey>- <aqua>%SERVER%"
second: "másodperc"
seconds: "másodperc"
minute: "perc"
minutes: "perc"
hour: "óra"
hours: "óra"
helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MAX% <dark_gray>]========"
helpPageNotFound: "<prefix><red>Nincs ilyen oldal!"
helpNextPage: "<gray>Használd a <aqua>/maintenance help %PAGE% <gray>parancsot,hogy lapozz."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(Az időzítő,ha fut nem lesz figelembe vévve)"
helpEndtimer: "<gold>/maintenance endtimer <minutes> <gray>(A megadott idő múlva az időzítő kikapcsol)"
helpStarttimer: "<gold>/maintenance starttimer <minutes> <gray>(A megadott idő múlva az időzítő bekapcsol)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <timer minutes> <maintenance duration> <gray>(Időbeosztás az időzítőnek)"
helpDebug: "<gold>/maintenance debug <gray>(Hibakeresés bekapcsolása)"
helpDump: "<gold>/maintenance dump <gray>(A hibajelentési előzményeket törli)"
helpHelp: "<gold>/maintenance help [page] <gray>(Megjelenítí a segítség ablakot)"
helpMotd: "<gold>/maintenance motd [timer] <gray>(Megjeleníti a motd-ket)"
helpRemoveMotd: "<gold>/maintenance removemotd [timer] <index> <gray>(Törli a megadott motd-t)"
helpSetMotd: "<gold>/maintenance setmotd [timer] <index> <1/2> <message> <gray>(Beállít egy motd-t)"
helpReload: "<gold>/maintenance reload <gray>(Újratölti a plugint)"
helpToggle: "<gold>/maintenance <on/off> <gray>(Karbantartás mód ki-be kapcsolása)"
helpUpdate: "<gold>/maintenance update <gray>(Frissíti a plugin verziót)"
helpWhitelist: "<gold>/maintenance whitelist <gray>(Megmutatja a karbantartás fehérlistázottak listáját)"
helpWhitelistAdd: "<gold>/maintenance add <name/uuid> <gray>(Hozzáadja a játékost a karbantartás fehérlistához)"
helpWhitelistRemove: "<gold>/maintenance remove <name/uuid> <gray>(Kitörli a játékost a karbantartás fehérlistáról)"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [server] <gray>(Ha van karbantartás,akkor figyelmen kívül veszi az időzítőt)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <minutes> <gray>(Egy megadott idővallum múlva kikapcsol a karbantartás mód)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <minutes> <gray>(Egy megadott idővallum múlva bekapcsol a karbantartás mód)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <timer minutes> <maintenance duration> <gray>(Időbeosztás az időzítőnek)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(Ki-be kapcsolja a karbantartás módot)"
helpStatus: "<gold>/maintenance status <gray>(Kiírja az összes proxy szervert,ami karbantartás alatt van)"
#Used for autoupdating the language file, do not change this value.
language-version: 1
+11 -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!"
@@ -16,6 +14,7 @@ endtimerStarted: "<prefix><green>Timer avviato: <gray>La modalità manutenzione
starttimerBroadcast: "<prefix><gray>La modalità manutenzione verrà attivata tra <gold>%TIME%<gray>."
starttimerStarted: "<prefix><green>Timer avviato: <gray>La modalità manutenzione verrà attivata tra <gold>%TIME%<gray>."
scheduletimerBroadcast: "<prefix><gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
scheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>C'è già un timer programmato!"
timerNotRunning: "<prefix><red>Non c'è nessun timer attivo al momento."
timerCancelled: "<prefix><red>Il timer attuale è stato disattivato."
@@ -46,18 +45,19 @@ 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."
singleEndtimerBroadcast: "<prefix><gray>La modalità manutenzione per il server %SERVER% verrà disabilitata tra <gold>%TIME%<gray>."
singleEndtimerStarted: "<prefix><green>Timer avviato: <gray>La modalità manutenzione per il server %SERVER% verrà disattivata tra <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>La modalità manutenzione per il server %SERVER% verrà disabilitata tra <gold>%TIME%<gray>."
singleStarttimerStarted: "<prefix><green>Timer avviato: <gray>La modalità manutenzione per il server %SERVER% verrà attivata tra <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>."
singleScheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>Il server %SERVER% è in manutenzione al momento! Ritenta più tardi!"
singleMaintenanceKickComplete: "<red>Il server %SERVER% è in manutenzione!<br>Prova a rientrare per accedere ad un'altro server!"
singleMaintenanceActivated: "<prefix><gold>La modalità manutenzione è ora attiva sul server <yellow>%SERVER%<gold>."
@@ -67,14 +67,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 +92,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
+103
View File
@@ -0,0 +1,103 @@
#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>の間、持続されます。"
scheduletimerStarted: "<prefix><green>タイマー開始:<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> で無効になります。"
singleEndtimerStarted: "<prefix><green>タイマー開始:<gray>%SERVER% のメンテナンスモードは、<gold>%TIME%<gray> で解除されます。"
singleStarttimerBroadcast: "<prefix><gray>%SERVER% のメンテナンスモードは、<gold>%TIME%<gray> で有効になります。"
singleStarttimerStarted: "<prefix><green>タイマー開始:<gray>%SERVER% のメンテナンスモードは、<gold>%TIME%<gray> で開始されます。"
singleScheduletimerBroadcast: "<prefix><gray>サーバ %SERVER% のメンテナンスモードは <gold>%TIME% <gray> で有効になり、<gold>%DURATION%<gray> の間持続します。"
singleScheduletimerStarted: "<prefix><green>タイマー開始:<gray>サーバ %SERVER% のメンテナンスモードは <gold>%TIME% <gray> で有効になり、<gold>%DURATION%<gray> の間持続します。"
singleMaintenanceKick: "<prefix><red>%SERVER% はメンテナンス中です。しばらくたってからもう一度お試しください。"
singleMaintenanceKickComplete: "<red>サーバー %SERVER% はメンテナンス中です!<br>他のサーバーに再び参加することができます!"
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
+103
View File
@@ -0,0 +1,103 @@
#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><gold>유지 관리 모드가 활성화되었습니다."
maintenanceDeactivated: "<prefix><gold>유지 관리 모드가 비활성화되었습니다."
alreadyEnabled: "<prefix><red>유지 관리가 이미 활성화되었습니다!"
alreadyDisabled: "<prefix><red>유지보수가 이미 비활성화되었습니다!"
endtimerBroadcast: "<prefix><gray>유지 관리 모드는<gold>%TIME%<gray>에 비활성화됩니다.."
endtimerStarted: "<prefix><green>타이머가 시작 되었습니다: <gray>유지 관리 모드가 <gold>%TIME%<gray>에 비활성화됩니다."
starttimerBroadcast: "<prefix><gray>유지 관리 모드가 <gold>%TIME%<gray>에 활성화됩니다.."
starttimerStarted: "<prefix><green>타머가 시작 되었습니다: <gray>유지 관리 모드가 <gold>%TIME%<gray>에 활성화됩니다."
scheduletimerBroadcast: "<prefix><gray>유지 관리 모드는 <gold>%TIME%<gray>에 활성화되며, <gold>%DURATION%<gray>동안 지속됩니다.."
scheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>이미 타이머가 예약되어 있습니다!"
timerNotRunning: "<prefix><red>현재 실행중인 타이머가 없습니다."
timerCancelled: "<prefix><red>현재 타이머가 비활성화되었습니다."
timerTooLong: "<prefix><red>숫자는 40320(28일) 미만이어야 합니다!"
timerMotdDisabled: "<prefix><red>타이머별 모드를 사용/편집하려면 설정에서 'enable-timerspecific-messages'를 'true'로 설정해야 합니다."
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
joinNotification: "<prefix><yellow>%PLAYER%<red>님이 서버에 접속을 시도했습니다."
motdList: "<prefix><gray>유지 관리 motd 목록:"
motdListEmpty: "<prefix><red>유지 관리 motd가 설정되어 있지 않습니다!"
reload: "<prefix><green>설정, 화이트리스트 플레이어, 언어 파일 및 유지 관리 아이콘을 새로고침 했습니다."
removedMotd: "<prefix><green>%INDEX%번째 motd를 삭제했습니다."
removeMotdError: "<prefix><red>motd가 하나만 있으므로 제거할 수 없습니다!"
setMotd: "<prefix><green>INDEX%의 %LINE% 줄을 %MOTD%로 설정합니다."
setMotdIndexError: "<prefix><red>현재 %MOTDS% motd가 있으므로 1에서 %NEWAMOUNT% 사이의 숫자를 선택해야 합니다."
setMotdLineError: "<prefix><red>두 번째 인수는 줄 번호(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><green><aqua>%PLAYER%<green>님을 화이트리스트에 추가했습니다!"
whitelistAlreadyAdded: "<prefix><aqua>%PLAYER%<red>님은 이미 화이트리스트에 있습니다!"
whitelistRemoved: "<prefix><green><aqua>%PLAYER%<green>님을 화이트리스트에서 제거했습니다!"
whitelistNotFound: "<prefix><red>이 플레이어는 유지 관리 화이트리스트에 없습니다!"
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>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."
singleEndtimerBroadcast: "<prefix><gray>Maintenance mode on server %SERVER% will be disabled in <gold>%TIME%<gray>."
singleEndtimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be deactivated in <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME%<gray>."
singleStarttimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be activated in <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>."
singleScheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>The server %SERVER% is currently under maintenance! Try again later!"
singleMaintenanceKickComplete: "<red>The server %SERVER% is under maintenance!<br>You may try to rejoin to go onto another server!"
singleMaintenanceActivated: "<prefix><gold>Maintenance mode is now activated on server <yellow>%SERVER%<gold>."
singleMaintenanceDeactivated: "<prefix><gold>Maintenance mode is now deactivated on server <yellow>%SERVER%<gold>."
singleServerAlreadyEnabled: "<prefix><red>Maintenance is already enabled on server <yellow>%SERVER%<red>!"
singleServerAlreadyDisabled: "<prefix><red>Maintenance is already disabled on server <yellow>%SERVER%<red>!"
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."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(If running, the current timer will be aborted)"
helpEndtimer: "<gold>/maintenance endtimer <minutes> <gray>(After the given time in minutes, maintenance mode will be disabled)"
helpStarttimer: "<gold>/maintenance starttimer <minutes> <gray>(After the given time in minutes, maintenance mode will be enabled)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <timer minutes> <maintenance duration> <gray>(After the given time in minutes, maintenance mode will be enabled for the given duration in minutes)"
helpDebug: "<gold>/maintenance debug <gray>(Enables some debug logging)"
helpDump: "<gold>/maintenance dump <gray>(Dumps some server information, used for bug reports)"
helpHelp: "<gold>/maintenance help [page] <gray>(Shows this beautiful help window)"
helpMotd: "<gold>/maintenance motd [timer] <gray>(Lists the currently set maintenance motds. If specifying 'timer', the timer motds are shown)"
helpRemoveMotd: "<gold>/maintenance removemotd [timer] <index> <gray>(Removes a maintenance motd. If using 'timer' as an argument, a timerspecific pingmessage will be removed)"
helpSetMotd: "<gold>/maintenance setmotd [timer] <index> <1/2> <message> <gray>(Sets a motd for maintenance mode. If using 'timer' as an argument, a timerspecific pingmessage will be set)"
helpReload: "<gold>/maintenance reload <gray>(Reloads the config file, whitelist file and the server-icon)"
helpToggle: "<gold>/maintenance <on/off> <gray>(Enables/disables maintenance mode)"
helpUpdate: "<gold>/maintenance update <gray>(Remotely downloads the newest version of the plugin onto your server)"
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
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.
language-version: 1
+13 -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."
@@ -15,6 +14,7 @@ endtimerStarted: "<prefix><green>Rozpoczęto timer: <gray>Tryb konserwacji zosta
starttimerBroadcast: "<prefix><gray>Przerwa techniczna zacznie się za <gold>%TIME%<gray>."
starttimerStarted: "<prefix><green>Rozpoczęto timer: <gray>Tryb konserwacji zostanie włączony za <gold>%TIME%<gray>."
scheduletimerBroadcast: "<prefix><gray>Przerwa techniczna zostanie rozpoczęta za <gold>%TIME% <gray>i będzie trwała przez <gold>%DURATION%<gray>."
scheduletimerStarted: "<prefix><green>Rozpoczęto timer: <gray>Przerwa techniczna zostanie rozpoczęta za <gold>%TIME% <gray>i będzie trwała przez <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>Timer został już zaplanowany!"
timerNotRunning: "<prefix><red>Aktualnie nie ma żadnego działającego timera."
timerCancelled: "<prefix><red>Bieżący timer został anulowany."
@@ -45,18 +45,19 @@ 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."
singleEndtimerBroadcast: "<prefix><gray>Tryb konserwacji na serwerze %SERVER% zostanie wyłączony za <gold>%TIME%<gray>."
singleEndtimerStarted: "<prefix><green>Rozpoczęto timer: <gray>Tryb konserwacji na serwerze %SERVER% zostanie wyłączony za <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>Tryb konserwacji na serwerze %SERVER% zostanie włączony za <gold>%TIME%<gray>."
singleStarttimerStarted: "<prefix><green>Rozpoczęto timer: <gray>Tryb konserwacji na serwerze %SERVER% zostanie włączony za <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>Tryb konserwacji na serwerze %SERVER% zostanie włączony za <gold>%TIME% <gray>i będzie trwał <gold>%DURATION%<gray>."
singleScheduletimerStarted: "<prefix><green>Rozpoczęto timer: <gray>Tryb konserwacji na serwerze %SERVER% zostanie włączony za <gold>%TIME% <gray>i będzie trwał <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>Serwer %SERVER% jest w trakcie przerwy technicznej! Spróbuj ponownie później!"
singleMaintenanceKickComplete: "<red>Serwer %SERVER% jest w trakcie przerwy technicznej!<br>Możesz spróbować dołączyć ponownie lub iść na inny serwer!"
singleMaintenanceActivated: "<prefix><gold>Tryb konserwacji został włączony na serwerze <yellow>%SERVER%<gold>."
@@ -66,14 +67,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 +92,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
+89 -93
View File
@@ -1,107 +1,103 @@
# 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!"
maintenanceActivated: "<prefix><gold>Manutencao esta agora ativada!"
maintenanceDeactivated: "<prefix><gold>Manutencao esta agora desativada!"
alreadyEnabled: "<prefix><red>Manutencao ja esta ativada!"
alreadyDisabled: "<prefix><red>Manutencao ja esta desativada!"
endtimerBroadcast: "<prefix><gray>Manutencao vai ser desativada em <gold>%TIME%<gray>"
endtimerStarted: "<prefix><green>Temporizador: <gray>Manutencao vai ser desativada em <gold>%TIME%<gray>"
starttimerBroadcast: "<prefix><gray>Manutencao vai ser ativada em <gold>%TIME%<gray>"
starttimerStarted: "<prefix><gray>Manutencao vai ser ativada em <gold>%TIME%<gray>"
scheduletimerBroadcast: "<dark_gray>[<yellow>Manutencao<dark_gray>] <gray>O servidor entrara em manutencao em <gold>%TIME% <gray>e ira durar <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>O Timer ja esta a decorrer!"
timerNotRunning: "<prefix><red>O Timer nao esta a decorrer!"
timerCancelled: "<prefix><red>O Timer foi cancelado!"
timerTooLong: "<prefix><red>O numero tem de ser menor que 40320 (28 dias)!"
timerMotdDisabled: "<prefix><red>Define 'enable-timerspecific-messages' no config a 'true', se queres definir/editar motds de manutenção."
noPermission: "<red>Você não tem permissão para executar esse comando."
kickmessage: "<red>O servidor está em manutenção!<br>Tente novamente mais tarde!"
maintenanceActivated: "<prefix><gold>O modo de manutenção agora está ativado."
maintenanceDeactivated: "<prefix><gold>O modo de manutenção agora está desativado."
alreadyEnabled: "<prefix><red>A manutenção já está ativada!"
alreadyDisabled: "<prefix><red>A manutenção já está desativada!"
endtimerBroadcast: "<prefix><gray>O modo de manutenção será desativado em <gold>%TIME%<gray>."
endtimerStarted: "<prefix><green>Iniciou o temporizador: <gray>O modo de manutenção será desativado em <gold>%TIME%<gray>."
starttimerBroadcast: "<prefix><gray>O modo de manutenção será ativado em <gold>%TIME%<gray>."
starttimerStarted: "<prefix><green>Iniciou o temporizador: <gray>O modo de manutenção será ativado em <gold>%TIME%<gray>."
scheduletimerBroadcast: "<prefix><gray>O modo de manutenção será ativado em <gold>%TIME% <gray>e durará <gold>%DURATION%<gray>."
scheduletimerStarted: "<prefix><green>Iniciou o temporizador: <gray>O modo de manutenção será ativado em <gold>%TIME% <gray>e durará <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>Já há um temporizador agendado!"
timerNotRunning: "<prefix><red>Não há temporizador em execução no momento."
timerCancelled: "<prefix><red>O temporizador atual foi desativado."
timerTooLong: "<prefix><red>O número deve ser menor que 40320 (28 dias)!"
timerMotdDisabled: "<prefix><red>Você deve definir 'enable-timerspecific-messages' na configuração como 'true', se desejar usar/editar motds específicas do temporizador."
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
joinNotification: "<prefix><yellow>%PLAYER% <red>tentou entrar no servidor."
motdList: "<prefix><gray>Lista de motds de manutencao:"
motdListEmpty: "<prefix><red>Não tens motds de manutenção!"
reload: "<prefix><green>Reloaded config, whitelistedplayers, linguagem e icon de manutencao."
removedMotd: "<prefix><green>Removida motd numero %INDEX%."
removeMotdError: "<prefix><red>So tens uma motd, entao nao podes remover esta!"
setMotd: "<dark_gray>[<yellow>Manutencao<dark_gray>] <green>Linha %LINE% do %INDEX%. Motd de manutencao %MOTD%"
setMotdIndexError: "<prefix><red>Tens atualmente %MOTDS% motds, entao escolhe um numero entre 1 e %NEWAMOUNT%."
setMotdLineError: "<prefix><red>O segundo argumento tem de ser na linha (1 ou 2)!"
updateDownloading: "<prefix><red><bold>A dar download do update..."
updateFailed: "<prefix><dark_red><bold>Update falhado!"
updateFinished: "<prefix><green><bold>O update foi feito com sucesso! Reinicia o servidor paa evitar erros e acabar a atualizacao"
whitelistedPlayers: "<prefix><gold>Whitelisted players para a manutencao:"
motdList: "<prefix><gray>Lista das suas motds de manutenção:"
motdListEmpty: "<prefix><red>Você não possui nenhuma motd de manutenção definida!"
reload: "<prefix><green>Recarregou a configuração, lista de jogadores com permissão, arquivo de idioma e o ícone de manutenção."
removedMotd: "<prefix><green>Motd número %INDEX% removida."
removeMotdError: "<prefix><red>Você possui apenas uma motd, portanto, não pode remover nenhuma!"
setMotd: "<prefix><green>Definiu a linha %LINE% da motd de manutenção %INDEX% para %MOTD%"
setMotdIndexError: "<prefix><red>No momento, você possui %MOTDS% motds, portanto, deve escolher um número entre 1 e %NEWAMOUNT%."
setMotdLineError: "<prefix><red>O segundo argumento deve ser o número da linha (1 ou 2)!"
updateDownloading: "<prefix><red><bold>Baixando atualização..."
updateFailed: "<prefix><dark_red><bold>Falha na atualização!"
updateFinished: "<prefix><green><bold>A atualização foi bem-sucedida! Para evitar problemas com tarefas e concluir a atualização, você deve reiniciar o servidor!"
whitelistedPlayers: "<prefix><gold>Jogadores na lista branca para a manutenção:"
whitelistedPlayersFormat: "<dark_gray>- <yellow>%NAME% <dark_gray>(<gray>%UUID%<dark_gray>)"
whitelistAdded: "<prefix><green>Adicionado <aqua>%PLAYER% <green>na whitelist!"
whitelistAlreadyAdded: "<prefix><aqua>%PLAYER% <red>ja esta na whitelist!"
whitelistRemoved: "<prefix><aqua>%PLAYER% <green>removido da whitelist!"
whitelistNotFound: "<prefix><red>Este jogador nao esta na whitelist!"
whitelistEmpty: "<prefix><red>A whitelist esta vazia! Usa <yellow>/maintenance add <player/uuid> <red>para adicionar alguem!"
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
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!"
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>."
singleMaintenanceKick: "<prefix><red>O %SERVER% esta em manutencao! Tente mais tarde!"
singleMaintenanceKickComplete: "<red>O %SERVER% esta em manutencao!<br>Tente mais tarde!"
singleMaintenanceActivated: "<prefix><gold>Manutencao esta agora ativada no <yellow>%SERVER%<gold>."
singleMaintenanceDeactivated: "<prefix><gold>Manutencao esta agora desativada no <yellow>%SERVER%<gold>."
singleServerAlreadyEnabled: "<prefix><red>Manutencao ja esta ativada no <yellow>%SERVER%<red>!"
singleServerAlreadyDisabled: "<prefix><red>Manutencao ja esta desativada no <yellow>%SERVER%<red>!"
singleServerMaintenanceList: "<prefix><gray>Servidores com manutencao ativa:"
singleServerMaintenanceListEmpty: "<prefix><gray>Nao existem servidores com a manutencao ativa."
whitelistAdded: "<prefix><green>Adicionou <aqua>%PLAYER% <green>à lista branca de manutenção!"
whitelistAlreadyAdded: "<prefix><aqua>%PLAYER% <red>já está na lista branca de manutenção!"
whitelistRemoved: "<prefix><green>Removeu <aqua>%PLAYER% <green>da lista branca de manutenção!"
whitelistNotFound: "<prefix><red>Este jogador não está na lista branca de manutenção!"
whitelistEmpty: "<prefix><red>A lista branca de manutenção está vazia! Use <yellow>/maintenance add <player/uuid> <red>para adicionar alguém!"
playerNotFound: "<prefix><red>Nenhum jogador com esse nome já jogou neste servidor."
playerNotFoundUuid: "<prefix><red>Nenhum jogador com esse UUID foi encontrado."
playerNotOnline: "<prefix><red>Não há nenhum jogador online com esse nome."
invalidUuid: "<prefix><red>Formato de UUID inválido!"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
sentToWaitingServer: "<prefix><red>Você foi enviado para um servidor de espera!"
forceWaitingServer: "<prefix><red>Você não pode sair do servidor de espera enquanto a manutenção estiver ativada!"
serverNotFound: "<prefix><red>Nenhum servidor com esse nome está registrado no proxy!"
singleTimerAlreadyRunning: "<prefix><red>Já há um temporizador agendado para esse servidor!"
singleTimerCancelled: "<prefix><red>O temporizador atual para o servidor <yellow>%SERVER% <red>foi desativado."
singleTimerNotRunning: "<prefix><red>No momento, não há temporizador em execução para esse servidor."
singleEndtimerBroadcast: "<prefix><gray>O modo de manutenção no servidor %SERVER% será desativado em <gold>%TIME%<gray>."
singleEndtimerStarted: "<prefix><green>Iniciou o temporizador: <gray>O modo de manutenção no servidor %SERVER% será desativado em <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>O modo de manutenção no servidor %SERVER% será ativado em <gold>%TIME%<gray>."
singleStarttimerStarted: "<prefix><green>Iniciou o temporizador: <gray>O modo de manutenção no servidor %SERVER% será ativado em <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>O modo de manutenção no servidor %SERVER% será ativado em <gold>%TIME% <gray>e durará <gold>%DURATION%<gray>."
singleScheduletimerStarted: "<prefix><green>Iniciou o temporizador: <gray>O modo de manutenção no servidor %SERVER% será ativado em <gold>%TIME% <gray>e durará <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>O servidor %SERVER% está em manutenção! Tente novamente mais tarde!"
singleMaintenanceKickComplete: "<red>O servidor %SERVER% está em manutenção!<br>Você pode tentar se reconectar para ir para outro servidor!"
singleMaintenanceActivated: "<prefix><gold>O modo de manutenção foi ativado no servidor <yellow>%SERVER%<gold>."
singleMaintenanceDeactivated: "<prefix><gold>O modo de manutenção foi desativado no servidor <yellow>%SERVER%<gold>."
singleServerAlreadyEnabled: "<prefix><red>A manutenção já está ativada no servidor <yellow>%SERVER%<red>!"
singleServerAlreadyDisabled: "<prefix><red>A manutenção já está desativada no servidor <yellow>%SERVER%<red>!"
singleServerMaintenanceList: "<prefix><gray>Servidores proxy com manutenção ativada:"
singleServerMaintenanceListEmpty: "<prefix><gray>Não há servidores proxy em manutenção no momento."
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."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(Se estiver a correr o temporizador vai ser abortado)"
helpEndtimer: "<gold>/maintenance endtimer <minutes> <gray>(Depois do temporizador acabar a manutenção vai ser desativada)"
helpStarttimer: "<gold>/maintenance starttimer <minutes> <gray>(Depois do temporizador acabar a manutenção vai ser ativa)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <timer minutes> <maintenance duration> <gray>(Apos o tempo determinado em minutos, o modo de manutenção sera habilitado para a duracao em minutos)"
helpDebug: "<gold>/maintenance debug <gray>(Ativa algum registro de depuração)"
helpDump: "<gold>/maintenance dump <gray>(Discarta alguma informação do server, usado para bugs)"
helpHelp: "<gold>/maintenance help [page] <gray>(Mostra o help da manutenção)"
helpMotd: "<gold>/maintenance motd [timer] <gray>(Lista as motd currentes. Se usar 'timer', os temporizadores vão ser mostrados)"
helpRemoveMotd: "<gold>/maintenance removemotd [timer] <index> <gray>(Remove a motd da manutenção. Se usar 'timer' como argumento uma mensagem com tempo vai ser eliminada)"
helpSetMotd: "<gold>/maintenance setmotd [timer] <index> <1/2> <message> <gray>(Define a motd da manutenção. Se usar 'timer' como argumento uma mensagem com tempo vai aparecer)"
helpReload: "<gold>/maintenance reload <gray>(Dá reload ao plugin de manutenção)"
helpToggle: "<gold>/maintenance <on/off> <gray>(Ativa/Desativa a manutenção)"
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
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.
helpPageNotFound: "<prefix><red>Não há página com esse número!"
helpNextPage: "<gray>Use <aqua>/maintenance help %PAGE% <gray>para ir para a próxima janela de ajuda."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(Se estiver em execução, o temporizador atual será abortado)"
helpEndtimer: "<gold>/maintenance endtimer <minutos> <gray>(Após o tempo fornecido em minutos, o modo de manutenção será desativado)"
helpStarttimer: "<gold>/maintenance starttimer <minutos> <gray>(Após o tempo fornecido em minutos, o modo de manutenção será ativado)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <minutos do temporizador> <duração da manutenção> <gray>(Após o tempo fornecido em minutos, o modo de manutenção será ativado por uma duração fornecida em minutos)"
helpDebug: "<gold>/maintenance debug <gray>(Ativa alguns registros de depuração)"
helpDump: "<gold>/maintenance dump <gray>(Exibe algumas informações do servidor, usadas para relatórios de bugs)"
helpHelp: "<gold>/maintenance help [página] <gray>(Mostra esta bela janela de ajuda)"
helpMotd: "<gold>/maintenance motd [temporizador] <gray>(Lista as motds de manutenção atualmente definidas. Se 'temporizador' for especificado, as motds de temporizador serão mostradas)"
helpRemoveMotd: "<gold>/maintenance removemotd [temporizador] <índice> <gray>(Remove uma motd de manutenção. Se usar 'temporizador' como argumento, uma mensagem de ping específica do temporizador será removida)"
helpSetMotd: "<gold>/maintenance setmotd [temporizador] <índice> <1/2> <mensagem> <gray>(Define uma motd para o modo de manutenção. Se usar 'temporizador' como argumento, uma mensagem de ping específica do temporizador será definida)"
helpReload: "<gold>/maintenance reload <gray>(Recarrega o arquivo de configuração, arquivo de lista branca e o ícone do servidor)"
helpToggle: "<gold>/maintenance <on/off> <gray>(Ativa/desativa o modo de manutenção)"
helpUpdate: "<gold>/maintenance update <gray>(Baixa remotamente a versão mais recente do plugin para o seu servidor)"
helpWhitelist: "<gold>/maintenance whitelist <gray>(Mostra todos os jogadores na lista branca para o modo de manutenção)"
helpWhitelistAdd: "<gold>/maintenance add <nome/uuid> <gray>(Adiciona o jogador à lista branca de manutenção, permitindo que eles entrem no servidor mesmo com a manutenção ativada)"
helpWhitelistRemove: "<gold>/maintenance remove <nome/uuid> <gray>(Remove o jogador da lista branca de manutenção)"
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge
helpAbortSingleTimer: "<gold>/maintenance aborttimer [servidor] <gray>(Se estiver em execução, o temporizador atual será abortado)"
helpSingleEndtimer: "<gold>/maintenance endtimer [servidor] <minutos> <gray>(Após o tempo fornecido em minutos, o modo de manutenção será desativado)"
helpSingleStarttimer: "<gold>/maintenance starttimer [servidor] <minutos> <gray>(Após o tempo fornecido em minutos, o modo de manutenção será ativado)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [servidor] <minutos do temporizador> <duração da manutenção> <gray>(Após o tempo fornecido em minutos, o modo de manutenção será ativado por uma duração fornecida em minutos)"
helpSingleToggle: "<gold>/maintenance <on/off> [servidor] <gray>(Ativa/desativa o modo de manutenção)"
helpStatus: "<gold>/maintenance status <gray>(Lista todos os servidores proxy que estão atualmente em manutenção)"
#Used for autoupdating the language file, do not change this value.
language-version: 1
+12 -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>Сервер закрыт на технические работы!"
@@ -16,6 +14,7 @@ endtimerStarted: "<green>Таймер успешно запущен! Серве
starttimerBroadcast: "<green>Сервер будет закрыт на технические работы через <white>%TIME%<green>!"
starttimerStarted: "<green>Таймер успешно запущен! Сервер будет закрыт на технические работы через <white>%TIME%<green>!"
scheduletimerBroadcast: "<prefix><gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
scheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
timerAlreadyRunning: "<red>Таймер уже запущен!"
timerNotRunning: "<red>Таймер не был запущен."
timerCancelled: "<gray>Таймер был остановлен."
@@ -46,18 +45,19 @@ 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>не был запущен."
singleEndtimerBroadcast: "<green>Сервер <white>%SERVER% <green>будет открыт через <white>%TIME%<green>!"
singleEndtimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be deactivated in <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<red>Внимание! Сервер <white>%SERVER% <red>будет закрыт на технические работы через <white>%TIME%<red>!"
singleStarttimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be activated in <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>."
singleScheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
singleMaintenanceKick: "<red>Данный сервер закрыт на технические работы! Попробуйте позже."
singleMaintenanceKickComplete: "<red>Данный сервер закрыт на технические работы!<br>Попробуйте позже."
singleMaintenanceActivated: "<green>Режим технических работ на сервере <white>%SERVER% <green>включен!"
@@ -67,14 +67,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 +92,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
+103
View File
@@ -0,0 +1,103 @@
#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>Servern ä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>."
scheduletimerStarted: "<prefix><green>Startade timer: <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>."
singleEndtimerStarted: "<prefix><green>Startade timer: <gray>Underhållsläge på server %SERVER% kommer stängas av om <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>Underhållsläge på server %SERVER% kommer aktiveras om <gold>%TIME%<gray>."
singleStarttimerStarted: "<prefix><green>Startade timer: <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>."
singleScheduletimerStarted: "<prefix><green>Startade timer: <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
+103
View File
@@ -0,0 +1,103 @@
#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."
scheduletimerStarted: "<prefix><green>Başlatılan zamanlayıcı: <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."
singleEndtimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be deactivated in <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>%SERVER% sunucusunda <gold>%TIME%<gray> içerisinde bakım modu etkin olacaktır."
singleStarttimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be activated in <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>%SERVER% sunucusunda <gold>%TIME% <gray> içerisinde bakım modu etkin olacaktır, süre: <gold>%DURATION%<gray>."
singleScheduletimerStarted: "<prefix><green>Başlatılan zamanlayıcı: <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
+103
View File
@@ -0,0 +1,103 @@
#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>."
scheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <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>!"
singleEndtimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be deactivated in <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<red>Увага! Сервер <white>%SERVER% <red>буде закрито на технічні роботи через <white>%TIME%<red>!"
singleStarttimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be activated in <gold>%TIME%<gray>."
singleScheduletimerBroadcast: "<prefix><gray>Технічні роботи на сервері %SERVER% почнуться через <gold>%TIME% <gray>і триватиме <gold>%DURATION%<gray>."
singleScheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME% <gray>and will last for <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
+11 -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>请稍后再试!"
@@ -16,6 +14,7 @@ endtimerStarted: "<prefix><green>开始计时: <gray>维护模式将在<gold>%TI
starttimerBroadcast: "<prefix><gray>维护模式将在<gold>%TIME%<gray>后开启"
starttimerStarted: "<prefix><green>开始计时: <gray>维护模式将在<gold>%TIME%<gray>后开启。"
scheduletimerBroadcast: "<prefix><gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
scheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
timerAlreadyRunning: "<prefix><red>当前已有计时正在执行!"
timerNotRunning: "<prefix><red>当前没有正在运行的计时器。"
timerCancelled: "<prefix><red>当前计时器已中止。"
@@ -46,18 +45,19 @@ 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>该服务器当前没有正在运行的计时器。"
singleEndtimerBroadcast: "<prefix><gray>服务器%SERVER%的维护模式将在<gold>%TIME%<gray>后关闭。"
singleEndtimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be deactivated in <gold>%TIME%<gray>."
singleStarttimerBroadcast: "<prefix><gray>服务器%SERVER%的维护模式将在<gold>%TIME%<gray>后开启。"
singleStarttimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be activated in <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>."
singleScheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode on server %SERVER% will be enabled in <gold>%TIME% <gray>and will last for <gold>%DURATION%<gray>."
singleMaintenanceKick: "<prefix><red>服务器%SERVER%正在维护!请稍后再试!"
singleMaintenanceKickComplete: "<red>服务器%SERVER%正在维护!<br>你可以尝试重新加入另一个服务器!"
singleMaintenanceActivated: "<prefix><gold>服务器<yellow>%SERVER%<gold>的维护模式已启用。"
@@ -67,14 +67,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 +92,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.2.0
# Gradle properties
org.gradle.daemon=true
+25 -15
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.14.0"
adventurePlatform = "4.3.0"
mysqlConnector = "8.0.33"
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"
authlib = "1.5.25"
luckperms = "5.3"
serverlistplus = "3.4.9-SNAPSHOT"
serverlistplus = "3.5.0"
paper = "1.16.5-R0.1-SNAPSHOT"
bungee = "1.18-R0.1-SNAPSHOT"
bungee = "1.20-R0.1-SNAPSHOT"
sponge = "8.0.0"
velocity = "3.1.0"
junitVer = "5.9.2"
[libraries]
@@ -35,24 +37,32 @@ adventureTextSerializerLegacy = { group = "net.kyori", name = "adventure-text-se
adventurePlatformBukkit = { group = "net.kyori", name = "adventure-platform-bukkit", version.ref = "adventurePlatform" }
adventurePlatformBungee = { group = "net.kyori", name = "adventure-platform-bungeecord", version.ref = "adventurePlatform" }
mysqlConnector = { group = "mysql", name = "mysql-connector-java", version.ref = "mysqlConnector" }
mysqlConnector = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysqlConnector" }
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.
+3 -1
View File
@@ -1,5 +1,7 @@
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.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+23 -8
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,11 @@ 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"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
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 +198,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 +214,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
+92 -89
View File
@@ -1,89 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="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
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
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!
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
:omega
+5 -4
View File
@@ -2,9 +2,9 @@ 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.codemc.io/repository/maven-public/")
maven("https://repo.dmulloy2.net/repository/public/")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
mavenCentral()
@@ -14,8 +14,9 @@ dependencyResolutionManagement {
pluginManagement {
plugins {
id("net.kyori.blossom") version "1.2.0"
id("com.github.johnrengelman.shadow") version "7.1.1"
id("net.kyori.blossom") version "2.1.0"
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7"
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;
@@ -70,7 +70,7 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
this.plugin = plugin;
this.audiences = BukkitAudiences.create(plugin);
settings = new Settings(this, "mysql", "proxied-maintenance-servers", "fallback", "waiting-server");
settings = new Settings(this, "mysql", "proxied-maintenance-servers", "fallback", "waiting-server", "commands-on-single-maintenance-enable", "commands-on-single-maintenance-disable");
sendEnableMessage();
@@ -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,23 +88,24 @@ 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
public void onEnable(final StartingEngineEvent<Server> event) {
settings = new Settings(this, "mysql", "proxied-maintenance-servers", "fallback", "waiting-server",
"playercountmessage");
"playercountmessage", "commands-on-single-maintenance-enable", "commands-on-single-maintenance-disable");
sendEnableMessage();
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());