Compare commits

...
52 Commits
Author SHA1 Message Date
Maintenancer d370086345 New translations language-en.yml (German) 2024-12-12 05:27:28 +01:00
Maintenancer 7b6c8366e6 New translations language-en.yml (Spanish) 2024-12-02 00:51:49 +01:00
Maintenancer d806d499e3 New translations language-en.yml (Polish) 2024-12-01 20:29:08 +01:00
Maintenancer 9c624f5235 New translations language-en.yml (Russian) 2024-11-28 19:48:55 +01:00
Maintenancer 041e1f4518 New translations language-en.yml (Russian) 2024-11-25 21:08:54 +01:00
Maintenancer 8d81db29bc New translations language-en.yml (Spanish) 2024-11-17 23:12:01 +01:00
Maintenancer be4b808986 New translations language-en.yml (Russian) 2024-11-08 17:47:19 +01:00
Maintenancer 96f0c5987b New translations language-en.yml (French) 2024-10-15 20:21:52 +02:00
Maintenancer 7d16a5ad76 New translations language-en.yml (Chinese Traditional) 2024-10-15 20:21:51 +02:00
Maintenancer 62ad2b899e New translations language-en.yml (Chinese Traditional) 2024-10-15 17:14:21 +02:00
Maintenancer cf22a35baa New translations language-en.yml (Polish) 2024-10-11 21:50:54 +02:00
Maintenancer e339c1b198 New translations language-en.yml (Vietnamese) 2024-10-04 17:32:48 +02:00
Maintenancer 567ac981d0 New translations language-en.yml (Chinese Simplified) 2024-10-02 10:08:47 +02:00
Maintenancer 5283737e5a New translations language-en.yml (Chinese Simplified) 2024-10-02 06:50:25 +02:00
Maintenancer 51532294c1 New translations language-en.yml (Italian) 2024-10-01 21:07:09 +02:00
Maintenancer 10c661e849 New Crowdin updates (#138) 2024-09-15 11:49:45 +02:00
Maintenancer 695f3872a0 New Crowdin updates (#133) 2024-09-13 17:39:34 +02:00
Nassim Jahnke 05af3d3db2 Accept time durations in timer commands
Closes #134
2024-09-13 17:36:13 +02:00
Nassim Jahnke f9396fa369 Put ping, player count, and player list hover messages into sections 2024-09-13 16:20:02 +02:00
Nassim Jahnke ddc43fb1eb Fix dummy sample player profiles on 1.21 Paper 2024-09-13 15:00:50 +02:00
Nassim Jahnke 5c51dd86b6 Add timer-specific player count and player sample messages
Closes #131
2024-09-13 14:50:17 +02:00
Nassim Jahnke dcb5f64449 Don't send broadcasts to the console twice
Fixes #129
2024-09-13 14:15:28 +02:00
Nassim Jahnke c0b991932c Remove all leftover legacy chat usage 2024-09-13 13:23:18 +02:00
Nassim Jahnke 3b9ef8b006 Clear sample players in Velocity ping listener 2024-09-13 12:47:05 +02:00
Nassim Jahnke c73e18acf1 Upgrade Gradle wrapper 2024-09-13 12:45:42 +02:00
Maintenancer 55576dce4a New Crowdin updates (#124)
* New translations language-en.yml (Vietnamese)

* New translations language-en.yml (French)

* New translations language-en.yml (Russian)

* New translations language-en.yml (Hungarian)

* New translations language-en.yml (Spanish)

* New translations language-en.yml (German)
2024-08-29 13:37:28 +02:00
Nassim Jahnke aa1c77c230 Update actions 2024-08-27 22:01:30 +02:00
Nassim Jahnke 72b5f38e63 Default to empty list if fallback field is missing/null 2024-08-27 21:51:09 +02:00
Nassim Jahnke 3e8cc06aa7 Don't log color codes, more message cleanups 2024-08-27 12:06:21 +02:00
Nassim Jahnke 0f375adce6 Rename Paper module, replace dump and update message sending with adventure components 2024-08-26 22:56:07 +02:00
Nassim Jahnke 9c5e8182cc Fix maintenance dump command 2024-08-26 22:18:39 +02:00
Nassim Jahnke 1b94594fc1 Update dependencies 2024-08-26 22:12:21 +02:00
Nassim Jahnke 67bdc8261a Update shadow 2024-08-08 10:05:44 +02:00
Nassim Jahnke e255529f78 Update Hangar latest release endpoint 2024-07-31 18:14:01 +02:00
Maintenancer 5b7ab9fe42 New Crowdin updates (#121)
* New translations language-en.yml (Portuguese)

* New translations language-en.yml (Spanish)

* New translations language-en.yml (Italian)

* New translations language-en.yml (English)

* Update source file language-en.yml

* New translations language-en.yml (Vietnamese)
2024-06-13 16:33:37 +02:00
Nassim Jahnke cfa30cea79 Bump version to 4.2.2-SNAPSHOT 2024-06-13 16:32:30 +02:00
Nassim Jahnke c59b784e48 Update Gradle wrapper 2024-06-01 17:10:15 +02:00
Nassim Jahnke 864fee66fa 4.2.1 Release 2024-05-17 15:39:28 +02:00
Maintenancer 3c810d7ed3 New Crowdin updates (#120)
* New translations language-en.yml (Chinese Simplified)

* New translations language-en.yml (Russian)
2024-05-17 15:25:26 +02:00
Maintenancer e24806694e New Crowdin updates (#119) 2024-04-30 00:10:43 +02:00
Nassim Jahnke fa7effe8f3 Add paperweight-mappings-namespace attribute 2024-04-28 03:53:56 +02:00
EpicPlayerA10 26802cbe1a Offline player fetching improvements (#117) 2024-03-24 18:40:20 +01:00
Alec Jensen 1cb35abccb Show proxied maintenance status in ping for forced hosts (#118) 2024-03-24 10:57:56 +01:00
Nassim Jahnke 1f2d0bba2a Update Gradle wrapper 2024-03-24 10:30:34 +01:00
Maintenancer a7e577554c New Crowdin updates (#114)
* New translations language-en.yml (Russian)

* New translations language-en.yml (Chinese Simplified)
2024-03-02 20:35:26 +01:00
Maintenancer c0b3ea22b9 New Crowdin updates (#113) 2024-02-04 17:25:28 +01:00
Maintenancer 0adf767b5e New translations language-en.yml (French) by Kertie2_ (#112) 2024-01-14 17:45:55 +01:00
Maintenancer 3cc21504f0 New Crowdin updates (#110)
* New translations language-en.yml (Italian)

* New translations language-en.yml (Hungarian)

* New translations language-en.yml (Chinese Simplified)

* New translations language-en.yml (Spanish)

* New translations language-en.yml (Turkish)

* New translations language-en.yml (German)

* New translations language-en.yml (Russian)
2024-01-14 17:39:41 +01:00
Nassim Jahnke cdebac351f Update copyright headers 2024-01-01 21:45:25 +01:00
Nassim Jahnke 8941b55362 Don't keep converting player count and count hover messages 2024-01-01 21:44:08 +01:00
Nassim Jahnke fa225ad5f0 Bump version to 4.2.1-SNAPSHOT 2023-12-31 16:26:22 +01:00
Nassim Jahnke dea7fc9032 Update Gradle wrapper 2023-12-13 22:47:27 +01:00
151 changed files with 1350 additions and 1047 deletions

No files matched your search

+30 -1
View File
@@ -1,6 +1,35 @@
# 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.3.0 - September 17th 2024
## Unreleased
### Changed
* Added alternative player count and player list hover message for when endtimers are running, similar to the existing ping messages setting. They are disabled by default and can be found in their `player-count-message` and `player-list-hover-message` config sections
* All timer commands now accept durations like `2h30m`, `1h30m5s`, or `90s`. The default behavior without units will still be in minutes
* The language defaults will not automatically update, you might want to manually update the command help strings or just delete your language file
* Slightly reorganized the configuration file (it will be automatically migrated on startup, but new sections will be slapped at the bottom of the file)
* The `fallback` field now also null values next to an empty array for disabling the feature
* Updated language files from [Crowdin](https://crowdin.com/translate/maintenance)
### Fixed
* Fixed the `/maintenance dump` command
* Fixed the original player sample not being cleared in Velocity
* Velocity: Fixed the console getting broadcasts twice
* Velocity: Don't log legacy color codes to the console
* Paper: Fixed the player count messages on Paper 1.21
---
## 4.2.1 - May 17th 2024
### Changed
* The proxied maintenance status is now also shown for forced hosts (thanks to alec-jensen)
* Offline player fetching improvements (thanks to EpicPlayerA10)
* Added the setting `fallback-to-offline-uuid` to use offline player uuids in maintenance whitelist commands (defaults to false)
* Maintenance now skips the plugin remapping process on 1.20.5+ Paper servers
* Small optimizations
* Updated language files from [Crowdin](https://crowdin.com/translate/maintenance)
* Massive thank you to all the contributors! These include: vortix22, xdalul, CodeZhangBorui, jesusskye, Doc94,
Texider_, marvin2k0, leonard.bausenwein, pro.timeo.kerjean, meviper, troev5, Murka124, jhqwqmc, Pryzinho,
raysetratyboy, Kolja07, and rikunightcore
---
## 4.2.0 - September 17th 2023
### Changed
@@ -91,7 +120,7 @@ This file contains update logs for this project. The top may contain a `Unreleas
* Bungee/Velocity: Added language fields to choose custom kickmessages for individual proxied servers
* See [**HERE**](https://github.com/KennyTV/Maintenance/wiki/Configuration#language-file) for an example setting
* Added Chinese language file (thanks to Spigot user yeban)
* Added Italian language file (thanks to @TheViperShow)
* Added Italian language file
* Updated Russian language file (thanks to Spigot user En_0t_S)
* Removed automated config migration from 2.x->3.0
* See [**HERE**](https://github.com/KennyTV/Maintenance/wiki/Updates#updating-from-2x) on how to do that manually - virtually noone should be using such old versions anymore
+1 -1
View File
@@ -8,7 +8,7 @@ about: Report a bug to have it fixed
**How does the problem occur/what are the steps to reproduce it?**
## Error
**Is there an error? Save it via https://pastebin.com/ and link paste the link.**
**Is there an error? Save it via https://mclo.gs/ and link paste the link.**
## Server information
**Type '/maintenance dump' and paste the given link here**
+6 -6
View File
@@ -7,20 +7,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: 'temurin'
- name: Build with Gradle
run: ./gradlew build
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Maintenance Files
path: build/libs
+1 -1
View File
@@ -4,7 +4,7 @@
[![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)
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.
Maintenance is the most customizable free maintenance plugin for your Minecraft server you can find. It runs on Paper (also Spigot, but with limited functionality), BungeeCord, Sponge, as well as Velocity.
Its features include:
* A custom motd as well as server icon, that will be shown during maintenance
+1 -1
View File
@@ -1,5 +1,5 @@
plugins {
id("com.github.johnrengelman.shadow")
id("com.gradleup.shadow")
}
// Shade and relocate adventure in an extra module, so that common/the rest can directly depend on a
@@ -1,5 +1,5 @@
plugins {
id("com.github.johnrengelman.shadow")
id("com.gradleup.shadow")
}
tasks {
@@ -1,5 +1,5 @@
plugins {
id("com.github.johnrengelman.shadow")
id("com.gradleup.shadow")
}
tasks {
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
+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("com.github.johnrengelman", "shadow", "8.1.1")
implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.0")
}
@@ -4,7 +4,7 @@ import org.gradle.kotlin.dsl.named
plugins {
id("maintenance.base-conventions")
id("com.github.johnrengelman.shadow")
id("com.gradleup.shadow")
}
tasks {
+1 -1
View File
@@ -12,7 +12,7 @@ allprojects {
}
val platforms = setOf(
projects.maintenanceSpigot,
projects.maintenancePaper,
projects.maintenanceBungee,
projects.maintenanceSponge,
projects.maintenanceVelocity
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -38,22 +38,6 @@ import eu.kennytv.maintenance.core.util.ServerType;
import eu.kennytv.maintenance.core.util.Task;
import eu.kennytv.maintenance.lib.kyori.adventure.platform.bungeecord.BungeeAudiences;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.Favicon;
import net.md_5.bungee.api.ProxyServer;
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 net.md_5.bungee.api.chat.hover.content.Text;
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;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -61,10 +45,20 @@ import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
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.CommandSender;
import net.md_5.bungee.api.Favicon;
import net.md_5.bungee.api.ProxyServer;
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;
public final class MaintenanceBungeePlugin extends MaintenanceProxyPlugin {
private final MaintenanceBungeeBase plugin;
@@ -108,18 +102,6 @@ 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: §6" + HANGAR_URL));
final TextComponent click = new TextComponent(TextComponent.fromLegacyText(" §7§l§o(CLICK ME)"));
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);
((BungeeSenderInfo) sender).sendMessage(tc1);
}
public boolean isMaintenance(final ServerInfo serverInfo) {
return settingsProxy.isMaintenance(serverInfo.getName());
}
@@ -176,28 +158,26 @@ public final class MaintenanceBungeePlugin extends MaintenanceProxyPlugin {
}
@Override
public void getOfflinePlayer(final String name, final Consumer<@Nullable SenderInfo> consumer) {
public CompletableFuture<@Nullable SenderInfo> getOfflinePlayer(final String name) {
final ProxiedPlayer player = getProxy().getPlayer(name);
if (player != null) {
consumer.accept(new BungeeSenderInfo(player));
return;
return CompletableFuture.completedFuture(new BungeeSenderInfo(player));
}
getProxy().getScheduler().runAsync(plugin, () -> {
return CompletableFuture.supplyAsync(() -> {
try {
final ProfileLookup profile = doUUIDLookup(name);
consumer.accept(new ProxyOfflineSenderInfo(profile.getUuid(), profile.getName()));
} catch (final IOException e) {
e.printStackTrace();
consumer.accept(null);
return new ProxyOfflineSenderInfo(profile.getUuid(), profile.getName());
} catch (IOException e) {
throw new RuntimeException(e);
}
});
}
@Override
public void getOfflinePlayer(final UUID uuid, final Consumer<@Nullable SenderInfo> consumer) {
public CompletableFuture<@Nullable SenderInfo> getOfflinePlayer(final UUID uuid) {
final ProxiedPlayer player = getProxy().getPlayer(uuid);
consumer.accept(player != null ? new BungeeSenderInfo(player) : null);
return CompletableFuture.completedFuture(player != null ? new BungeeSenderInfo(player) : null);
}
@Override
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -18,19 +18,13 @@
package eu.kennytv.maintenance.bungee.command;
import eu.kennytv.maintenance.bungee.MaintenanceBungeePlugin;
import eu.kennytv.maintenance.bungee.util.BungeeSenderInfo;
import eu.kennytv.maintenance.core.proxy.SettingsProxy;
import eu.kennytv.maintenance.core.proxy.command.MaintenanceProxyCommand;
import eu.kennytv.maintenance.core.util.SenderInfo;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public final class MaintenanceBungeeCommand extends MaintenanceProxyCommand {
private final MaintenanceBungeePlugin plugin;
@@ -41,15 +35,6 @@ public final class MaintenanceBungeeCommand extends MaintenanceProxyCommand {
registerCommands();
}
@Override
protected void sendUpdateMessage(final SenderInfo sender) {
final TextComponent tc = new TextComponent("§6× §8[§aUpdate§8]");
tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/maintenance forceupdate"));
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§aClick here to update the plugin")));
tc.addExtra(" §8< §7Or use the command §c/maintenance forceupdate");
((BungeeSenderInfo) sender).sendMessage(tc);
}
@Override
public List<String> getServersCompletion(final String s) {
final List<String> list = new ArrayList<>();
@@ -62,15 +47,6 @@ public final class MaintenanceBungeeCommand extends MaintenanceProxyCommand {
return list;
}
@Override
public void sendDumpMessage(final SenderInfo sender, final String url) {
final BungeeSenderInfo bungeeSender = ((BungeeSenderInfo) sender);
final TextComponent clickText = new TextComponent(plugin.getPrefix() + "§7Click here to copy the link");
clickText.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, url));
clickText.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§aClick here to copy the link")));
bungeeSender.sendMessage(clickText);
}
@Override
public List<String> getPlayersCompletion() {
final List<String> list = new ArrayList<>();
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -42,7 +42,7 @@ public final class ProxyPingListener implements Listener {
final ServerPing ping = event.getResponse();
if (settings.hasCustomPlayerCountMessage()) {
ping.setVersion(new ServerPing.Protocol(settings.getPlayerCountMessage(), 1));
ping.setVersion(new ServerPing.Protocol(settings.getLegacyParsedPlayerCountMessage(), 1));
}
if (settings.isEnablePingMessages()) {
@@ -56,7 +56,7 @@ public final class ProxyPingListener implements Listener {
ping.setPlayers(players);
}
final String[] lines = settings.getPlayerCountHoverLines();
final String[] lines = settings.getLegacyParsedPlayerCountHoverLines();
final ServerPing.PlayerInfo[] samplePlayers = new ServerPing.PlayerInfo[lines.length];
for (int i = 0; i < lines.length; i++) {
samplePlayers[i] = new ServerPing.PlayerInfo(lines[i], "");
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -51,12 +51,6 @@ public final class BungeeSenderInfo implements ProxySenderInfo {
return sender.hasPermission(permission);
}
@Override
@Deprecated
public void sendMessage(final String message) {
sender.sendMessage(message);
}
@Override
public void send(final Component component) {
((MaintenanceBungeePlugin) MaintenanceProvider.get()).audiences().sender(sender).sendMessage(component);
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -28,16 +28,17 @@ import eu.kennytv.maintenance.core.proxy.runnable.SingleMaintenanceRunnable;
import eu.kennytv.maintenance.core.proxy.runnable.SingleMaintenanceScheduleRunnable;
import eu.kennytv.maintenance.core.proxy.util.ProfileLookup;
import eu.kennytv.maintenance.core.runnable.MaintenanceRunnableBase;
import eu.kennytv.maintenance.core.util.RateLimitedException;
import eu.kennytv.maintenance.core.util.SenderInfo;
import eu.kennytv.maintenance.core.util.ServerType;
import eu.kennytv.maintenance.core.util.Task;
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.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -45,7 +46,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import org.jetbrains.annotations.Blocking;
import org.jetbrains.annotations.Nullable;
/**
* @author kennytv
@@ -143,15 +145,15 @@ public abstract class MaintenanceProxyPlugin extends MaintenancePlugin implement
}
}
public MaintenanceRunnableBase startSingleMaintenanceRunnable(final Server server, final long duration, final TimeUnit unit, final boolean enable) {
final MaintenanceRunnableBase runnable = new SingleMaintenanceRunnable(this, settingsProxy, (int) unit.toSeconds(duration), enable, server);
public MaintenanceRunnableBase startSingleMaintenanceRunnable(final Server server, final Duration duration, final boolean enable) {
final MaintenanceRunnableBase runnable = new SingleMaintenanceRunnable(this, settingsProxy, (int) duration.getSeconds(), enable, server);
serverTasks.put(server.getName(), runnable.getTask());
return runnable;
}
public MaintenanceRunnableBase scheduleSingleMaintenanceRunnable(final Server server, final long duration, final long maintenanceDuration, final TimeUnit unit) {
public MaintenanceRunnableBase scheduleSingleMaintenanceRunnable(final Server server, final Duration enableIn, final Duration maintenanceDuration) {
final MaintenanceRunnableBase runnable = new SingleMaintenanceScheduleRunnable(this, settingsProxy,
(int) unit.toSeconds(duration), (int) unit.toSeconds(maintenanceDuration), server);
(int) enableIn.getSeconds(), (int) maintenanceDuration.getSeconds(), server);
serverTasks.put(server.getName(), runnable.getTask());
return runnable;
}
@@ -187,9 +189,66 @@ public abstract class MaintenanceProxyPlugin extends MaintenancePlugin implement
kickPlayersFromProxy();
}
@Blocking
@Nullable
protected ProfileLookup doUUIDLookup(final String name) throws IOException {
ProfileLookup profileLookup;
try {
profileLookup = doUUIDLookupMojangAPI(name);
} catch (RateLimitedException e) {
// Use fallback API if rate limit is reached
profileLookup = doUUIDLookupAshconAPI(name);
}
if (settingsProxy.isFallbackToOfflineUUID() && profileLookup == null) {
// Use offline uuid
return new ProfileLookup(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(StandardCharsets.UTF_8)), name);
}
return profileLookup;
}
/**
* Official Mojang API
*/
@Nullable
private ProfileLookup doUUIDLookupMojangAPI(final String name) throws IOException {
final URL url = new URL("https://api.mojang.com/users/profiles/minecraft/" + name);
final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
int status = connection.getResponseCode();
if (status == 429) {
throw new RateLimitedException();
}
if (status == 404) {
// Return null if profile not found
return null;
}
try (final InputStream in = connection.getInputStream()) {
final String output = CharStreams.toString(new InputStreamReader(in));
final JsonObject json = GSON.fromJson(output, JsonObject.class);
final UUID uuid = fromStringUUIDWithoutDashes(json.getAsJsonPrimitive("id").getAsString());
final String username = json.getAsJsonPrimitive("name").getAsString();
return new ProfileLookup(uuid, username);
}
}
/**
* Fallback API (Ashcon API)
*/
@Nullable
private ProfileLookup doUUIDLookupAshconAPI(final String name) throws IOException {
final URL url = new URL("https://api.ashcon.app/mojang/v2/user/" + name);
final URLConnection connection = url.openConnection();
final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
if (connection.getResponseCode() == 403) {
// Return null if profile not found
return null;
}
try (final InputStream in = connection.getInputStream()) {
final String output = CharStreams.toString(new InputStreamReader(in));
final JsonObject json = GSON.fromJson(output, JsonObject.class);
@@ -200,6 +259,14 @@ public abstract class MaintenanceProxyPlugin extends MaintenancePlugin implement
}
}
private UUID fromStringUUIDWithoutDashes(String undashedUUID) {
return UUID.fromString(
undashedUUID.substring(0, 8) + "-" + undashedUUID.substring(8, 12) + "-" +
undashedUUID.substring(12, 16) + "-" + undashedUUID.substring(16, 20) + "-" +
undashedUUID.substring(20, 32)
);
}
public SettingsProxy getSettingsProxy() {
return settingsProxy;
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -39,6 +39,7 @@ public final class SettingsProxy extends Settings {
private Set<String> maintenanceServers;
private List<String> fallbackServers;
private String waitingServer;
private boolean fallbackToOfflineUUID;
private Map<String, List<String>> commandsOnMaintenanceEnable;
private Map<String, List<String>> commandsOnMaintenanceDisable;
@@ -97,12 +98,13 @@ public final class SettingsProxy extends Settings {
}
final Object fallback = config.getObject("fallback");
fallbackServers = fallback instanceof String ? Collections.singletonList((String) fallback) : config.getStringList("fallback");
fallbackServers = fallback instanceof String ? Collections.singletonList((String) fallback) : config.getStringList("fallback", Collections.emptyList());
waitingServer = config.getString("waiting-server", "");
if (waitingServer.isEmpty() || waitingServer.equalsIgnoreCase("none")) {
waitingServer = null;
}
fallbackToOfflineUUID = config.getBoolean("fallback-to-offline-uuid", false);
commandsOnMaintenanceEnable = new HashMap<>();
final ConfigSection enableCommandsSection = config.getSection("commands-on-single-maintenance-enable");
@@ -279,6 +281,10 @@ public final class SettingsProxy extends Settings {
return waitingServer;
}
public boolean isFallbackToOfflineUUID() {
return fallbackToOfflineUUID;
}
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));
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -22,9 +22,9 @@ 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.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
public final class SingleEndtimerCommand extends ProxyCommandInfo {
@@ -41,7 +41,9 @@ public final class SingleEndtimerCommand extends ProxyCommandInfo {
public void execute(final SenderInfo sender, final String[] args) {
if (args.length == 2) {
if (checkPermission(sender, "timer")) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) {
final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]);
if (duration == null) {
sender.send(getHelpMessage());
return;
}
@@ -50,11 +52,13 @@ public final class SingleEndtimerCommand extends ProxyCommandInfo {
return;
}
plugin.startMaintenanceRunnable(Integer.parseInt(args[1]), TimeUnit.MINUTES, false);
plugin.startMaintenanceRunnable(duration, false);
sender.send(getMessage("endtimerStarted", "%TIME%", plugin.getRunnable().getTime()));
} else if (args.length == 3) {
if (checkPermission(sender, "singleserver.timer")) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) {
final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false);
if (duration == null) {
sender.send(getHelpMessage());
return;
}
@@ -66,7 +70,7 @@ public final class SingleEndtimerCommand extends ProxyCommandInfo {
return;
}
final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), TimeUnit.MINUTES, false);
final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, duration, false);
sender.send(getMessage(
"singleEndtimerStarted",
"%TIME%", runnable.getTime(),
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -22,9 +22,9 @@ 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.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
public final class SingleScheduleTimerCommand extends ProxyCommandInfo {
@@ -41,8 +41,10 @@ public final class SingleScheduleTimerCommand extends ProxyCommandInfo {
public void execute(final SenderInfo sender, final String[] args) {
if (args.length == 3) {
if (checkPermission(sender, "timer")) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])
|| plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) {
final Duration enableIn = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]);
final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false);
if (enableIn == null || duration == null) {
sender.send(getHelpMessage());
return;
}
@@ -51,17 +53,18 @@ public final class SingleScheduleTimerCommand extends ProxyCommandInfo {
return;
}
final int duration = Integer.parseInt(args[2]);
plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), duration, TimeUnit.MINUTES);
plugin.scheduleMaintenanceRunnable(duration, enableIn);
sender.send(getMessage(
"scheduletimerStarted",
"%TIME%", plugin.getRunnable().getTime(),
"%DURATION%", plugin.getFormattedTime(duration * 60)
"%DURATION%", plugin.getFormattedTime((int) duration.getSeconds())
));
} else if (args.length == 4) {
if (checkPermission(sender, "singleserver.timer")) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false)
|| plugin.getCommandManager().checkTimerArgs(sender, args[3], false)) {
final Duration enableIn = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false);
final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[3], false);
if (enableIn == null || duration == null) {
sender.send(getHelpMessage());
return;
}
@@ -73,12 +76,11 @@ public final class SingleScheduleTimerCommand extends ProxyCommandInfo {
return;
}
final int duration = Integer.parseInt(args[3]);
final MaintenanceRunnableBase runnable = plugin.scheduleSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), duration, TimeUnit.MINUTES);
final MaintenanceRunnableBase runnable = plugin.scheduleSingleMaintenanceRunnable(server, enableIn, duration);
sender.send(getMessage(
"singleScheduletimerStarted",
"%TIME%", runnable.getTime(),
"%DURATION%", plugin.getFormattedTime(duration * 60),
"%DURATION%", plugin.getFormattedTime((int) duration.getSeconds()),
"%SERVER%", server.getName()
));
} else {
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -22,9 +22,9 @@ 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.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
public final class SingleStarttimerCommand extends ProxyCommandInfo {
@@ -41,7 +41,9 @@ public final class SingleStarttimerCommand extends ProxyCommandInfo {
public void execute(final SenderInfo sender, final String[] args) {
if (args.length == 2) {
if (checkPermission(sender, "timer")) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) {
final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]);
if (duration == null) {
sender.send(getHelpMessage());
return;
}
@@ -50,11 +52,13 @@ public final class SingleStarttimerCommand extends ProxyCommandInfo {
return;
}
plugin.startMaintenanceRunnable(Integer.parseInt(args[1]), TimeUnit.MINUTES, true);
plugin.startMaintenanceRunnable(duration, true);
sender.send(getMessage("starttimerStarted", "%TIME%", plugin.getRunnable().getTime()));
} else if (args.length == 3) {
if (checkPermission(sender, "singleserver.timer")) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) {
final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false);
if (duration == null) {
sender.send(getHelpMessage());
return;
}
@@ -66,7 +70,7 @@ public final class SingleStarttimerCommand extends ProxyCommandInfo {
return;
}
final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), TimeUnit.MINUTES, true);
final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, duration, true);
sender.send(getMessage(
"singleStarttimerStarted",
"%TIME%", runnable.getTime(),
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -22,27 +22,26 @@ import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.core.proxy.MaintenanceProxyPlugin;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import java.util.concurrent.TimeUnit;
import java.time.Duration;
public final class SingleMaintenanceScheduleRunnable extends SingleMaintenanceRunnable {
private final int maintenanceDuration;
private final int maintenanceDurationSeconds;
public SingleMaintenanceScheduleRunnable(final MaintenancePlugin plugin, final Settings settings, final int seconds, final int maintenanceDuration, final Server server) {
super(plugin, settings, seconds, true, server);
this.maintenanceDuration = maintenanceDuration;
this.maintenanceDurationSeconds = maintenanceDuration;
}
@Override
protected void finish() {
super.finish();
((MaintenanceProxyPlugin) plugin).startSingleMaintenanceRunnable(server, maintenanceDuration, TimeUnit.SECONDS, false);
((MaintenanceProxyPlugin) plugin).startSingleMaintenanceRunnable(server, Duration.ofSeconds(maintenanceDurationSeconds), false);
}
@Override
protected Component getStartMessage() {
return settings.getMessage("singleScheduletimerBroadcast",
"%SERVER%", server.getName(),
"%TIME%", getTime(), "%DURATION%", plugin.getFormattedTime(maintenanceDuration));
"%TIME%", getTime(), "%DURATION%", plugin.getFormattedTime(maintenanceDurationSeconds));
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -55,11 +55,6 @@ public final class ProxyOfflineSenderInfo implements ProxySenderInfo {
return false;
}
@Override
@Deprecated
public void sendMessage(final String message) {
}
@Override
public void send(final Component component) {
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -37,8 +37,7 @@ import eu.kennytv.maintenance.core.util.ServerType;
import eu.kennytv.maintenance.core.util.Task;
import eu.kennytv.maintenance.core.util.Version;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import org.jetbrains.annotations.Nullable;
import eu.kennytv.maintenance.lib.kyori.adventure.text.format.NamedTextColor;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
@@ -54,24 +53,28 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Duration;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import org.jetbrains.annotations.Nullable;
public abstract class MaintenancePlugin implements Maintenance {
public static final Gson GSON = new GsonBuilder().create();
public static final String HANGAR_URL = "https://hangar.papermc.io/kennytv/Maintenance";
protected final eu.kennytv.maintenance.core.event.EventManager eventManager;
private static final Pattern INT_PATTERN = Pattern.compile("[0-9]+");
protected final EventManager eventManager;
protected final Version version;
protected Settings settings;
protected ServerListPlusHook serverListPlusHook;
protected MaintenanceRunnable runnable;
protected MaintenanceCommand commandManager;
private final String prefix;
private final Component prefix;
private final ServerType serverType;
private Version newestVersion;
private boolean debug;
@@ -79,7 +82,12 @@ public abstract class MaintenancePlugin implements Maintenance {
protected MaintenancePlugin(final String version, final ServerType serverType) {
this.version = new Version(version);
this.serverType = serverType;
this.prefix = "§8[§eMaintenance" + serverType + "§8] ";
this.prefix = Component.text()
.append(Component.text().content("[").color(NamedTextColor.DARK_GRAY))
.append(Component.text().content("Maintenance").color(NamedTextColor.YELLOW))
.append(Component.text().content("]").color(NamedTextColor.DARK_GRAY))
.append(Component.text(" "))
.build();
this.eventManager = new eu.kennytv.maintenance.core.event.EventManager();
MaintenanceProvider.setMaintenance(this);
}
@@ -98,8 +106,7 @@ public abstract class MaintenancePlugin implements Maintenance {
try {
executeConsoleCommand(command);
} catch (final Exception e) {
getLogger().severe("Error while executing extra maintenance " + (maintenance ? "enable" : "disable") + " command: " + command);
e.printStackTrace();
getLogger().log(Level.SEVERE, "Error while executing extra maintenance " + (maintenance ? "enable" : "disable") + " command: " + command, e);
}
}
}
@@ -167,16 +174,16 @@ public abstract class MaintenancePlugin implements Maintenance {
builder.append(time).append(' ').append(settings.language.getString(time == 1 ? timeUnit : timeUnit + "s"));
}
public void startMaintenanceRunnable(final long duration, final TimeUnit unit, final boolean enable) {
runnable = new MaintenanceRunnable(this, settings, (int) unit.toSeconds(duration), enable);
public void startMaintenanceRunnable(final Duration duration, final boolean enable) {
runnable = new MaintenanceRunnable(this, settings, (int) duration.getSeconds(), enable);
// Save the endtimer to be able to continue it after a server stop
if (settings.isSaveEndtimerOnStop() && !runnable.shouldEnable()) {
settings.setSavedEndtimer(System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(runnable.getSecondsLeft()));
}
}
public void scheduleMaintenanceRunnable(final long duration, final int maintenanceDuration, final TimeUnit unit) {
runnable = new MaintenanceScheduleRunnable(this, settings, (int) unit.toSeconds(duration), (int) unit.toSeconds(maintenanceDuration));
public void scheduleMaintenanceRunnable(final Duration enableIn, final Duration maintenanceDuration) {
runnable = new MaintenanceScheduleRunnable(this, settings, (int) enableIn.getSeconds(), (int) maintenanceDuration.getSeconds());
}
public boolean updateAvailable() {
@@ -202,7 +209,7 @@ public abstract class MaintenancePlugin implements Maintenance {
setMaintenance(false);
settings.setSavedEndtimer(0);
} else {
startMaintenanceRunnable(settings.getSavedEndtimer() - current, TimeUnit.MILLISECONDS, false);
startMaintenanceRunnable(Duration.ofMillis(settings.getSavedEndtimer() - current), false);
getLogger().info("The timer has been continued - maintenance will be disabled in: " + getTimerMessage());
}
}
@@ -218,13 +225,12 @@ public abstract class MaintenancePlugin implements Maintenance {
final int compare = version.compareTo(newestVersion);
if (compare < 0) {
//TODO mmmmmmmm legacy chat
getLogger().info("§cNewest version available: §aVersion " + newestVersion + "§c, you're on §a" + version);
getLogger().warning("Newest version available: Version " + newestVersion + ", you're on " + version);
} 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)");
getLogger().info("You'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 {
getLogger().info("§cYou're running a version, that doesn't exist! §cN§ai§dc§ee§5!");
getLogger().info("You're running a version, that doesn't exist!");
}
}
});
@@ -267,7 +273,7 @@ public abstract class MaintenancePlugin implements Maintenance {
}
private void checkNewestVersion() throws Exception {
final URLConnection connection = new URL("https://hangar.papermc.io/api/v1/projects/kennytv/Maintenance/latestrelease").openConnection();
final URLConnection connection = new URL("https://hangar.papermc.io/api/v1/projects/Maintenance/latestrelease").openConnection();
connection.setRequestProperty("User-Agent", "Maintenance/" + getVersion());
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
final String newVersionString = reader.readLine();
@@ -281,7 +287,7 @@ public abstract class MaintenancePlugin implements Maintenance {
public String pasteDump() {
final MaintenanceDump dump = new MaintenanceDump(this, settings);
try {
final HttpURLConnection connection = (HttpURLConnection) new URL("https://hastebin.com/documents").openConnection();
final HttpURLConnection connection = (HttpURLConnection) new URL("https://api.pastes.dev/post").openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty("User-Agent", "Maintenance/" + getVersion());
@@ -292,7 +298,7 @@ public abstract class MaintenancePlugin implements Maintenance {
}
if (connection.getResponseCode() == 503) {
getLogger().warning("Could not paste dump, hastebin.com down?");
getLogger().warning("Could not paste dump, pastes.dev down?");
return null;
}
@@ -307,8 +313,7 @@ public abstract class MaintenancePlugin implements Maintenance {
return jsonOutput.get("key").getAsString();
}
} catch (final IOException e) {
getLogger().log(Level.WARNING, "Could not paste dump :(");
e.printStackTrace();
getLogger().log(Level.WARNING, "Could not paste dump :(", e);
return null;
}
}
@@ -356,7 +361,7 @@ public abstract class MaintenancePlugin implements Maintenance {
}
public boolean isNumeric(final String string) {
return string.matches("[0-9]+");
return INT_PATTERN.matcher(string).matches();
}
@Override
@@ -407,7 +412,7 @@ public abstract class MaintenancePlugin implements Maintenance {
return newestVersion;
}
public String getPrefix() {
public Component prefix() {
return prefix;
}
@@ -437,8 +442,6 @@ public abstract class MaintenancePlugin implements Maintenance {
public abstract void broadcast(Component component);
public abstract void sendUpdateNotification(SenderInfo sender);
public abstract Task startMaintenanceRunnable(Runnable runnable);
/**
@@ -447,9 +450,9 @@ public abstract class MaintenancePlugin implements Maintenance {
*
* @param name name of the player
*/
public abstract void getOfflinePlayer(String name, Consumer<@Nullable SenderInfo> consumer);
public abstract CompletableFuture<@Nullable SenderInfo> getOfflinePlayer(String name);
public abstract void getOfflinePlayer(UUID uuid, Consumer<@Nullable SenderInfo> consumer);
public abstract CompletableFuture<@Nullable SenderInfo> getOfflinePlayer(UUID uuid);
public abstract File getDataFolder();
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -25,18 +25,25 @@ 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.minimessage.MiniMessage;
import eu.kennytv.maintenance.lib.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.*;
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.logging.Level;
import org.jetbrains.annotations.Nullable;
public class Settings implements eu.kennytv.maintenance.api.Settings {
public static final String NEW_LINE_REPLACEMENT = "<br>";
private static final int CONFIG_VERSION = 7;
private static final int LANGUAGE_VERSION = 1;
private static final int CONFIG_VERSION = 9;
private static final int LANGUAGE_VERSION = 2;
private static final Random RANDOM = new Random();
protected final MaintenancePlugin plugin;
private final Map<UUID, String> whitelistedPlayers = new HashMap<>();
@@ -47,8 +54,10 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
private List<String> timerSpecificPingMessages;
private List<String> commandsOnMaintenanceEnable;
private List<String> commandsOnMaintenanceDisable;
private String playerCountMessage;
private List<String> playerCountHoverLines;
private String legacyParsedPlayerCountMessage;
private String legacyParsedTimerPlayerCountMessage;
private List<String> legacyParsedPlayerCountHoverLines;
private List<String> legacyParsedTimerPlayerCountHoverLines;
private String prefixString;
private String languageName;
private boolean enablePingMessages;
@@ -105,8 +114,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
try {
updateLanguageFile();
} catch (final IOException e) {
plugin.getLogger().severe("Couldn't update language file");
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Couldn't update language file", e);
}
prefixString = language.getString("prefix");
@@ -118,7 +126,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
try {
config.save();
} catch (final IOException e) {
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Couldn't save the config file!", e);
}
}
@@ -142,7 +150,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
try {
whitelist.save();
} catch (final IOException e) {
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Couldn't save the whitelisted players file!", e);
}
}
@@ -167,26 +175,49 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
private void loadSettings() {
updateConfig();
enablePingMessages = config.getBoolean("enable-pingmessages", true);
pingMessages = loadPingMessages("pingmessages");
if (config.getBoolean("enable-timerspecific-messages")) {
timerSpecificPingMessages = loadPingMessages("timerspecific-pingmessages");
final ConfigSection pingMessageSection = config.getSection("ping-message");
enablePingMessages = pingMessageSection.getBoolean("enabled", true);
// Can't store this pre-parsed as components because gradients will break replacements
pingMessages = loadPingMessages(pingMessageSection.getStringList("messages"));
if (pingMessageSection.getBoolean("enable-timer-specific-messages")) {
timerSpecificPingMessages = loadPingMessages(pingMessageSection.getStringList("timer-messages"));
} else {
timerSpecificPingMessages = null;
}
maintenance = config.getBoolean("maintenance-enabled");
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"));
// Player count and player list hover messages are only accepted and rendered as legacy chat
if (plugin.getServerType() != ServerType.SPONGE) {
playerCountMessage = getConfigMessage("playercountmessage");
final ConfigSection playerCountMessageSection = config.getSection("player-count-message");
customPlayerCountMessage = playerCountMessageSection.getBoolean("enabled");
legacyParsedPlayerCountMessage = toLegacy(parse(getConfigMessage(playerCountMessageSection, "message")));
if (playerCountMessageSection.getBoolean("enable-timer-specific-message")) {
legacyParsedTimerPlayerCountMessage = toLegacy(parse(getConfigMessage(playerCountMessageSection, "timer-message")));
} else {
legacyParsedTimerPlayerCountMessage = null;
}
}
playerCountHoverLines = new ArrayList<>();
final String playerHoverMessage = config.getString("playercounthovermessage");
Collections.addAll(playerCountHoverLines, playerHoverMessage.split("<br>"));
final ConfigSection listHoverMessageSection = config.getSection("player-list-hover-message");
customPlayerCountHoverMessage = listHoverMessageSection.getBoolean("enabled");
legacyParsedPlayerCountHoverLines = new ArrayList<>();
for (final String line : listHoverMessageSection.getString("message").split("<br>")) {
legacyParsedPlayerCountHoverLines.add(toLegacy(parse(line)));
}
if (listHoverMessageSection.getBoolean("enable-timer-specific-message")) {
legacyParsedTimerPlayerCountHoverLines = new ArrayList<>();
for (final String line : listHoverMessageSection.getString("timer-message").split("<br>")) {
legacyParsedTimerPlayerCountHoverLines.add(toLegacy(parse(line)));
}
} else {
legacyParsedTimerPlayerCountHoverLines = null;
}
languageName = config.getString("language").toLowerCase();
kickOnlinePlayers = config.getBoolean("kick-online-players", true);
@@ -204,9 +235,9 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
whitelistedPlayers.clear();
for (final Map.Entry<String, Object> entry : whitelist.getValues().entrySet()) {
try {
whitelistedPlayers.put(UUID.fromString(entry.getKey()), (String) entry.getValue());
} catch (final Exception e) {
plugin.getLogger().warning("invalid WhitelistedPlayers entry: " + entry.getKey());
whitelistedPlayers.put(UUID.fromString(entry.getKey()), String.valueOf(entry.getValue()));
} catch (final IllegalArgumentException e) {
plugin.getLogger().warning("Invalid WhitelistedPlayers entry: " + entry.getKey());
}
}
@@ -229,8 +260,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
Files.move(oldDir.toPath(), plugin.getDataFolder().toPath());
plugin.getLogger().info("Moved old " + oldDirName + " to new " + plugin.getDataFolder().getName() + " directory!");
} catch (final IOException e) {
plugin.getLogger().severe("Error while copying " + oldDirName + " to new " + plugin.getDataFolder().getName() + " directory!");
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Error while copying " + oldDirName + " to new " + plugin.getDataFolder().getName() + " directory!", e);
}
}
@@ -245,6 +275,18 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
config.set("playercounthovermessage", legacyToMinimessage(config.getString("playercounthovermessage")));
config.set("playercountmessage", legacyToMinimessage(config.getString("playercountmessage")));
}
if (version < 9) {
config.move("enable-pingmessages", "ping-message.enabled");
config.move("pingmessages", "ping-message.messages");
config.move("enable-timerspecific-messages", "ping-message.enable-timer-specific-messages");
config.move("timerspecific-pingmessages", "ping-message.timer-messages");
config.move("enable-playercountmessage", "player-count-message.enabled");
config.move("playercountmessage", "player-count-message.message");
config.move("enable-playercounthovermessage", "player-list-hover-message.enabled");
config.move("playercounthovermessage", "player-list-hover-message.message");
}
createFile("config-new.yml", "config.yml");
final File file = new File(plugin.getDataFolder(), "config-new.yml");
@@ -255,7 +297,8 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
e.printStackTrace();
}
config.addMissingFields(tempConfig.getValues(), tempConfig.getComments());
config.addMissingFields(tempConfig);
config.replaceComments(tempConfig);
config.set("config-version", CONFIG_VERSION);
file.delete();
@@ -298,7 +341,8 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
file.delete();
}
language.addMissingFields(tempConfig.getValues(), tempConfig.getComments());
language.addMissingFields(tempConfig);
language.replaceComments(tempConfig);
tempConfig.clear();
language.set("language-version", LANGUAGE_VERSION);
@@ -314,8 +358,8 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return serialized.replaceAll("</[a-z_]+>", "");
}
public String getConfigMessage(final String path) {
final String s = config.getString(path);
private String getConfigMessage(final ConfigSection section, final String path) {
final String s = section.getString(path);
if (s == null) {
plugin.getLogger().warning("The config file is missing the following string: " + path);
return path;
@@ -323,6 +367,10 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return replaceNewlineVar(s);
}
public String getConfigMessage(final String path) {
return getConfigMessage(config, path);
}
public String getLanguageString(final String path, final String... replacements) {
String s = language.getString(path);
if (s == null) {
@@ -350,6 +398,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return parse(getLanguageString(path, replacements));
}
// TODO Cache platform components if there are no replacements
public Component getRandomPingMessage() {
if (plugin.isTaskRunning() && !plugin.getRunnable().shouldEnable()
&& hasTimerSpecificPingMessages() && !timerSpecificPingMessages.isEmpty()) {
@@ -363,8 +412,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return parse(plugin.replacePingVariables(component));
}
private List<String> loadPingMessages(final String path) {
final List<String> list = config.getStringList(path);
private List<String> loadPingMessages(final List<String> list) {
final List<String> components = new ArrayList<>(list.size());
for (final String s : list) {
components.add(replaceNewlineVar(s));
@@ -496,8 +544,7 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return commandsOnMaintenanceDisable;
}
@Nullable
public List<String> getTimerSpecificPingMessages() {
public @Nullable List<String> getTimerSpecificPingMessages() {
return timerSpecificPingMessages;
}
@@ -505,19 +552,22 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return broadcastIntervals;
}
// Yikeseroo
public String getPlayerCountMessage() {
return LegacyComponentSerializer.legacySection().serialize(parse(plugin.replacePingVariables(playerCountMessage)));
public String getLegacyParsedPlayerCountMessage() {
final String message = timerDependent(legacyParsedPlayerCountMessage, legacyParsedTimerPlayerCountMessage);
return plugin.replacePingVariables(message);
}
// Yikeseroo x2
public String[] getPlayerCountHoverLines() {
final String[] lines = new String[playerCountHoverLines.size()];
for (int i = 0; i < playerCountHoverLines.size(); i++) {
final String component = plugin.replacePingVariables(playerCountHoverLines.get(i));
lines[i] = LegacyComponentSerializer.legacySection().serialize(parse(component));
public String[] getLegacyParsedPlayerCountHoverLines() {
final List<String> lines = timerDependent(legacyParsedPlayerCountHoverLines, legacyParsedTimerPlayerCountHoverLines);
final String[] parsedLines = new String[lines.size()];
for (int i = 0; i < lines.size(); i++) {
parsedLines[i] = plugin.replacePingVariables(lines.get(i));
}
return lines;
return parsedLines;
}
private <T> T timerDependent(final T normal, final @Nullable T timerSpecific) {
return timerSpecific != null && plugin.isTaskRunning() && !plugin.getRunnable().shouldEnable() ? timerSpecific : normal;
}
public Component getKickMessage() {
@@ -540,6 +590,10 @@ public class Settings implements eu.kennytv.maintenance.api.Settings {
return MiniMessage.miniMessage().deserialize(s);
}
protected String toLegacy(final Component component) {
return LegacyComponentSerializer.legacySection().serialize(component);
}
/*
* Note on why this even exists: Yaml will force save all strings containing line breaks '\n' in this rather chunky format:
* key: |-
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -36,13 +36,19 @@ 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 java.time.Duration;
import java.time.format.DateTimeParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.jetbrains.annotations.Nullable;
public abstract class MaintenanceCommand {
private static final long MAX_TASK_DURATION_SECONDS = TimeUnit.DAYS.toSeconds(28);
protected final MaintenancePlugin plugin;
protected final Settings settings;
private final Map<String, CommandInfo> commandExecutors = new LinkedHashMap<>();
@@ -123,29 +129,41 @@ public abstract class MaintenanceCommand {
return info != null && info.hasPermission(sender) ? info.getTabCompletion(sender, args) : Collections.emptyList();
}
public boolean checkTimerArgs(final SenderInfo sender, final String time, final boolean taskCheck) {
if (!plugin.isNumeric(time)) return true;
if (taskCheck) {
if (plugin.isTaskRunning()) {
sender.send(settings.getMessage("timerAlreadyRunning"));
return true;
public @Nullable Duration parseDurationAndCheckTask(final SenderInfo sender, final String time, final boolean taskCheck) {
final Duration duration;
if (plugin.isNumeric(time)) {
// Assume minutes by default as per old command behavior
duration = Duration.ofMinutes(Integer.parseInt(time));
} else {
try {
// Only accept hours, minutes, and seconds
duration = Duration.parse("PT" + time.toUpperCase(Locale.ROOT));
} catch (final DateTimeParseException e) {
return null;
}
}
final int minutes = Integer.parseInt(time);
if (minutes > 40320) {
if (taskCheck) {
if (plugin.isTaskRunning()) {
sender.send(settings.getMessage("timerAlreadyRunning"));
return null;
}
}
final long seconds = duration.getSeconds();
if (seconds > MAX_TASK_DURATION_SECONDS) {
sender.send(settings.getMessage("timerTooLong"));
return true;
return null;
}
if (minutes < 1) {
sender.sendMessage("§8§o[kennytv whispers to you] §7§oThink about running a timer for a negative amount of minutes. Doesn't work §lthat §7§owell.");
return true;
if (seconds < 1) {
sender.sendRich("<i><dark_gray>[kennytv whispers to you] <gray>Think about running a timer for a negative amount of minutes. Doesn't work <b>that</b> <gray>well.");
return null;
}
return false;
return duration;
}
public boolean checkTimerArgs(final SenderInfo sender, final String time) {
return checkTimerArgs(sender, time, true);
public @Nullable Duration parseDurationAndCheckTask(final SenderInfo sender, final String time) {
return parseDurationAndCheckTask(sender, time, true);
}
protected void addToggleAndTimerCommands() {
@@ -157,19 +175,6 @@ public abstract class MaintenanceCommand {
add(new AbortTimerCommand(plugin), "aborttimer", "abort");
}
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());
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!");
}
protected void sendUpdateMessage(final SenderInfo sender) {
sender.sendMessage(plugin.getPrefix() + "§eUse §c§l/maintenance forceupdate §eto update!");
}
public List<String> getServersCompletion(final String s) {
return null;
}
@@ -182,8 +187,6 @@ public abstract class MaintenanceCommand {
return null;
}
public abstract void sendDumpMessage(final SenderInfo sender, final String url);
public List<CommandInfo> getCommands() {
return commands;
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -32,6 +32,6 @@ public final class DebugCommand extends CommandInfo {
if (checkArgs(sender, args, 1)) return;
plugin.setDebug(!plugin.isDebug());
sender.sendMessage("Debug mode is now " + (plugin.isDebug() ? "enabled" : "disabled"));
sender.sendPrefixedRich("<gray>Debug mode is now " + (plugin.isDebug() ? "<green>enabled" : "<red>disabled"));
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -20,7 +20,11 @@ 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.TextComponent;
import eu.kennytv.maintenance.lib.kyori.adventure.text.event.ClickEvent;
import eu.kennytv.maintenance.lib.kyori.adventure.text.event.HoverEvent;
import eu.kennytv.maintenance.lib.kyori.adventure.text.format.NamedTextColor;
import java.util.concurrent.TimeUnit;
public final class DumpCommand extends CommandInfo {
@@ -34,25 +38,29 @@ public final class DumpCommand extends CommandInfo {
public void execute(final SenderInfo sender, final String[] args) {
if (checkArgs(sender, args, 1)) return;
if (System.currentTimeMillis() - lastDump < TimeUnit.MINUTES.toMillis(5)) {
sender.sendMessage(plugin.getPrefix() + "§cYou can only create a dump every 5 minutes!");
sender.sendPrefixedRich("<red>You can only create a dump every 5 minutes!");
return;
}
lastDump = System.currentTimeMillis();
sender.sendMessage(plugin.getPrefix() + "§7The dump is being created, this might take a moment.");
sender.sendPrefixedRich("<gray>The dump is being created, this might take a moment.");
plugin.async(() -> {
final String key = plugin.pasteDump();
if (key == null) {
if (sender.isPlayer()) {
sender.sendMessage(plugin.getPrefix() + "§cCould not paste dump (see the console for details)");
sender.sendPrefixedRich("<red>Could not paste dump (see the console for details)");
}
return;
}
final String url = "https://hastebin.com/" + key;
sender.sendMessage(plugin.getPrefix() + "§c" + url);
final String url = "https://pastes.dev/" + key;
sender.sendPrefixedRich("<red><click:open_url:'" + url + "'>" + url + "</click>");
if (sender.isPlayer()) {
plugin.getCommandManager().sendDumpMessage(sender, url);
final TextComponent text = Component.text().content("Click here to copy the link").color(NamedTextColor.GRAY)
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, url))
.hoverEvent(HoverEvent.showText(Component.text("Click here to copy the link to your clipboard").color(NamedTextColor.GREEN)))
.build();
sender.send(plugin.prefix().append(text));
}
});
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -21,7 +21,7 @@ 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;
import java.time.Duration;
public final class EndtimerCommand extends CommandInfo {
@@ -32,7 +32,9 @@ public final class EndtimerCommand extends CommandInfo {
@Override
public void execute(final SenderInfo sender, final String[] args) {
if (checkArgs(sender, args, 2)) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) {
final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]);
if (duration == null) {
sender.send(getHelpMessage());
return;
}
@@ -41,7 +43,7 @@ public final class EndtimerCommand extends CommandInfo {
return;
}
plugin.startMaintenanceRunnable(Integer.parseInt(args[1]), TimeUnit.MINUTES, false);
plugin.startMaintenanceRunnable(duration, false);
sender.send(getMessage("endtimerStarted", "%TIME%", plugin.getRunnable().getTime()));
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -22,7 +22,6 @@ 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 java.util.ArrayList;
import java.util.List;
@@ -86,7 +85,7 @@ public final class HelpCommand extends CommandInfo {
if (page * COMMANDS_PER_PAGE < commands.size()) {
sender.send(getMessage("helpNextPage", "%PAGE%", Integer.toString(page + 1)));
} else {
sender.sendMessage("§8× §eVersion " + plugin.getVersion() + " §7by §bkennytv");
sender.sendRich("<dark_gray>× <yellow>Version: " + plugin.getVersion() + " <gray>by <aqua>kennytv");
}
sender.send(header);
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -20,6 +20,7 @@ package eu.kennytv.maintenance.core.command.subcommand;
import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.core.command.CommandInfo;
import eu.kennytv.maintenance.core.config.ConfigSection;
import eu.kennytv.maintenance.core.util.SenderInfo;
import java.util.ArrayList;
@@ -51,7 +52,8 @@ public final class RemoveMotdCommand extends CommandInfo {
}
final Settings settings = getSettings();
final List<String> pingMessages = settings.getConfig().getStringList(timerPingMessages ? "timerspecific-pingmessages" : "pingmessages");
final ConfigSection section = settings.getConfig().getSection("ping-message");
final List<String> pingMessages = section.getStringList(timerPingMessages ? "timer-messages" : "messages");
if (pingMessages.size() < 2) {
sender.send(getMessage("removeMotdError"));
return;
@@ -68,7 +70,7 @@ public final class RemoveMotdCommand extends CommandInfo {
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);
section.set(timerPingMessages ? "timer-messages" : "messages", pingMessages);
settings.saveConfig();
sender.send(getMessage("removedMotd", "%INDEX%", args[1]));
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -20,7 +20,7 @@ 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;
import java.time.Duration;
public final class ScheduleTimerCommand extends CommandInfo {
@@ -31,8 +31,10 @@ public final class ScheduleTimerCommand extends CommandInfo {
@Override
public void execute(final SenderInfo sender, final String[] args) {
if (checkArgs(sender, args, 3)) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])
|| plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) {
final Duration enableIn = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]);
final Duration maintenanceDuration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false);
if (enableIn == null || maintenanceDuration == null) {
sender.send(getHelpMessage());
return;
}
@@ -41,12 +43,11 @@ public final class ScheduleTimerCommand extends CommandInfo {
return;
}
final int duration = Integer.parseInt(args[2]);
plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), duration, TimeUnit.MINUTES);
plugin.scheduleMaintenanceRunnable(enableIn, maintenanceDuration);
sender.send(getMessage(
"scheduletimerStarted",
"%TIME%", plugin.getRunnable().getTime(),
"%DURATION%", plugin.getFormattedTime(duration * 60)
"%DURATION%", plugin.getFormattedTime((int) maintenanceDuration.getSeconds())
));
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -20,6 +20,7 @@ package eu.kennytv.maintenance.core.command.subcommand;
import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.core.command.CommandInfo;
import eu.kennytv.maintenance.core.config.ConfigSection;
import eu.kennytv.maintenance.core.util.SenderInfo;
import java.util.ArrayList;
import java.util.Arrays;
@@ -54,7 +55,8 @@ public final class SetMotdCommand extends CommandInfo {
final Settings settings = getSettings();
final List<String> pingComponents = timerPingMessages ? settings.getTimerSpecificPingMessages() : settings.getPingMessages();
final List<String> pingMessages = settings.getConfig().getStringList(timerPingMessages ? "timerspecific-pingmessages" : "pingmessages");
final ConfigSection section = settings.getConfig().getSection("ping-message");
final List<String> pingMessages = section.getStringList(timerPingMessages ? "timer-messages" : "messages");
final int index = Integer.parseInt(args[1]);
if (index == 0 || index > pingMessages.size() + 1) {
sender.send(getMessage("setMotdIndexError",
@@ -95,7 +97,7 @@ public final class SetMotdCommand extends CommandInfo {
pingComponents.set(index - 1, componentString);
}
settings.getConfig().set(timerPingMessages ? "timerspecific-pingmessages" : "pingmessages", pingMessages);
section.set(timerPingMessages ? "timer-messages" : "messages", pingMessages);
settings.saveConfig();
sender.send(settings.getMessage(
"setMotd",
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -21,7 +21,7 @@ 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;
import java.time.Duration;
public final class StarttimerCommand extends CommandInfo {
@@ -32,7 +32,9 @@ public final class StarttimerCommand extends CommandInfo {
@Override
public void execute(final SenderInfo sender, final String[] args) {
if (checkArgs(sender, args, 2)) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) {
final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]);
if (duration == null) {
sender.send(getHelpMessage());
return;
}
@@ -41,7 +43,7 @@ public final class StarttimerCommand extends CommandInfo {
return;
}
plugin.startMaintenanceRunnable(Integer.parseInt(args[1]), TimeUnit.MINUTES, true);
plugin.startMaintenanceRunnable(duration, true);
sender.send(getMessage("starttimerStarted", "%TIME%", plugin.getRunnable().getTime()));
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -20,6 +20,11 @@ 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.event.ClickEvent;
import eu.kennytv.maintenance.lib.kyori.adventure.text.event.HoverEvent;
import eu.kennytv.maintenance.lib.kyori.adventure.text.format.NamedTextColor;
import eu.kennytv.maintenance.lib.kyori.adventure.text.minimessage.MiniMessage;
public final class UpdateCommand extends CommandInfo {
@@ -31,12 +36,12 @@ public final class UpdateCommand extends CommandInfo {
public void execute(final SenderInfo sender, final String[] args) {
if (checkArgs(sender, args, 1)) return;
if (args[0].equalsIgnoreCase("update")) {
plugin.async(() -> plugin.getCommandManager().checkForUpdate(sender));
plugin.async(() -> checkForUpdate(sender));
return;
}
if (!plugin.updateAvailable()) {
sender.sendMessage(plugin.getPrefix() + "§aYou already have the latest version of the plugin!");
sender.sendPrefixedRich("<green>You already have the latest version of the plugin!");
return;
}
@@ -47,9 +52,25 @@ public final class UpdateCommand extends CommandInfo {
} else {
sender.send(getMessage("updateFailed"));
}
} catch (Exception e) {
} catch (final Exception e) {
sender.send(getMessage("updateFailed"));
e.printStackTrace();
}
}
private void checkForUpdate(final SenderInfo sender) {
if (!plugin.updateAvailable()) {
sender.sendPrefixedRich("<green>You already have the latest version of the plugin!");
return;
}
sender.sendPrefixedRich("<red>Newest version available: <green>Version " + plugin.getNewestVersion() + "<red>, you're on <green>" + plugin.getVersion());
sender.sendPrefixedRich("<b><red>WARNING: <red>You will have to restart the server to prevent further issues and to complete the update! If you can't do that, don't update!");
sender.send(Component.text().append(MiniMessage.miniMessage().deserialize("<gold>× <dark_gray>[<green>Update<dark_gray>]"))
.clickEvent(ClickEvent.runCommand("/maintenance forceupdate"))
.hoverEvent(HoverEvent.showText(Component.text().content("Click here to update the plugin").color(NamedTextColor.GREEN)))
.append(Component.text().content(", or manually run ").color(NamedTextColor.GRAY))
.append(Component.text().content("/maintenance forceupdate").color(NamedTextColor.RED)).build());
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -25,6 +25,7 @@ import eu.kennytv.maintenance.core.util.SenderInfo;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.logging.Level;
public final class WhitelistAddCommand extends CommandInfo {
@@ -64,7 +65,13 @@ public final class WhitelistAddCommand extends CommandInfo {
}
private void addPlayerToWhitelist(final SenderInfo sender, final String name) {
plugin.getOfflinePlayer(name, selected -> {
plugin.getOfflinePlayer(name).whenComplete((selected, ex) -> {
if (ex != null) {
plugin.getLogger().log(Level.SEVERE, "Error while fetching offline player", ex);
sender.send(getMessage("offlinePlayerFetchError"));
return;
}
if (selected == null) {
sender.send(getMessage("playerNotOnline"));
return;
@@ -75,7 +82,13 @@ public final class WhitelistAddCommand extends CommandInfo {
}
private void addPlayerToWhitelist(final SenderInfo sender, final UUID uuid) {
plugin.getOfflinePlayer(uuid, selected -> {
plugin.getOfflinePlayer(uuid).whenComplete((selected, ex) -> {
if (ex != null) {
plugin.getLogger().log(Level.SEVERE, "Error while fetching offline player", ex);
sender.send(getMessage("offlinePlayerFetchError"));
return;
}
if (selected == null) {
sender.send(getMessage("playerNotFoundUuid"));
return;
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -50,8 +50,9 @@ public final class WhitelistRemoveCommand extends CommandInfo {
if (args.length != 2) return Collections.emptyList();
final List<String> list = new ArrayList<>();
String matchNameLowerCase = args[1].toLowerCase();
for (final String name : getSettings().getWhitelistedPlayers().values()) {
if (name.toLowerCase().startsWith(args[1])) {
if (name.toLowerCase().startsWith(matchNameLowerCase)) {
list.add(name);
}
}
@@ -59,7 +60,7 @@ public final class WhitelistRemoveCommand extends CommandInfo {
}
private void removePlayerFromWhitelist(final SenderInfo sender, final String name) {
plugin.getOfflinePlayer(name, selected -> {
plugin.getOfflinePlayer(name).whenComplete((selected, ex) -> {
if (selected == null) {
if (getSettings().removeWhitelistedPlayer(name)) {
sender.send(getMessage("whitelistRemoved", "%PLAYER%", name));
@@ -74,7 +75,7 @@ public final class WhitelistRemoveCommand extends CommandInfo {
}
private void removePlayerFromWhitelist(final SenderInfo sender, final UUID uuid) {
plugin.getOfflinePlayer(uuid, selected -> {
plugin.getOfflinePlayer(uuid).whenComplete((selected, ex) -> {
if (selected == null) {
removePlayerFromWhitelist(sender, uuid, uuid.toString());
} else {
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -18,10 +18,6 @@
package eu.kennytv.maintenance.core.config;
import com.google.common.collect.Sets;
import org.jetbrains.annotations.Nullable;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@@ -31,6 +27,9 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import org.jetbrains.annotations.Nullable;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
/**
* Further modified version of the <a href="https://github.com/PSandro/SimpleConfig">SimpleConfig</a>SimpleConfig project of PSandro.
@@ -110,30 +109,8 @@ public final class Config extends ConfigSection {
Files.write(file.toPath(), bytes);
}
public boolean addMissingFields(final Map<String, Object> fields, final Map<String, String[]> comments) {
// Note: Only scans for the first two levels
boolean changed = false;
for (final Map.Entry<String, Object> entry : fields.entrySet()) {
final Object o = values.get(entry.getKey());
if (o != null) {
final Object o2 = entry.getValue();
if (!(o instanceof Map) || !(o2 instanceof Map)) continue;
final Map<String, Object> deepMap = (Map<String, Object>) o2;
for (final Map.Entry<String, Object> deepEntry : ((Map<String, Object>) o2).entrySet()) {
if (deepMap.containsKey(deepEntry.getKey())) continue;
deepMap.put(deepEntry.getKey(), deepEntry.getValue());
changed = true;
}
continue;
}
values.put(entry.getKey(), entry.getValue());
changed = true;
}
this.comments = new HashMap<>(comments);
return changed;
public void replaceComments(final Config fromConfig) {
this.comments = new HashMap<>(fromConfig.comments);
}
private static Yaml createYaml() {
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -17,12 +17,12 @@
*/
package eu.kennytv.maintenance.core.config;
import org.jetbrains.annotations.Nullable;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.jetbrains.annotations.Nullable;
/**
* Further modified version of the <a href="https://github.com/PSandro/SimpleConfig">SimpleConfig</a>SimpleConfig project of PSandro.
@@ -63,15 +63,15 @@ public class ConfigSection {
@Nullable
public Object getObject(final String key, final Object def) {
int i1 = -1;
int i2;
int nextSeparatorIndex = -1;
int sectionStartIndex;
ConfigSection section = this;
while ((i1 = key.indexOf('.', i2 = i1 + 1)) != -1) {
section = section.getSection(key.substring(i2, i1));
while ((nextSeparatorIndex = key.indexOf('.', sectionStartIndex = nextSeparatorIndex + 1)) != -1) {
section = section.getSection(key.substring(sectionStartIndex, nextSeparatorIndex));
if (section == null) return def;
}
final String subKey = key.substring(i2);
final String subKey = key.substring(sectionStartIndex);
if (section == this) {
final Object result = values.get(subKey);
return result != null ? result : def;
@@ -97,17 +97,41 @@ public class ConfigSection {
return new ConfigSection(getRoot(), getFullKeyInPath(key), (Map<String, Object>) o);
}
public ConfigSection getOrCreateSection(final String key) {
final Object o = getObject(key);
if (!(o instanceof Map)) {
set(key, new LinkedHashMap<>());
return getSection(key);
}
return new ConfigSection(getRoot(), getFullKeyInPath(key), (Map<String, Object>) o);
}
public boolean contains(final String key) {
return getObject(key) != null;
}
public void set(final String key, @Nullable final Object value) {
//TODO go deep if necessary
int nextSeparatorIndex = -1;
int sectionStartIndex;
ConfigSection section = this;
while ((nextSeparatorIndex = key.indexOf('.', sectionStartIndex = nextSeparatorIndex + 1)) != -1) {
section = section.getOrCreateSection(key.substring(sectionStartIndex, nextSeparatorIndex));
}
final String sectionKey = key.substring(sectionStartIndex);
if (value == null) {
values.remove(key);
section.values.remove(sectionKey);
getRoot().getComments().remove(getFullKeyInPath(key));
} else {
values.put(key, value);
section.values.put(sectionKey, value);
}
}
public void move(final String key, final String toKey) {
final Object o = getObject(key);
if (o != null) {
remove(key);
set(toKey, o);
}
}
@@ -192,6 +216,28 @@ public class ConfigSection {
return list != null ? list : def;
}
public boolean addMissingFields(final ConfigSection fromSection) {
boolean changed = false;
for (final Map.Entry<String, Object> entry : fromSection.values.entrySet()) {
final String key = entry.getKey();
final Object value = this.values.get(key);
if (value != null) {
// Go deeper for sections
final Object newValue = entry.getValue();
if (!(value instanceof Map) || !(newValue instanceof Map)) {
continue;
}
changed |= this.getSection(key).addMissingFields(fromSection.getSection(key));
} else {
// Value is missing
this.values.put(key, entry.getValue());
changed = true;
}
}
return changed;
}
/**
* @return root config
*/
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -21,6 +21,12 @@ import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.core.util.SenderInfo;
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.event.ClickEvent;
import eu.kennytv.maintenance.lib.kyori.adventure.text.event.HoverEvent;
import eu.kennytv.maintenance.lib.kyori.adventure.text.format.NamedTextColor;
import eu.kennytv.maintenance.lib.kyori.adventure.text.format.TextDecoration;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
@@ -65,8 +71,15 @@ public abstract class JoinListenerBase {
}
notifiedPlayers.add(sender.getUuid());
sender.sendMessage(plugin.getPrefix() + "§cThere is a newer version available: §aVersion " + plugin.getNewestVersion() + "§c, you're on §a" + plugin.getVersion());
plugin.sendUpdateNotification(sender);
sender.sendPrefixedRich("<red>There is a newer version available: <green>Version " + plugin.getNewestVersion() + "<red>, you're on <green>" + plugin.getVersion());
final TextComponent text = Component.text().content("Download it at: ").color(NamedTextColor.RED)
.append(Component.text().content(MaintenancePlugin.HANGAR_URL).color(NamedTextColor.GOLD))
.append(Component.text().content(" (CLICK ME)").color(NamedTextColor.GRAY).decorate(TextDecoration.BOLD))
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, MaintenancePlugin.HANGAR_URL))
.hoverEvent(HoverEvent.showText(Component.text("Download the latest version").color(NamedTextColor.GREEN)))
.build();
sender.send(plugin.prefix().append(text));
});
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -20,8 +20,7 @@ package eu.kennytv.maintenance.core.runnable;
import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.core.Settings;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import java.util.concurrent.TimeUnit;
import java.time.Duration;
public final class MaintenanceScheduleRunnable extends MaintenanceRunnable {
private final int maintenanceDuration;
@@ -36,7 +35,7 @@ public final class MaintenanceScheduleRunnable extends MaintenanceRunnable {
super.finish();
// Start the timer to disable maintenance again
plugin.startMaintenanceRunnable(maintenanceDuration, TimeUnit.SECONDS, false);
plugin.startMaintenanceRunnable(Duration.ofSeconds(maintenanceDuration), false);
}
@Override
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -45,11 +45,6 @@ public final class DummySenderInfo implements SenderInfo {
return false;
}
@Override
@Deprecated
public void sendMessage(final String message) {
}
@Override
public void send(final Component component) {
}
@@ -0,0 +1,9 @@
package eu.kennytv.maintenance.core.util;
import java.io.IOException;
/**
* Exception thrown when an API rate limit is reached.
*/
public class RateLimitedException extends IOException {
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -17,6 +17,8 @@
*/
package eu.kennytv.maintenance.core.util;
import eu.kennytv.maintenance.api.MaintenanceProvider;
import eu.kennytv.maintenance.core.MaintenancePlugin;
import eu.kennytv.maintenance.lib.kyori.adventure.text.Component;
import eu.kennytv.maintenance.lib.kyori.adventure.text.minimessage.MiniMessage;
import java.util.UUID;
@@ -33,14 +35,16 @@ public interface SenderInfo {
return permission == null || hasPermission("maintenance.admin") || hasPermission("maintenance." + permission);
}
@Deprecated
void sendMessage(String message);
void send(Component component);
default void sendRich(final String message) {
send(MiniMessage.miniMessage().deserialize(message));
}
default void sendPrefixedRich(final String message) {
final MaintenancePlugin maintenance = (MaintenancePlugin) MaintenanceProvider.get();
send(maintenance.prefix().append(MiniMessage.miniMessage().deserialize(message)));
}
boolean isPlayer();
}
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of Maintenance - https://github.com/kennytv/Maintenance
* Copyright (C) 2018-2022 kennytv (https://github.com/kennytv)
* Copyright (C) 2018-2024 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
+51 -46
View File
@@ -11,12 +11,18 @@
# 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.
# For a full list of formats and fancy examples of MiniMessage, see https://docs.adventure.kyori.net/minimessage/format.html
# Changes the language of command feedback/messages.
# If you find missing translations or want to contribute, see https://crowdin.com/project/maintenance
# 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), vi (Vietnamese)
language: en
# Enables maintenance mode.
maintenance-enabled: false
# Enables maintenance on certain servers managed by your proxy instance(s).
proxied-maintenance-servers:
- SpigotServer1
- PaperServer1
# - 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.
@@ -28,13 +34,37 @@ fallback: lobby
# Leave this empty to disable.
waiting-server: ""
# The message shown in the multiplayer server list motd when maintenance is enabled.
# The message (MOTD) 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:
- "<red>Currently under maintenance<br><gradient:#fbffc2:#0fffff>We will be back soon!"
# - "Other entry"
enable-pingmessages: true
# If running an endtimer, the time left can be displayed by including '%TIMER%' in a ping message.
ping-message:
enabled: true
messages:
- "<red>Currently under maintenance<br><gradient:#fbffc2:#0fffff>We will be back soon!"
# If set to true and an endtimer is currently running, a message 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-timer-specific-messages: true
timer-messages:
- "<red>Currently under maintenance<br><gradient:#fbffc2:#fffff>Come back in:</gradient> <color:#aa55ee>%TIMER%"
# If enabled, the message below will be shown in the top right corner of the server in the server list, where the player count would normally be displayed.
# You can use '%ONLINE%' and '%MAX%' if you want to include the player count in a custom message (e.g. "Maintenance %ONLINE%/%MAX%").
# DOES NOT SUPPORT RGB!
player-count-message:
enabled: true
message: "<dark_red>Maintenance"
# If set to true and an endtimer is currently running, the timer message will be used instead of the normal one.
enable-timer-specific-message: false
timer-message: "<dark_red>Come back in: <yellow>%TIMER%"
# Is shown when you move your mouse above the text in the top right corner of the server in the server list, where the player count would normally be displayed.
# DOES NOT SUPPORT RGB!
player-list-hover-message:
enabled: true
message: "<red>Currently under<br><red>maintenance"
# If set to true and an endtimer is currently running, the timer message will be used instead of the normal one.
enable-timer-specific-message: false
timer-message: "<red>Come back in:<br><red><yellow>%TIMER%"
# Any extra commands inside the arrays will be executed when maintenance is enabled/disabled.
# Example: commands-on-maintenance-enable: ["say hello!", "stop"]
@@ -50,27 +80,6 @@ commands-on-single-maintenance-enable:
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
timerspecific-pingmessages:
- "<red>Currently under maintenance<br><gradient:#fbffc2:#fffff>Come back in:</gradient> <color:#aa55ee>%TIMER%"
# - "Other entry"
# If set to true, the message below will be shown in the top right corner of the server in the serverlist, where the playercount would normally be displayed.
# If set to false, the normal playercount will be shown.
#
# Alternatively you can use '%ONLINE%' and '%MAX%' if you want to include the playercount in a custom message (e.g. "Maintenance %ONLINE%/%MAX%").
# DOES NOT SUPPORT RGB!
enable-playercountmessage: true
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.
custom-maintenance-icon: false
@@ -79,14 +88,21 @@ custom-maintenance-icon: false
send-join-notification: false
# Set this to false if you do not want players to be kicked when you enable maintenance (new connections will still be blocked).
# ... I don't know why you would want that, but you can disable it. :p
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), tr (Turkish), sv (Swedish), uk (Ukrainian), ja (Japanese), da (Danish), ko (Korean), hu (Hungarian)
language: en
# When fetched player does not exist then fallback to offline uuid. Only works on proxies like Velocity or BungeeCord
fallback-to-offline-uuid: false
# If enabled and the server is restarted while running an endtimer, the timer will be continued after the restart.
# If the timer ends while the server is offline, maintenance will be disabled as soon as the server starts again.
continue-endtimer-after-restart:
enabled: false
# This value is set everytime an endtimer is started, cancelled or ended.
# Do not manually change this value.
end: 0
# If using the timer command: In what intervalls before enabling/disabling maintenance there will be a broadcast.
timer-broadcast-for-seconds: [1200, 900, 600, 300, 120, 60, 30, 20, 10, 5, 4, 3, 2, 1]
# If you have 2 or more proxy instances, the database connection will make sure all proxies
# have the same maintenance status, so you won't have to enable/disable it on every proxy by hand.
@@ -106,21 +122,10 @@ mysql:
# If you for some reason cannot establish SSL connections to your database, you may disable it here (not recommended).
use-ssl: true
# If enabled and the server is restarted while running an endtimer, the timer will be continued after the restart.
# If the timer ends while the server is offline, maintenance will be disabled as soon as the server starts again.
continue-endtimer-after-restart:
enabled: false
# This value is set everytime an endtimer is started, cancelled or ended.
# Do not manually change this value.
end: 0
# If using the timer command: In what intervalls before enabling/disabling maintenance there will be a broadcast.
timer-broadcast-for-seconds: [1200, 900, 600, 300, 120, 60, 30, 20, 10, 5, 4, 3, 2, 1]
# If disabled, you will no longer receive any messages if there is an update.
# Not recommended to disable, as new versions generally tend to run better and with fewer bugs.
# However, you can always check for updates manually using the '/maintenance update' command.
update-checks: true
# Used for autoupdating the config, do not change this value.
config-version: 7
config-version: 9
+10 -9
View File
@@ -44,8 +44,9 @@ whitelistEmpty: "<prefix><red>Vedligeholdelseshvidlisten er tom! Brug <yellow>/m
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."
offlinePlayerFetchError: "<prefix><red>There was an error while fetching offline player. Please try again later."
invalidUuid: "<prefix><red>Ugyldigt 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 Paper/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!"
@@ -77,9 +78,9 @@ helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MA
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)"
helpEndtimer: "<gold>/maintenance endtimer <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpStarttimer: "<gold>/maintenance starttimer <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
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)"
@@ -92,12 +93,12 @@ helpUpdate: "<gold>/maintenance update <gray>(Downloader den nyeste version af p
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
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/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)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
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
language-version: 2
+15 -14
View File
@@ -10,9 +10,9 @@ 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>."
endtimerStarted: "<prefix><green>Timer gestartet: <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>Timer gestartet: <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!"
@@ -26,7 +26,7 @@ joinNotification: "<prefix><yellow>%PLAYER% <red>hat versucht dem Server beizutr
motdList: "<prefix><gray>Liste deiner Motds, die während Maintenance angezeigt werden:"
motdListEmpty: "<prefix><red>Du hast keine Maintenance MOTDs gesetzt!"
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."
removedMotd: "<prefix><green>Removed motd number %INDEX%."
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, die zwischen 1 und %NEWAMOUNT% liegt, wählen."
@@ -36,7 +36,7 @@ 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!"
whitelistAdded: "<prefix><aqua>%PLAYER% <green>wurde zur Wartungs-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!"
@@ -44,8 +44,9 @@ whitelistEmpty: "<prefix><red>In der Maintenance Whitelist befinden sich keine S
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."
offlinePlayerFetchError: "<prefix><red>Beim Abrufen des Offline-Spielers ist ein Fehler aufgetreten. Bitte versuche es später erneut."
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
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/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!"
@@ -75,11 +76,11 @@ 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."
helpNextPage: "<gray>Nutze <aqua>/maintenance help %PAGE%<gray>, um zur nächsten Hilfeseite zu kommen."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(Falls momentan ein Timer läuft, wird dieser abgebrochen)"
helpEndtimer: "<gold>/maintenance endtimer <Minuten> <gray>(Sobald der Timer abläuft wird der Wartungsmodus deaktiviert)"
helpStarttimer: "<gold>/maintenance starttimer <Minuten> <gray>(Sobald der Timer abläuft wird der Wartungsmodus aktiviert)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <Timer Minuten> <Wartungsmodus Minuten> <gray>(Nach der gegebenen Zeit wird der Wartungsmodus für die Länge in Minuten aktiviert)"
helpEndtimer: "<gold>/maintenance endtimer <Deaktiviere in> <gray>(Sobald der Timer, bspw. 1h5m, abläuft wird der Wartungsmodus deaktiviert)"
helpStarttimer: "<gold>/maintenance starttimer <Aktiviere in> <gray>(Sobald der Timer, bspw. 1h5m, abläuft wird der Wartungsmodus aktiviert)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <Aktiviere in> <Wartungsdauer> <gray>(Nach der gegebenen Zeit, bspw. 1h5m, wird der Wartungsmodus für die Länge in Minuten aktiviert)"
helpDebug: "<gold>/maintenance debug <gray>(Aktiviert Debug Nachrichten in der Konsole)"
helpDump: "<gold>/maintenance dump <gray>(Sammelt wichtige Informationen für Bugreports)"
helpHelp: "<gold>/maintenance help [Seite] <gray>(Zeigt diese wunderschöne Hilfe)"
@@ -92,12 +93,12 @@ helpUpdate: "<gold>/maintenance update <gray>(Sucht nach neuen Updates für das
helpWhitelist: "<gold>/maintenance whitelist <gray>(Zeigt alle gewhitelisteten Spieler für den Wartungsmodus an)"
helpWhitelistAdd: "<gold>/maintenance add <Name/UUID> <gray>(Whitelistet einen Spieler für den Wartungsmodus, sodass dieser während Wartungen den Server betreten kann)"
helpWhitelistRemove: "<gold>/maintenance remove <Name/UUID> <gray>(Entfernt einen Spieler aus der Wartungsmodus Whitelist)"
#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 Paper/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)"
helpSingleEndtimer: "<gold>/maintenance endtimer [Server] <Deaktiviere in> <gray>(Sobald der Timer, bspw. 1h5m, abläuft wird der Wartungsmodus deaktiviert)"
helpSingleStarttimer: "<gold>/maintenance starttimer [Server] <Aktiviere in> <gray>(Sobald der Timer, bspw. 1h5m, abläuft wird der Wartungsmodus aktiviert)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [Server] <Starte in> <Wartungsdauer> <gray>(Sobald der Timer, bspw. 1h5m, 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)"
#Used for autoupdating the language file, do not change this value.
language-version: 1
language-version: 2
+11 -10
View File
@@ -18,7 +18,7 @@ scheduletimerStarted: "<prefix><green>Started timer: <gray>Maintenance mode will
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."
timerTooLong: "<prefix><red>The number has to be less than 40320 (28 days)!"
timerTooLong: "<prefix><red>The duration has to be less than 28 days!"
timerMotdDisabled: "<prefix><red>You have to set 'enable-timerspecific-messages' in the config to 'true', if you want to use/edit timerspecific motds."
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
motdTimerNotRunning: "-"
@@ -44,8 +44,9 @@ whitelistEmpty: "<prefix><red>The maintenance whitelist is empty! Use <yellow>/m
playerNotFound: "<prefix><red>No player with this name has played on this server before."
playerNotFoundUuid: "<prefix><red>No player with that uuid could be found."
playerNotOnline: "<prefix><red>There is no player online with that name."
offlinePlayerFetchError: "<prefix><red>There was an error while fetching offline player. Please try again later."
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 Paper/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!"
@@ -77,9 +78,9 @@ helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MA
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)"
helpEndtimer: "<gold>/maintenance endtimer <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpStarttimer: "<gold>/maintenance starttimer <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
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)"
@@ -92,12 +93,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 Paper/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)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
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
language-version: 2
+17 -16
View File
@@ -4,12 +4,12 @@
#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!"
maintenanceActivated: "<prefix>Mantenimiento <gray>activado"
maintenanceDeactivated: "<prefix><gray>Modo mantenimiento desactivado"
alreadyEnabled: "<prefix><gray>Modo mantenimiento se encuentra habilitado!"
alreadyDisabled: "<prefix><gray>Modo mantenimiento se encuentra deshabilitado!"
endtimerBroadcast: "<prefix><gray>El modo mantenimiento se desactivara en <gold>%TIME%<gray>."
kickmessage: "<red>¡El servidor se encuentra en mantenimiento!<br>¡Intentalo de nuevo más tarde!"
maintenanceActivated: "<prefix><gold>Mantenimiento <gray>activado."
maintenanceDeactivated: "<prefix><gold>Modo mantenimiento desactivado."
alreadyEnabled: "<prefix><gray>¡Modo mantenimiento se encuentra habilitado!"
alreadyDisabled: "<prefix><gray>¡Modo mantenimiento se encuentra deshabilitado!"
endtimerBroadcast: "<prefix><gray>El modo mantenimiento se desactivará en <gold>%TIME%<gray>."
endtimerStarted: "<prefix><gray>Temporizador iniciado: El modo mantenimiento se desactivará en <gold>%TIME%<gray>."
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>."
@@ -44,8 +44,9 @@ whitelistEmpty: "<prefix><gray>La lista de mantenimiento está vacía! Usa '<gol
playerNotFound: "<prefix><gray>Ningun jugador con este nombre ha jugado en este servidor antes!"
playerNotFoundUuid: "<prefix><red>No se pudo encontrar el jugador con ese UUID."
playerNotOnline: "<prefix><gray>No hay jugador en línea con este nombre."
offlinePlayerFetchError: "<prefix><red>Hubo un error al obtener el jugador sin conexión. Por favor, inténtalo de nuevo más tarde."
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 Paper/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!"
@@ -59,7 +60,7 @@ singleStarttimerStarted: "<prefix><gray>Temporizador iniciado: El modo mantenimi
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!"
singleMaintenanceKickComplete: "<gray>El Servidor <gold>%SERVER% <gray>está en mantenimiento!<br><red>Vuelve Más Tarde!"
singleMaintenanceActivated: "<prefix><gray>El modo mantenimiento esta activado en el servidor <gold>%SERVER%<gray>."
singleMaintenanceDeactivated: "<prefix><gray>El modo mantenimiento ahora esta deshabilitado en <gold>%SERVER%<gray>."
singleServerAlreadyEnabled: "<prefix><gray>El modo mantenimiento se encuentra habilitado en <gold>%SERVER%<gray>!"
@@ -77,9 +78,9 @@ helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MA
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."
helpAbortTimer: "<gold>/maintenance aborttimer <dark_gray>(<gray>Si se ejecuta, se abortará el temporizador actual<dark_gray>)"
helpEndtimer: "<gold>/maintenance endtimer <minutes> <dark_gray>(<gray>Después del tiempo en minutos, se desactivará el modo de mantenimiento<dark_gray>)"
helpStarttimer: "<gold>/maintenance starttimer <minutes> <dark_gray>(<gray>Después del tiempo en minutos, se habilitará el modo de mantenimiento<dark_gray>)"
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)"
helpEndtimer: ""
helpStarttimer: ""
helpScheduleTimer: "<gold>/maintenance scheduletimer <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpDebug: "<gold>/maintenance debug <gray>(Activa algunos registros de depuración)"
helpDump: "<gold>/maintenance dump <dark_gray>(<gray>Descarga información del servidor, usada para informes de errores<dark_gray>)"
helpHelp: "<gold>/maintenance help [page] <dark_gray>(<gray>Muestra la pagina de ayuda<dark_gray>)"
@@ -92,12 +93,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 Paper/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.)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
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.
language-version: 1
language-version: 2
+12 -11
View File
@@ -14,7 +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>."
scheduletimerStarted: "<prefix><green>Le minuteur a été lancé : <gray>La maintenance va être activé dans <gold>%TIME%<gray> et elle va durer pendant : <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."
@@ -44,8 +44,9 @@ whitelistEmpty: "<prefix><red>La liste blanche de maintenance est vide : Utilisa
playerNotFound: "<prefix><red>Aucun joueur avec ce nom n'a auparavant joué sur ce serveur."
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."
offlinePlayerFetchError: "<prefix><red>Une erreur s'est produite lors de la récupération du joueur hors ligne. Veuillez réessayer plus tard."
invalidUuid: "<prefix><red>Le format de l'UUID est invalide !"
#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 Paper/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 !"
@@ -57,7 +58,7 @@ singleEndtimerStarted: "<prefix><green>Minuterie : <gray>Le mode maintenance sur
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>."
singleScheduletimerStarted: "<prefix><green>Le minuteur a été lancé : <gray>La maintenance sur le serveur %SERVER% va être activé dans <gold>%TIME%<gray> et va durer pendant <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>."
@@ -77,9 +78,9 @@ helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MA
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."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(Si en cours d'exécution, le minuteur actuel sera abandonné)"
helpEndtimer: "<gold>/maintenance endtimer <minutes> <gray>(Après le temps imparti en minutes, le mode maintenance sera désactivé)"
helpStarttimer: "<gold>/maintenance starttimer <minutes> <gray>(Après le temps imparti en minutes, le mode maintenance sera activé)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <timer minutes> <maintenance duration> <gray>(Après le temps donné en minutes, le mode de maintenance sera activé pour la durée donnée en minutes)"
helpEndtimer: "<gold>/maintenance endtimer <désactiver dans> <gray>(Après le temps imparti, ex. 1h5m, le mode maintenance sera désactiver)"
helpStarttimer: "<gold>/maintenance starttimer <activer dans> <gray>(Après le temps imparti, ex. 1h5m, le mode maintenance sera activé)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <activer dans> <durée de maintenance> <gray>(Après le temps imparti, ex. 1h5m, le mode maintenance sera activé)"
helpDebug: "<gold>/maintenance debug <gray>(Active certains enregistrements de débogage)"
helpDump: "<gold>/maintenance dump <gray>(Enregistre certaines informations sur le serveur, utilisées pour les rapports de bug)"
helpHelp: "<gold>/maintenance help [page] <gray>(Montre cette belle fenêtre d'aide)"
@@ -92,12 +93,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)"
#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 Paper/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)"
helpSingleEndtimer: "<gold>/maintenance endtimer [serveur] <activer dans> <gray>(Après le temps imparti, ex. 1h5m, le mode maintenance sera désactiver)"
helpSingleStarttimer: "<gold>/maintenance starttimer [serveur] <activer dans> <gray>(Après le temps imparti, ex. 1h5m, le mode maintenance sera activé)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [serveur] <activer dans> <durée de maintenance> <gray>(Après le temps imparti, ex. 1h5m, le mode maintenance sera activé)"
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.
language-version: 1
language-version: 2
+14 -13
View File
@@ -44,8 +44,9 @@ 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."
offlinePlayerFetchError: "<prefix><red>Hiba történt az offline játékos lekérése közben. Kérlek, próbáld újra később!"
invalidUuid: "<prefix><red>Rossz 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 Paper/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!"
@@ -53,10 +54,10 @@ 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>."
singleEndtimerStarted: "<prefix><green>Időzítő elindítva: <gray>A karbantartás mód a %SERVER% szerveren ki lesz kapcsolva <gold>%TIME% múlva<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."
singleStarttimerStarted: "<prefix><green>Időzítő elindítva: <gray>A karbantartás mód a %SERVER% szerveren be lesz kapcsolva <gold>%TIME% múlva<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!"
@@ -77,9 +78,9 @@ helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MA
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)"
helpEndtimer: "<gold>/maintenance endtimer <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpStarttimer: "<gold>/maintenance starttimer <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
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)"
@@ -92,12 +93,12 @@ 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
#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/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)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
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)"
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
language-version: 2
+13 -12
View File
@@ -14,7 +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>."
scheduletimerStarted: "<prefix><green>Timer avviato: la modalità di manutenzione <gray>sarà abilitata in <gold>%TIME% <gray>e durerà per <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."
@@ -44,8 +44,9 @@ whitelistEmpty: "<prefix><red>La whitelist di manutenzione è vuota! Usa <yellow
playerNotFound: "<prefix><red>Nessun giocatore con questo username è mai entrato nel server."
playerNotFoundUuid: "<prefix><red>Nessun player con quell'uuid è stato trovato."
playerNotOnline: "<prefix><red>Non c'è nessun giocatore online con quell'username."
offlinePlayerFetchError: "<prefix><red>C'è stato un errore cercando il player offline. Riprova più tardi."
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 Paper/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!"
@@ -57,7 +58,7 @@ singleEndtimerStarted: "<prefix><green>Timer avviato: <gray>La modalità manuten
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>."
singleScheduletimerStarted: "<prefix><green>Timer avviato: <gray>Modalità di manutenzione sul server %SERVER% sarà attivato in <gold>%TIME% <gray>e durerà per <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>."
@@ -77,9 +78,9 @@ helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MA
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."
helpAbortTimer: "<gold>/maintenance aborttimer <gray>(Se attivo, l'attuale timer verrà fermato)"
helpEndtimer: "<gold>/maintenance endtimer <minutes> <gray>(Dopo il tempo fornito in minuti, la modalità manutenzione sarà rimossa)"
helpStarttimer: "<gold>/maintenance starttimer <minutes> <gray>(Dopo il tempo fornito in minuti, la modalità manutenzione sarà attivata)"
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)"
helpEndtimer: ""
helpStarttimer: "x"
helpScheduleTimer: "<gold>/maintenance scheduletimer <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpDebug: "<gold>/maintenance debug <gray>(Enables some debug logging)"
helpDump: "<gold>/maintenance dump <gray>(Copia alcune informazioni dal server, usato per segnalare problemi)"
helpHelp: "<gold>/maintenance help [page] <gray>(Mostra questa fantastica pagina d'aiuto)"
@@ -92,12 +93,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 Paper/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)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpSingleToggle: "<gold>/maintenance <on/off> [server] <gray>(Abilita/disabilita la modalità di 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.
language-version: 1
language-version: 2
+10 -9
View File
@@ -44,8 +44,9 @@ whitelistEmpty: "<prefix><red>使用方法が違います。<yellow>/maintenance
playerNotFound: "<prefix><red>不明なユーザーです。"
playerNotFoundUuid: "<prefix><red>不明なUUIDです。"
playerNotOnline: "<prefix><red>このユーザーはオンラインではありません。"
offlinePlayerFetchError: "<prefix><red>オフラインプレイヤーの取得中にエラーが発生しました。しばらく経ってからもう一度お試しください。"
invalidUuid: "<prefix><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 Paper/Sponge
sentToWaitingServer: "<prefix><red>待機サーバーに転送されました!"
forceWaitingServer: "<prefix><red>メンテナンスが有効な間は、待機中のサーバーから離れることはできません。"
serverNotFound: "<prefix><red>この名前のサーバーはプロキシに登録されていません。"
@@ -77,9 +78,9 @@ helpHeader: "<dark_gray>========[ <yellow>%NAME% <dark_gray>| <yellow>%PAGE%/%MA
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>(分単位で指定した時間が経過すると、分単位で指定した時間だけメンテナンスモードが有効になります。)"
helpEndtimer: "<gold>/maintenance endtimer <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpStarttimer: "<gold>/maintenance starttimer <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpScheduleTimer: "<gold>/maintenance scheduletimer <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpDebug: "<gold>/maintenance debug <gray>(デバッグロギングを有効にします。)"
helpDump: "<gold>/maintenance dump <gray>(バグレポートに使用される、いくつかのサーバ情報をダンプします。)"
helpHelp: "<gold>/maintenance help [page] <gray>(このようなヘルプページが表示されます。)"
@@ -92,12 +93,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>(メンテナンスのホワイトリストからプレーヤーを削除します。)"
#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 Paper/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>(分単位で指定した時間が経過すると、分単位で指定した時間だけメンテナンスモードが有効になります)"
helpSingleEndtimer: "<gold>/maintenance endtimer [server] <disable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be disabled)"
helpSingleStarttimer: "<gold>/maintenance starttimer [server] <enable in> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
helpSingleScheduleTimer: "<gold>/maintenance scheduletimer [server] <enable in> <maintenance duration> <gray>(After the given time, e.g. 1h5m, maintenance mode will be enabled)"
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
language-version: 2
Loaded 100 of 151 files, more files were not shown because too many files have changed in this diff. Show more