Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34115f443e | ||
|
|
c8f0c1699e | ||
|
|
f22be77023 | ||
|
|
730a8dbeea | ||
|
|
0548e0c447 | ||
|
|
da0a757c5e | ||
|
|
ac19bac11c | ||
|
|
1de926bb28 | ||
|
|
94308cde7c | ||
|
|
d863c709e1 | ||
|
|
741914283a | ||
|
|
64902d90ff | ||
|
|
d3b4c7c87b | ||
|
|
390b65a70e | ||
|
|
7cff908aae | ||
|
|
d1f049c3e5 | ||
|
|
8d552dbe33 | ||
|
|
d3a933d21d | ||
|
|
a4d87dabf5 | ||
|
|
c3b579e86c | ||
|
|
b75d2337df | ||
|
|
b3e83c5c2e | ||
|
|
b6f447aded | ||
|
|
9febdfc140 | ||
|
|
90bc30d701 | ||
|
|
843ba4ac86 | ||
|
|
032fd7d582 | ||
|
|
9a0f680177 | ||
|
|
415d5f3807 | ||
|
|
33c96de5fb | ||
|
|
d141b40190 | ||
|
|
77e1444dba | ||
|
|
915b43d897 | ||
|
|
adc06e3486 | ||
|
|
cc7f5c2d11 | ||
|
|
0bb54ffc5d | ||
|
|
15ee2e6074 | ||
|
|
89abab36f8 | ||
|
|
e0bb1336b0 | ||
|
|
888ffd301a | ||
|
|
3a55dd3280 | ||
|
|
61c47ba2fa | ||
|
|
b97e69a71f | ||
|
|
75c940d089 | ||
|
|
849fa2a720 | ||
|
|
7e249faa99 | ||
|
|
c8272b39d5 | ||
|
|
b3c561ae26 | ||
|
|
af24c5a331 |
No files matched your search
@@ -3,6 +3,30 @@ This file contains update logs for this project. The top may contain a `Unreleas
|
||||
|
||||
## Unreleased
|
||||
### Changed
|
||||
* Bungee/Velocity: Added `maintenance.singleserver.bypass.<server>` permission to give individual bypasses for proxied servers (`maintenance.bypass` will still bypass everything as the super-perm)
|
||||
* Added the messages of the help command into the language files
|
||||
* Added config option `kick-online-players` to disable the kicks when maintenance is enabled (new connections will still be blocked)... not sure why you'd want that, but you can :p
|
||||
* The language file will now be automatically updated as well, so no need to delete and recreate it anymore, yay!
|
||||
* Updated missing and new translations in French language file (thanks to Spigot user Zendrique)
|
||||
* Updated missing and new translations in Spanish language file (thanks to Spigot user Vixo_Ulises)
|
||||
### Fixed
|
||||
* Bungee/Velocity: Fixed the join-notifications being sent twice if both global and server maintenance are enabled, as well as when just a server has maintenance in some cases
|
||||
* Bungee: Fixed players being kicked *after* the initial connection and thus triggering a join and leave message before being kicked
|
||||
* Bungee: Fixed the kickmessage not being displayed in some cases
|
||||
* Paper: Fixed the playercount message not being displayed on Paper servers with ViaVersion
|
||||
* Paper: Fixed the motd not being changed at all on Paper servers with ProtocolSupport (-> ProtocolLib listener used, since ProtocolSupport does not fire Paper's ping event)
|
||||
* Fixed the config autoupdater when the config contained strings broken over multiple lines.
|
||||
---
|
||||
## 3.0.2 - May 17th 2019
|
||||
### Changed
|
||||
* Added config option `timerspecific-pingmessages` to have specific pingmessages shown when endtimers are run
|
||||
* You can also set them ingame by using `/maintenance setmotd timer <index> ...` instead of `/maintenance setmotd <index> ...`, along with `/maintenance removemotd timer <index>` and `/maintenance motd timer`
|
||||
* Made dumps a little prettier
|
||||
* Support Sponge 8.0.0-SNAPSHOT
|
||||
* Support latest text/Velocity (now only supports Velocity builds from May 7th upwards)
|
||||
---
|
||||
## 3.0.1 - April 17th 2019
|
||||
### Changed
|
||||
* Created an addon to have PlaceholderAPI placeholders on Spigot when running the Maintenance plugin on Bungee (see [**here**](https://github.com/KennyTV/Maintenance/wiki/MaintenanceAddon))
|
||||
* Spigot version: If running on Paper 1.12.2 or higher, ProtocolLib will not be needed anymore
|
||||
* The universal jar now only includes Bungee and Spigot (whereas before Sponge and Velocity as well) and has been further minimized in size
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
language: java
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
|
||||
dist: trusty
|
||||
cache:
|
||||
directories:
|
||||
- '$HOME/.m2'
|
||||
- '$HOME/.m2/repository'
|
||||
Binary file not shown.
@@ -1,7 +1,8 @@
|
||||
# Maintenance
|
||||
[](https://github.com/KennyTV/Maintenance/releases)
|
||||
[](https://travis-ci.org/KennyTV/Maintenance)
|
||||
[](https://discord.gg/vGCUzHq)
|
||||
[](https://discord.gg/vGCUzHq)
|
||||
[](https://twitter.com/KennyTVN)
|
||||
|
||||
Maintenance is probably the most customizable free maintenance plugin for your Minecraft server you can find. It runs on Bukkit/Spigot, BungeeCord, Sponge as well as Velocity.
|
||||
|
||||
@@ -14,6 +15,7 @@ Its features include:
|
||||
* Features specifically for Bungee/Velocity
|
||||
* Only want to enable maintenance on a single server? You can also do so by using the `/maintenance <on/off> <servername>` command
|
||||
* Link multiple proxy instances through a MySQL database connection, so you don't have to change maintenance on each proxy by hand
|
||||
* Use PlaceholderAPI placeholders with the [**MaintenanceAddon**](https://github.com/KennyTV/Maintenance/wiki/MaintenanceAddon) (only for Bungee)
|
||||
|
||||
A full list of commands, permissions and configuration options can be found in the wiki listed below.
|
||||
* [Wiki](https://github.com/KennyTV/Maintenance/wiki)
|
||||
@@ -25,12 +27,11 @@ A full list of commands, permissions and configuration options can be found in t
|
||||
|
||||
Other forum threads
|
||||
* [Spigot forums](https://www.spigotmc.org/resources/maintenance.40699/)
|
||||
* [Sponge forums](https://forums.spongepowered.org/t/maintenance/27421) (replacey by Ore)
|
||||
* [Ore Forums](https://ore.spongepowered.org/KennyTV/Maintenance)
|
||||
* [Ore/Sponge Forums](https://ore.spongepowered.org/KennyTV/Maintenance)
|
||||
* [Velocity forums](https://forums.velocitypowered.com/t/maintenance/129)
|
||||
|
||||
## Compiling
|
||||
To create a working jar yourself, simply clone the project and compile it with maven (by using `mvn clean package` in your IDE console).
|
||||
|
||||
## Licence
|
||||
You may only copy the code on a public repository while also keeping it under the same license (see [GNU General Public License](http://www.gnu.org/licenses/gpl-3.0)).
|
||||
When modifying the project's code, do that on a public repository while also keeping it under the same license (see [GNU General Public License](http://www.gnu.org/licenses/gpl-3.0)).
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.kennytv.maintenance</groupId>
|
||||
<artifactId>maintenance-parent</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maintenance-api</artifactId>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.13-SNAPSHOT</version>
|
||||
<version>1.14-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<groupId>com.destroystokyo.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.kennytv.maintenance</groupId>
|
||||
<artifactId>maintenance-parent</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maintenance-build</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.kennytv.maintenance</groupId>
|
||||
<artifactId>maintenance-parent</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maintenance-bungee</artifactId>
|
||||
@@ -29,7 +29,7 @@
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.13-SNAPSHOT</version>
|
||||
<version>1.14-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
+8
-8
@@ -23,7 +23,6 @@ import eu.kennytv.maintenance.api.proxy.IMaintenanceProxy;
|
||||
import eu.kennytv.maintenance.api.proxy.Server;
|
||||
import eu.kennytv.maintenance.bungee.command.MaintenanceBungeeCommand;
|
||||
import eu.kennytv.maintenance.bungee.command.MaintenanceBungeeCommandBase;
|
||||
import eu.kennytv.maintenance.bungee.listener.PostLoginListener;
|
||||
import eu.kennytv.maintenance.bungee.listener.ProxyPingListener;
|
||||
import eu.kennytv.maintenance.bungee.listener.ServerConnectListener;
|
||||
import eu.kennytv.maintenance.bungee.metrics.MetricsLite;
|
||||
@@ -78,7 +77,6 @@ public final class MaintenanceBungeePlugin extends MaintenanceProxyPlugin {
|
||||
sendEnableMessage();
|
||||
|
||||
final PluginManager pm = getProxy().getPluginManager();
|
||||
pm.registerListener(plugin, new PostLoginListener(this, settingsProxy));
|
||||
pm.registerListener(plugin, new ProxyPingListener(this, settingsProxy));
|
||||
pm.registerListener(plugin, new ServerConnectListener(this, settingsProxy));
|
||||
commandManager = new MaintenanceBungeeCommand(this, settingsProxy);
|
||||
@@ -114,20 +112,22 @@ public final class MaintenanceBungeePlugin extends MaintenanceProxyPlugin {
|
||||
}
|
||||
|
||||
public boolean isMaintenance(final ServerInfo serverInfo) {
|
||||
return settingsProxy.isMaintenance(new BungeeServer(serverInfo));
|
||||
return settingsProxy.isMaintenance(serverInfo.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void kickPlayers() {
|
||||
getProxy().getPlayers().stream()
|
||||
.filter(p -> !hasPermission(p, "bypass") && !settingsProxy.getWhitelistedPlayers().containsKey(p.getUniqueId()))
|
||||
.forEach(p -> p.disconnect(settingsProxy.getKickMessage()));
|
||||
for (final ProxiedPlayer p : getProxy().getPlayers()) {
|
||||
if (!hasPermission(p, "bypass") && !settingsProxy.getWhitelistedPlayers().containsKey(p.getUniqueId())) {
|
||||
p.disconnect(settingsProxy.getKickMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void kickPlayers(final Server server, final Server fallback) {
|
||||
final ServerInfo fallbackServer = fallback != null ? ((BungeeServer) fallback).getServer() : null;
|
||||
((BungeeServer) server).getServer().getPlayers().forEach(p -> {
|
||||
for (final ProxiedPlayer p : ((BungeeServer) server).getServer().getPlayers()) {
|
||||
if (!hasPermission(p, "bypass") && !settingsProxy.getWhitelistedPlayers().containsKey(p.getUniqueId())) {
|
||||
if (fallbackServer != null && fallbackServer.canAccess(p) && !isMaintenance(fallback)) {
|
||||
p.sendMessage(settingsProxy.getMessage("singleMaintenanceActivated").replace("%SERVER%", server.getName()));
|
||||
@@ -137,7 +137,7 @@ public final class MaintenanceBungeePlugin extends MaintenanceProxyPlugin {
|
||||
} else {
|
||||
p.sendMessage(settingsProxy.getMessage("singleMaintenanceActivated").replace("%SERVER%", server.getName()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+17
-6
@@ -23,13 +23,15 @@ 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.CommandSender;
|
||||
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.stream.Collectors;
|
||||
import java.util.Map;
|
||||
|
||||
public final class MaintenanceBungeeCommand extends MaintenanceProxyCommand {
|
||||
private final MaintenanceBungeePlugin plugin;
|
||||
@@ -51,9 +53,14 @@ public final class MaintenanceBungeeCommand extends MaintenanceProxyCommand {
|
||||
|
||||
@Override
|
||||
public List<String> getServersCompletion(final String s) {
|
||||
return plugin.getProxy().getServers().entrySet().stream().filter(entry -> entry.getKey().toLowerCase().startsWith(s))
|
||||
.filter(entry -> !plugin.getSettingsProxy().getMaintenanceServers().contains(entry.getValue().getName()))
|
||||
.map(entry -> entry.getValue().getName()).collect(Collectors.toList());
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (final Map.Entry<String, ServerInfo> entry : plugin.getProxy().getServers().entrySet()) {
|
||||
final String serverName = entry.getValue().getName();
|
||||
if (entry.getKey().toLowerCase().startsWith(s) && !plugin.getSettingsProxy().getMaintenanceServers().contains(serverName)) {
|
||||
list.add(serverName);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,6 +74,10 @@ public final class MaintenanceBungeeCommand extends MaintenanceProxyCommand {
|
||||
|
||||
@Override
|
||||
public List<String> getPlayersCompletion() {
|
||||
return plugin.getProxy().getPlayers().stream().map(CommandSender::getName).collect(Collectors.toList());
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (final ProxiedPlayer p : plugin.getProxy().getPlayers()) {
|
||||
list.add(p.getName());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Maintenance - https://git.io/maintenancemode
|
||||
* Copyright (C) 2018 KennyTV (https://github.com/KennyTV)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package eu.kennytv.maintenance.bungee.listener;
|
||||
|
||||
import eu.kennytv.maintenance.bungee.MaintenanceBungeePlugin;
|
||||
import eu.kennytv.maintenance.bungee.util.BungeeSenderInfo;
|
||||
import eu.kennytv.maintenance.core.Settings;
|
||||
import eu.kennytv.maintenance.core.listener.JoinListenerBase;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
|
||||
public final class PostLoginListener extends JoinListenerBase implements Listener {
|
||||
private final MaintenanceBungeePlugin plugin;
|
||||
|
||||
public PostLoginListener(final MaintenanceBungeePlugin plugin, final Settings settings) {
|
||||
super(plugin, settings);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postLogin(final PostLoginEvent event) {
|
||||
if (kickPlayer(new BungeeSenderInfo(event.getPlayer())))
|
||||
event.getPlayer().disconnect(settings.getKickMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void broadcastJoinNotification(final String name) {
|
||||
final BaseComponent[] s = TextComponent.fromLegacyText(settings.getMessage("joinNotification").replace("%PLAYER%", name));
|
||||
ProxyServer.getInstance().getPlayers().stream().filter(p -> plugin.hasPermission(p, "joinnotification")).forEach(p -> p.sendMessage(s));
|
||||
}
|
||||
}
|
||||
+41
-5
@@ -19,7 +19,10 @@
|
||||
package eu.kennytv.maintenance.bungee.listener;
|
||||
|
||||
import eu.kennytv.maintenance.bungee.MaintenanceBungeePlugin;
|
||||
import eu.kennytv.maintenance.bungee.util.BungeeSenderInfo;
|
||||
import eu.kennytv.maintenance.core.listener.JoinListenerBase;
|
||||
import eu.kennytv.maintenance.core.proxy.SettingsProxy;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
@@ -27,46 +30,79 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.event.ServerConnectEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
import net.md_5.bungee.event.EventPriority;
|
||||
|
||||
public final class ServerConnectListener implements Listener {
|
||||
public final class ServerConnectListener extends JoinListenerBase implements Listener {
|
||||
private final MaintenanceBungeePlugin plugin;
|
||||
private final SettingsProxy settings;
|
||||
private boolean warned;
|
||||
|
||||
public ServerConnectListener(final MaintenanceBungeePlugin plugin, final SettingsProxy settings) {
|
||||
super(plugin, settings);
|
||||
this.plugin = plugin;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void initialServerConnect(final ServerConnectEvent event) {
|
||||
// Global maintenance check
|
||||
if (event.isCancelled() || event.getReason() != ServerConnectEvent.Reason.JOIN_PROXY) return;
|
||||
if (kickPlayer(new BungeeSenderInfo(event.getPlayer()))) {
|
||||
event.setCancelled(true);
|
||||
event.getPlayer().disconnect(settings.getKickMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void serverConnect(final ServerConnectEvent event) {
|
||||
// Server specific maintenance check
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
final ProxiedPlayer player = event.getPlayer();
|
||||
final ServerInfo target = event.getTarget();
|
||||
if (!plugin.isMaintenance(target)) return;
|
||||
if (plugin.hasPermission(player, "bypass") || settings.getWhitelistedPlayers().containsKey(player.getUniqueId())) return;
|
||||
if (plugin.hasPermission(player, "bypass") || settings.getWhitelistedPlayers().containsKey(player.getUniqueId())
|
||||
|| plugin.hasPermission(player, "singleserver.bypass." + target.getName().toLowerCase()))
|
||||
return;
|
||||
|
||||
if (settings.isJoinNotifications()) {
|
||||
final BaseComponent[] s = TextComponent.fromLegacyText(settings.getMessage("joinNotification").replace("%PLAYER%", player.getName()));
|
||||
target.getPlayers().stream().filter(p -> plugin.hasPermission(p, "joinnotification")).forEach(p -> p.sendMessage(s));
|
||||
for (final ProxiedPlayer p : target.getPlayers()) {
|
||||
if (plugin.hasPermission(p, "joinnotification")) {
|
||||
p.sendMessage(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Normal serverconnect
|
||||
if (event.getReason() != ServerConnectEvent.Reason.JOIN_PROXY && event.getReason() != ServerConnectEvent.Reason.KICK_REDIRECT
|
||||
&& event.getReason() != ServerConnectEvent.Reason.LOBBY_FALLBACK && event.getReason() != ServerConnectEvent.Reason.SERVER_DOWN_REDIRECT) {
|
||||
player.sendMessage(settings.getMessage("singleMaintenanceKick").replace("%SERVER%", target.getName()));
|
||||
event.setCancelled(true);
|
||||
player.sendMessage(settings.getMessage("singleMaintenanceKick").replace("%SERVER%", target.getName()));
|
||||
return;
|
||||
}
|
||||
|
||||
// If it's the initial proxy join or a kick from another server, go back to fallback server
|
||||
final ServerInfo fallback = plugin.getProxy().getServerInfo(settings.getFallbackServer());
|
||||
if (fallback == null || !fallback.canAccess(player) || plugin.isMaintenance(fallback)) {
|
||||
event.setCancelled(true);
|
||||
player.disconnect(settings.getMessage("singleMaintenanceKickComplete").replace("%NEWLINE%", "\n").replace("%SERVER%", target.getName()));
|
||||
if (!warned) {
|
||||
plugin.getLogger().warning("Could not send player to the set fallback server! Instead kicking player off the network!");
|
||||
plugin.getLogger().warning("Could not send player to the set fallback server; instead kicking player off the network!");
|
||||
warned = true;
|
||||
}
|
||||
} else {
|
||||
event.setTarget(fallback);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void broadcastJoinNotification(final String name) {
|
||||
final BaseComponent[] s = TextComponent.fromLegacyText(settings.getMessage("joinNotification").replace("%PLAYER%", name));
|
||||
for (final ProxiedPlayer p : ProxyServer.getInstance().getPlayers()) {
|
||||
if (plugin.hasPermission(p, "joinnotification")) {
|
||||
p.sendMessage(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -22,6 +22,7 @@ import eu.kennytv.maintenance.api.proxy.Server;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
public final class BungeeServer implements Server {
|
||||
private final ServerInfo server;
|
||||
@@ -43,7 +44,9 @@ public final class BungeeServer implements Server {
|
||||
@Override
|
||||
public void broadcast(final String message) {
|
||||
final BaseComponent[] s = TextComponent.fromLegacyText(message);
|
||||
server.getPlayers().forEach(p -> p.sendMessage(s));
|
||||
for (final ProxiedPlayer p : server.getPlayers()) {
|
||||
p.sendMessage(s);
|
||||
}
|
||||
}
|
||||
|
||||
public ServerInfo getServer() {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.kennytv.maintenance</groupId>
|
||||
<artifactId>maintenance-parent</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maintenance-core-proxy</artifactId>
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public abstract class MaintenanceProxyPlugin extends MaintenancePlugin implement
|
||||
|
||||
@Override
|
||||
public boolean isMaintenance(final Server server) {
|
||||
return settingsProxy.isMaintenance(server);
|
||||
return settingsProxy.isMaintenance(server.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-7
@@ -18,7 +18,6 @@
|
||||
|
||||
package eu.kennytv.maintenance.core.proxy;
|
||||
|
||||
import eu.kennytv.maintenance.api.proxy.Server;
|
||||
import eu.kennytv.maintenance.core.Settings;
|
||||
import eu.kennytv.maintenance.core.config.ConfigSection;
|
||||
import eu.kennytv.maintenance.core.proxy.mysql.MySQL;
|
||||
@@ -113,26 +112,26 @@ public final class SettingsProxy extends Settings {
|
||||
return maintenance;
|
||||
}
|
||||
|
||||
public boolean isMaintenance(final Server server) {
|
||||
public boolean isMaintenance(final String serverName) {
|
||||
if (hasMySQL() && System.currentTimeMillis() - lastServerCheck > millisecondsToCheck) {
|
||||
final Set<String> databaseValue = loadMaintenanceServersFromSQL();
|
||||
if (!maintenanceServers.equals(databaseValue)) {
|
||||
final MaintenanceProxyPlugin plugin = (MaintenanceProxyPlugin) super.plugin;
|
||||
// Enable maintenance on yet unlisted servers
|
||||
databaseValue.forEach(s -> {
|
||||
for (final String s : databaseValue) {
|
||||
if (!maintenanceServers.contains(s))
|
||||
plugin.serverActions(plugin.getServer(s), true);
|
||||
});
|
||||
}
|
||||
// Disable maintenance on now unlisted servers
|
||||
maintenanceServers.forEach(s -> {
|
||||
for (final String s : maintenanceServers) {
|
||||
if (!databaseValue.contains(s))
|
||||
plugin.serverActions(plugin.getServer(s), false);
|
||||
});
|
||||
}
|
||||
maintenanceServers = databaseValue;
|
||||
}
|
||||
lastServerCheck = System.currentTimeMillis();
|
||||
}
|
||||
return maintenanceServers.contains(server.getName());
|
||||
return maintenanceServers.contains(serverName);
|
||||
}
|
||||
|
||||
public boolean hasMySQL() {
|
||||
|
||||
+8
-2
@@ -25,8 +25,8 @@ import eu.kennytv.maintenance.core.proxy.SettingsProxy;
|
||||
import eu.kennytv.maintenance.core.proxy.command.subcommand.*;
|
||||
import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class MaintenanceProxyCommand extends MaintenanceCommand {
|
||||
private final MaintenanceProxyPlugin plugin;
|
||||
@@ -50,7 +50,13 @@ public abstract class MaintenanceProxyCommand extends MaintenanceCommand {
|
||||
|
||||
@Override
|
||||
public List<String> getMaintenanceServersCompletion(final String s) {
|
||||
return settingsBungee.getMaintenanceServers().stream().filter(server -> server.toLowerCase().startsWith(s)).collect(Collectors.toList());
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (final String server : settingsBungee.getMaintenanceServers()) {
|
||||
if (server.toLowerCase().startsWith(s)) {
|
||||
list.add(server);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Server checkSingleTimerArgs(final SenderInfo sender, final String[] args) {
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@ import eu.kennytv.maintenance.core.proxy.SettingsProxy;
|
||||
public abstract class ProxyCommandInfo extends CommandInfo {
|
||||
protected final MaintenanceProxyPlugin plugin;
|
||||
|
||||
protected ProxyCommandInfo(final MaintenanceProxyPlugin plugin, final String permission, final String helpMessage) {
|
||||
super(plugin, permission, helpMessage);
|
||||
protected ProxyCommandInfo(final MaintenanceProxyPlugin plugin, final String permission) {
|
||||
super(plugin, permission);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
public final class AbortSingleTimerCommand extends ProxyCommandInfo {
|
||||
|
||||
public AbortSingleTimerCommand(final MaintenanceProxyPlugin plugin) {
|
||||
super(plugin, null, "§6/maintenance aborttimer [server] §7(If running, the current timer will be aborted)");
|
||||
super(plugin, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +63,7 @@ public final class AbortSingleTimerCommand extends ProxyCommandInfo {
|
||||
plugin.cancelSingleTask(server);
|
||||
sender.sendMessage(getMessage("singleTimerCancelled"));
|
||||
} else
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-4
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
public final class SingleEndtimerCommand extends ProxyCommandInfo {
|
||||
|
||||
public SingleEndtimerCommand(final MaintenanceProxyPlugin plugin) {
|
||||
super(plugin, null, "§6/maintenance endtimer [server] <minutes> §7(After the given time in minutes, maintenance mode will be disabled)");
|
||||
super(plugin, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,7 +43,7 @@ public final class SingleEndtimerCommand extends ProxyCommandInfo {
|
||||
if (args.length == 2) {
|
||||
if (checkPermission(sender, "timer")) return;
|
||||
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
if (!plugin.isMaintenance()) {
|
||||
@@ -55,7 +55,7 @@ public final class SingleEndtimerCommand extends ProxyCommandInfo {
|
||||
} else if (args.length == 3) {
|
||||
if (checkPermission(sender, "singleserver.timer")) return;
|
||||
if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public final class SingleEndtimerCommand extends ProxyCommandInfo {
|
||||
final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), false);
|
||||
sender.sendMessage(getMessage("endtimerStarted").replace("%TIME%", runnable.getTime()));
|
||||
} else
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-4
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
public final class SingleStarttimerCommand extends ProxyCommandInfo {
|
||||
|
||||
public SingleStarttimerCommand(final MaintenanceProxyPlugin plugin) {
|
||||
super(plugin, null, "§6/maintenance starttimer [server] <minutes> §7(After the given time in minutes, maintenance mode will be enabled)");
|
||||
super(plugin, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,7 +43,7 @@ public final class SingleStarttimerCommand extends ProxyCommandInfo {
|
||||
if (args.length == 2) {
|
||||
if (checkPermission(sender, "timer")) return;
|
||||
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
if (plugin.isMaintenance()) {
|
||||
@@ -56,7 +56,7 @@ public final class SingleStarttimerCommand extends ProxyCommandInfo {
|
||||
} else if (args.length == 3) {
|
||||
if (checkPermission(sender, "singleserver.timer")) return;
|
||||
if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public final class SingleStarttimerCommand extends ProxyCommandInfo {
|
||||
final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), true);
|
||||
sender.sendMessage(getMessage("starttimerStarted").replace("%TIME%", runnable.getTime()));
|
||||
} else
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
public final class SingleToggleCommand extends ProxyCommandInfo {
|
||||
|
||||
public SingleToggleCommand(final MaintenanceProxyPlugin plugin) {
|
||||
super(plugin, null, "§6/maintenance <on/off> [server] §7(Enables/disables maintenance mode)");
|
||||
super(plugin, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,7 +72,7 @@ public final class SingleToggleCommand extends ProxyCommandInfo {
|
||||
} else
|
||||
sender.sendMessage(getMessage(maintenance ? "singleServerAlreadyEnabled" : "singleServerAlreadyDisabled").replace("%SERVER%", server.getName()));
|
||||
} else
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-2
@@ -25,7 +25,7 @@ import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
public final class StatusCommand extends ProxyCommandInfo {
|
||||
|
||||
public StatusCommand(final MaintenanceProxyPlugin plugin) {
|
||||
super(plugin, "singleserver.status", "§6/maintenance status §7(Lists all proxied servers, that are currently under maintenance)");
|
||||
super(plugin, "singleserver.status");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -34,7 +34,9 @@ public final class StatusCommand extends ProxyCommandInfo {
|
||||
sender.sendMessage(getMessage("singleServerMaintenanceListEmpty"));
|
||||
} else {
|
||||
sender.sendMessage(getMessage("singleServerMaintenanceList"));
|
||||
getSettings().getMaintenanceServers().forEach(server -> sender.sendMessage("§8- §b" + server));
|
||||
for (final String server : getSettings().getMaintenanceServers()) {
|
||||
sender.sendMessage("§8- §b" + server);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.kennytv.maintenance</groupId>
|
||||
<artifactId>maintenance-parent</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maintenance-core</artifactId>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package eu.kennytv.maintenance.core;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.io.CharStreams;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -84,7 +85,9 @@ public abstract class MaintenancePlugin implements IMaintenance {
|
||||
serverListPlusHook.setEnabled(!maintenance);
|
||||
|
||||
if (maintenance) {
|
||||
kickPlayers();
|
||||
if (settings.isKickOnlinePlayers()) {
|
||||
kickPlayers();
|
||||
}
|
||||
broadcast(settings.getMessage("maintenanceActivated"));
|
||||
} else
|
||||
broadcast(settings.getMessage("maintenanceDeactivated"));
|
||||
@@ -153,7 +156,7 @@ public abstract class MaintenancePlugin implements IMaintenance {
|
||||
getLogger().info("§cNewest version available: §aVersion " + newestVersion + "§c, you're on §a" + version);
|
||||
} else if (compare == 1) {
|
||||
if (version.getTag().equalsIgnoreCase("snapshot")) {
|
||||
getLogger().info("§cYou're running a development version, please report bugs on the Discord server (https://kennytv.eu/discord) or the GitHub issue tracker (https://kennytv.eu/maintenance/issues)");
|
||||
getLogger().info("§cYou're running a development version, please report bugs on the Discord server (https://discord.gg/vGCUzHq) or the GitHub issue tracker (https://github.com/KennyTV/Maintenance/issues)");
|
||||
} else {
|
||||
getLogger().info("§cYou're running a version, that doesn't exist! §cN§ai§dc§ee§5!");
|
||||
}
|
||||
@@ -165,7 +168,8 @@ public abstract class MaintenancePlugin implements IMaintenance {
|
||||
// Ore sad :(
|
||||
Preconditions.checkArgument(serverType != ServerType.SPONGE);
|
||||
try {
|
||||
final URLConnection conn = new URL("https://github.com/KennyTV/Maintenance/releases/download/" + newestVersion + "/Maintenance.jar").openConnection();
|
||||
final String fileSuffix = serverType == ServerType.VELOCITY ? "Velocity" : "";
|
||||
final URLConnection conn = new URL("https://github.com/KennyTV/Maintenance/releases/download/" + newestVersion + "/Maintenance" + fileSuffix + ".jar").openConnection();
|
||||
writeFile(new BufferedInputStream(conn.getInputStream()), new BufferedOutputStream(new FileOutputStream(getPluginFolder() + "Maintenance.tmp")));
|
||||
final File file = new File(getPluginFolder() + "Maintenance.tmp");
|
||||
final long newlength = file.length();
|
||||
@@ -216,11 +220,8 @@ public abstract class MaintenancePlugin implements IMaintenance {
|
||||
connection.setRequestProperty("Content-Type", "text/plain");
|
||||
|
||||
final GsonBuilder gsonBuilder = new GsonBuilder();
|
||||
final byte[] bytes = gsonBuilder.setPrettyPrinting().create().toJson(dump).getBytes(StandardCharsets.UTF_8);
|
||||
connection.setRequestProperty("Content-Length", Integer.toString(bytes.length));
|
||||
|
||||
final OutputStream out = connection.getOutputStream();
|
||||
out.write(bytes);
|
||||
out.write(gsonBuilder.disableHtmlEscaping().setPrettyPrinting().create().toJson(dump).getBytes(StandardCharsets.UTF_8));
|
||||
out.close();
|
||||
|
||||
if (connection.getResponseCode() == 503) {
|
||||
@@ -279,6 +280,12 @@ public abstract class MaintenancePlugin implements IMaintenance {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public String[] removeArrayIndex(final String[] args, final int index) {
|
||||
final List<String> argsList = Lists.newArrayList(args);
|
||||
argsList.remove(index);
|
||||
return argsList.toArray(new String[0]);
|
||||
}
|
||||
|
||||
public boolean isNumeric(final String string) {
|
||||
return string.matches("[0-9]+");
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class Settings implements ISettings {
|
||||
private static final int CURRENT_CONFIG_VERSION = 1;
|
||||
private static final int CURRENT_CONFIG_VERSION = 3;
|
||||
private static final Random RANDOM = new Random();
|
||||
protected final MaintenancePlugin plugin;
|
||||
private final Map<UUID, String> whitelistedPlayers = new HashMap<>();
|
||||
@@ -39,6 +39,7 @@ public class Settings implements ISettings {
|
||||
protected boolean maintenance;
|
||||
private Set<Integer> broadcastIntervals;
|
||||
private List<String> pingMessages;
|
||||
private List<String> timerSpecificPingMessages;
|
||||
private String playerCountMessage;
|
||||
private String playerCountHoverMessage;
|
||||
private String languageName;
|
||||
@@ -47,6 +48,7 @@ public class Settings implements ISettings {
|
||||
private boolean joinNotifications;
|
||||
private boolean updateChecks;
|
||||
private boolean saveEndtimerOnStop;
|
||||
private boolean kickOnlinePlayers;
|
||||
private boolean debug;
|
||||
private long savedEndtimer;
|
||||
|
||||
@@ -88,6 +90,8 @@ public class Settings implements ISettings {
|
||||
throw new RuntimeException("Unable to load Maintenance language file!", e);
|
||||
}
|
||||
|
||||
updateLanguageFile();
|
||||
|
||||
// Directly save colored messages
|
||||
for (final Map.Entry<String, Object> entry : language.getValues().entrySet()) {
|
||||
if (!(entry.getValue() instanceof String)) continue;
|
||||
@@ -114,7 +118,7 @@ public class Settings implements ISettings {
|
||||
try (final InputStream in = plugin.getResource(from)) {
|
||||
Files.copy(in, file.toPath());
|
||||
} catch (final IOException e) {
|
||||
throw new RuntimeException("Unable to create " + name + " file for Maintenance!", e);
|
||||
throw new IllegalArgumentException("Unable to create " + name + " file for Maintenance!", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,6 +151,8 @@ public class Settings implements ISettings {
|
||||
updateConfig();
|
||||
|
||||
pingMessages = config.getStringList("pingmessages");
|
||||
if (config.getBoolean("enable-timerspecific-messages"))
|
||||
timerSpecificPingMessages = config.getStringList("timerspecific-pingmessages");
|
||||
maintenance = config.getBoolean("maintenance-enabled");
|
||||
customPlayerCountMessage = config.getBoolean("enable-playercountmessage");
|
||||
customMaintenanceIcon = config.getBoolean("custom-maintenance-icon");
|
||||
@@ -156,6 +162,7 @@ public class Settings implements ISettings {
|
||||
playerCountMessage = getColoredString(getConfigString("playercountmessage"));
|
||||
playerCountHoverMessage = getColoredString(getConfigString("playercounthovermessage"));
|
||||
languageName = getConfigString("language").toLowerCase();
|
||||
kickOnlinePlayers = config.getBoolean("kick-online-players", true);
|
||||
updateChecks = config.getBoolean("update-checks", true);
|
||||
debug = config.getBoolean("debug");
|
||||
final ConfigSection section = config.getSection("continue-endtimer-after-restart");
|
||||
@@ -166,13 +173,13 @@ public class Settings implements ISettings {
|
||||
}
|
||||
|
||||
whitelistedPlayers.clear();
|
||||
whitelist.getValues().forEach((key, value) -> {
|
||||
for (final Map.Entry<String, Object> entry : whitelist.getValues().entrySet()) {
|
||||
try {
|
||||
whitelistedPlayers.put(UUID.fromString(key), (String) value);
|
||||
whitelistedPlayers.put(UUID.fromString(entry.getKey()), (String) entry.getValue());
|
||||
} catch (final Exception e) {
|
||||
plugin.getLogger().warning("invalid WhitelistedPlayers entry: " + key);
|
||||
plugin.getLogger().warning("invalid WhitelistedPlayers entry: " + entry.getKey());
|
||||
}
|
||||
});
|
||||
}
|
||||
loadExtraSettings();
|
||||
}
|
||||
|
||||
@@ -223,12 +230,46 @@ public class Settings implements ISettings {
|
||||
|
||||
file.delete();
|
||||
tempConfig.clear();
|
||||
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
saveConfig();
|
||||
plugin.getLogger().info("Done! Updated config(s) to the latest version!");
|
||||
plugin.getLogger().info("Done! Updated config!");
|
||||
}
|
||||
}
|
||||
|
||||
private void updateLanguageFile() {
|
||||
final String s = "language-" + languageName;
|
||||
try {
|
||||
createFile(s + "-new.yml", s + ".yml");
|
||||
} catch (final IllegalArgumentException e) {
|
||||
plugin.getLogger().warning("Couldn't update language file, as the " + s + ".yml wasn't found in the resource files!");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
final File file = new File(plugin.getDataFolder(), s + "-new.yml");
|
||||
final Config tempConfig = new Config(file);
|
||||
try {
|
||||
tempConfig.load();
|
||||
} catch (final IOException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean updated = language.addMissingFields(tempConfig.getValues(), tempConfig.getComments());
|
||||
tempConfig.clear();
|
||||
file.delete();
|
||||
if (updated) {
|
||||
try {
|
||||
language.save();
|
||||
} catch (final IOException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
plugin.getLogger().info("Updated language file!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,10 +290,10 @@ public class Settings implements ISettings {
|
||||
config.set("pingmessages", Arrays.asList(oldConfig.getString("pingmessage")));
|
||||
if (oldConfig.contains("enable-maintenance-mode"))
|
||||
config.set("maintenance-enabled", oldConfig.getBoolean("enable-maintenance-mode"));
|
||||
config.getValues().entrySet().forEach(entry -> {
|
||||
if (!oldConfig.contains(entry.getKey())) return;
|
||||
for (final Map.Entry<String, Object> entry : config.getValues().entrySet()) {
|
||||
if (!oldConfig.contains(entry.getKey())) continue;
|
||||
entry.setValue(oldConfig.get(entry.getKey()));
|
||||
});
|
||||
}
|
||||
|
||||
oldConfig.clear();
|
||||
if (!file.delete())
|
||||
@@ -323,8 +364,15 @@ public class Settings implements ISettings {
|
||||
}
|
||||
|
||||
public String getRandomPingMessage() {
|
||||
if (pingMessages.isEmpty()) return "";
|
||||
final String s = pingMessages.size() == 1 ? pingMessages.get(0) : pingMessages.get(RANDOM.nextInt(pingMessages.size()));
|
||||
if (plugin.isTaskRunning() && !plugin.getRunnable().shouldEnable()
|
||||
&& hasTimerSpecificPingMessages() && !timerSpecificPingMessages.isEmpty()) {
|
||||
return getPingMessage(timerSpecificPingMessages);
|
||||
}
|
||||
return pingMessages.isEmpty() ? "" : getPingMessage(pingMessages);
|
||||
}
|
||||
|
||||
private String getPingMessage(final List<String> list) {
|
||||
final String s = list.size() == 1 ? list.get(0) : list.get(RANDOM.nextInt(list.size()));
|
||||
return getColoredString(plugin.formatedTimer(s).replace("%NEWLINE%", "\n"));
|
||||
}
|
||||
|
||||
@@ -340,10 +388,15 @@ public class Settings implements ISettings {
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean removeWhitelistedPlayer(final String name) {
|
||||
final Map.Entry<UUID, String> entry = whitelistedPlayers.entrySet().stream().filter(e -> e.getValue().equalsIgnoreCase(name)).findAny().orElse(null);
|
||||
if (entry == null) return false;
|
||||
UUID uuid = null;
|
||||
for (final Map.Entry<UUID, String> e : whitelistedPlayers.entrySet()) {
|
||||
if (e.getValue().equalsIgnoreCase(name)) {
|
||||
uuid = e.getKey();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (uuid == null) return false;
|
||||
|
||||
final UUID uuid = entry.getKey();
|
||||
whitelistedPlayers.remove(uuid);
|
||||
whitelist.remove(uuid.toString());
|
||||
saveWhitelistedPlayers();
|
||||
@@ -396,6 +449,14 @@ public class Settings implements ISettings {
|
||||
return saveEndtimerOnStop;
|
||||
}
|
||||
|
||||
public boolean hasTimerSpecificPingMessages() {
|
||||
return timerSpecificPingMessages != null;
|
||||
}
|
||||
|
||||
public boolean isKickOnlinePlayers() {
|
||||
return kickOnlinePlayers;
|
||||
}
|
||||
|
||||
public long getSavedEndtimer() {
|
||||
return savedEndtimer;
|
||||
}
|
||||
@@ -415,6 +476,13 @@ public class Settings implements ISettings {
|
||||
return pingMessages;
|
||||
}
|
||||
|
||||
/**
|
||||
* May be null
|
||||
*/
|
||||
public List<String> getTimerSpecificPingMessages() {
|
||||
return timerSpecificPingMessages;
|
||||
}
|
||||
|
||||
public Set<Integer> getBroadcastIntervals() {
|
||||
return broadcastIntervals;
|
||||
}
|
||||
|
||||
@@ -27,13 +27,14 @@ import java.util.List;
|
||||
|
||||
public abstract class CommandInfo {
|
||||
protected final MaintenancePlugin plugin;
|
||||
protected final String helpMessage;
|
||||
private final String helpMessageKey;
|
||||
private final String permission;
|
||||
|
||||
protected CommandInfo(final MaintenancePlugin plugin, final String permission, final String helpMessage) {
|
||||
protected CommandInfo(final MaintenancePlugin plugin, final String permission) {
|
||||
this.plugin = plugin;
|
||||
this.permission = permission;
|
||||
this.helpMessage = helpMessage;
|
||||
// Just take the class name as the language key
|
||||
this.helpMessageKey = "help" + getClass().getSimpleName().replace("Command", "");
|
||||
}
|
||||
|
||||
public boolean hasPermission(final SenderInfo sender) {
|
||||
@@ -41,7 +42,7 @@ public abstract class CommandInfo {
|
||||
}
|
||||
|
||||
public String getHelpMessage() {
|
||||
return helpMessage;
|
||||
return getMessage(helpMessageKey);
|
||||
}
|
||||
|
||||
public List<String> getTabCompletion(final SenderInfo sender, final String[] args) {
|
||||
@@ -60,7 +61,7 @@ public abstract class CommandInfo {
|
||||
|
||||
protected boolean checkArgs(final SenderInfo sender, final String[] args, final int length) {
|
||||
if (args.length != length) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
+11
-3
@@ -25,7 +25,6 @@ import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
import eu.kennytv.maintenance.core.util.ServerType;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class MaintenanceCommand {
|
||||
protected final MaintenancePlugin plugin;
|
||||
@@ -91,8 +90,17 @@ public abstract class MaintenanceCommand {
|
||||
public List<String> getSuggestions(final SenderInfo sender, final String[] args) {
|
||||
if (!sender.hasMaintenancePermission("command") || args.length == 0) return Collections.emptyList();
|
||||
final String s = args[0].toLowerCase();
|
||||
if (args.length == 1)
|
||||
return commandExecutors.entrySet().stream().filter(entry -> entry.getKey().startsWith(s) && entry.getValue().hasPermission(sender)).map(Map.Entry::getKey).collect(Collectors.toList());
|
||||
if (args.length == 1) {
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (final Map.Entry<String, CommandInfo> entry : commandExecutors.entrySet()) {
|
||||
final String command = entry.getKey();
|
||||
if (command.startsWith(s) && entry.getValue().hasPermission(sender)) {
|
||||
list.add(command);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
final CommandInfo info = commandExecutors.get(args[0]);
|
||||
return info != null && info.hasPermission(sender) ? info.getTabCompletion(sender, args) : Collections.emptyList();
|
||||
}
|
||||
|
||||
+2
-2
@@ -25,13 +25,13 @@ import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
public final class AbortTimerCommand extends CommandInfo {
|
||||
|
||||
public AbortTimerCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "timer", "§6/maintenance aborttimer §7(If running, the current timer will be aborted)");
|
||||
super(plugin, "timer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final SenderInfo sender, final String[] args) {
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public final class DumpCommand extends CommandInfo {
|
||||
private long lastDump;
|
||||
|
||||
public DumpCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "dump", "§6/maintenance dump §7(Dumps some server information, used for bug reports)");
|
||||
super(plugin, "dump");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -25,14 +25,14 @@ import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
public final class EndtimerCommand extends CommandInfo {
|
||||
|
||||
public EndtimerCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "timer", "§6/maintenance endtimer <minutes> §7(After the given time in minutes, maintenance mode will be disabled)");
|
||||
super(plugin, "timer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final SenderInfo sender, final String[] args) {
|
||||
if (checkArgs(sender, args, 2)) return;
|
||||
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
if (!plugin.isMaintenance()) {
|
||||
|
||||
+16
-8
@@ -23,20 +23,20 @@ import eu.kennytv.maintenance.core.MaintenancePlugin;
|
||||
import eu.kennytv.maintenance.core.command.CommandInfo;
|
||||
import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public final class HelpCommand extends CommandInfo {
|
||||
private static final int COMMANDS_PER_PAGE = 8;
|
||||
|
||||
public HelpCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, null, "§6/maintenance help [page] §7(Shows this beautiful help window)");
|
||||
super(plugin, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final SenderInfo sender, final String[] args) {
|
||||
if (args.length > 2) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public final class HelpCommand extends CommandInfo {
|
||||
sendUsage(sender);
|
||||
} else {
|
||||
if (!plugin.isNumeric(args[1])) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,12 @@ public final class HelpCommand extends CommandInfo {
|
||||
|
||||
public void sendUsage(final SenderInfo sender, final int page) {
|
||||
Preconditions.checkArgument(page > 0);
|
||||
final List<String> commands = plugin.getCommandManager().getCommands().stream().filter(cmd -> cmd.hasPermission(sender)).map(CommandInfo::getHelpMessage).collect(Collectors.toList());
|
||||
final List<String> commands = new ArrayList<>();
|
||||
for (final CommandInfo cmd : plugin.getCommandManager().getCommands()) {
|
||||
if (cmd.hasPermission(sender)) {
|
||||
commands.add(cmd.getHelpMessage());
|
||||
}
|
||||
}
|
||||
if ((page - 1) * COMMANDS_PER_PAGE >= commands.size()) {
|
||||
sender.sendMessage(getMessage("helpPageNotFound"));
|
||||
return;
|
||||
@@ -71,12 +76,15 @@ public final class HelpCommand extends CommandInfo {
|
||||
else
|
||||
filteredCommands = commands.subList((page - 1) * COMMANDS_PER_PAGE, page * COMMANDS_PER_PAGE);
|
||||
|
||||
final String header = "§8========[ §eMaintenance" + plugin.getServerType() + " §8| §e" + page + "/" + ((commands.size() + getDivide(commands.size())) / COMMANDS_PER_PAGE) + " §8]========";
|
||||
final String header = getMessage("helpHeader").replace("%NAME%", "Maintenance" + plugin.getServerType())
|
||||
.replace("%PAGE%", Integer.toString(page)).replace("%MAX%", Integer.toString((commands.size() + getDivide(commands.size())) / COMMANDS_PER_PAGE));
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage(header);
|
||||
filteredCommands.forEach(sender::sendMessage);
|
||||
for (final String command : filteredCommands) {
|
||||
sender.sendMessage(command);
|
||||
}
|
||||
if (page * COMMANDS_PER_PAGE < commands.size())
|
||||
sender.sendMessage("§7Use §b/maintenance help " + (page + 1) + " §7to get to the next help window.");
|
||||
sender.sendMessage(getMessage("helpNextPage").replace("%PAGE%", Integer.toString(page + 1)));
|
||||
else
|
||||
sender.sendMessage("§8× §eVersion " + plugin.getVersion() + " §7by §bKennyTV");
|
||||
sender.sendMessage(header);
|
||||
|
||||
+31
-4
@@ -22,22 +22,49 @@ import eu.kennytv.maintenance.core.MaintenancePlugin;
|
||||
import eu.kennytv.maintenance.core.command.CommandInfo;
|
||||
import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public final class MotdCommand extends CommandInfo {
|
||||
|
||||
public MotdCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "motd", "§6/maintenance motd §7(Lists the currently set maintenance motds)");
|
||||
super(plugin, "motd");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final SenderInfo sender, final String[] args) {
|
||||
if (checkArgs(sender, args, 1)) return;
|
||||
if (args.length == 1) {
|
||||
sendList(sender, getSettings().getPingMessages());
|
||||
} else if (args.length == 2 && args[1].equalsIgnoreCase("timer")) {
|
||||
if (!getSettings().hasTimerSpecificPingMessages()) {
|
||||
sender.sendMessage(getMessage("timerMotdDisabled"));
|
||||
return;
|
||||
}
|
||||
|
||||
sendList(sender, getSettings().getTimerSpecificPingMessages());
|
||||
} else
|
||||
sender.sendMessage(getHelpMessage());
|
||||
}
|
||||
|
||||
private void sendList(final SenderInfo sender, final List<String> list) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
sender.sendMessage(getMessage("motdListEmpty"));
|
||||
return;
|
||||
}
|
||||
|
||||
sender.sendMessage(getMessage("motdList"));
|
||||
for (int i = 0; i < getSettings().getPingMessages().size(); i++) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
sender.sendMessage("§b" + (i + 1) + "§8§m---------");
|
||||
for (final String motd : getSettings().getColoredString(getSettings().getPingMessages().get(i)).split("%NEWLINE%")) {
|
||||
for (final String motd : getSettings().getColoredString(list.get(i)).split("%NEWLINE%")) {
|
||||
sender.sendMessage(motd);
|
||||
}
|
||||
}
|
||||
sender.sendMessage("§8§m----------");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletion(final SenderInfo sender, final String[] args) {
|
||||
if (args.length != 2 || !getSettings().hasTimerSpecificPingMessages()) return Collections.emptyList();
|
||||
return Collections.singletonList("timer");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -25,7 +25,7 @@ import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
public final class ReloadCommand extends CommandInfo {
|
||||
|
||||
public ReloadCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "reload", "§6/maintenance reload §7(Reloads the config file, whitelist file and the server-icon)");
|
||||
super(plugin, "reload");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+28
-15
@@ -30,44 +30,57 @@ import java.util.List;
|
||||
public final class RemoveMotdCommand extends CommandInfo {
|
||||
|
||||
public RemoveMotdCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "setmotd", "§6/maintenance removemotd <index> §7(Removes a maintenance motd)");
|
||||
super(plugin, "setmotd");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final SenderInfo sender, final String[] args) {
|
||||
public void execute(final SenderInfo sender, String[] args) {
|
||||
boolean timerPingMessages = false;
|
||||
if (args.length == 3 && args[1].equalsIgnoreCase("timer")) {
|
||||
if (!getSettings().hasTimerSpecificPingMessages()) {
|
||||
sender.sendMessage(getMessage("timerMotdDisabled"));
|
||||
return;
|
||||
}
|
||||
|
||||
args = plugin.removeArrayIndex(args, 1);
|
||||
timerPingMessages = true;
|
||||
}
|
||||
if (checkArgs(sender, args, 2)) return;
|
||||
if (!plugin.isNumeric(args[1])) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
final Settings settings = getSettings();
|
||||
if (settings.getPingMessages().size() < 2) {
|
||||
final List<String> pingMessages = timerPingMessages ? settings.getTimerSpecificPingMessages() : settings.getPingMessages();
|
||||
if (pingMessages.size() < 2) {
|
||||
sender.sendMessage(getMessage("removeMotdError"));
|
||||
return;
|
||||
}
|
||||
|
||||
final int index = Integer.parseInt(args[1]);
|
||||
if (index == 0 || index > settings.getPingMessages().size()) {
|
||||
sender.sendMessage(getMessage("setMotdIndexError").replace("%MOTDS%", Integer.toString(settings.getPingMessages().size()))
|
||||
.replace("%NEWAMOUNT%", Integer.toString(settings.getPingMessages().size())));
|
||||
if (index == 0 || index > pingMessages.size()) {
|
||||
sender.sendMessage(getMessage("setMotdIndexError").replace("%MOTDS%", Integer.toString(pingMessages.size()))
|
||||
.replace("%NEWAMOUNT%", Integer.toString(pingMessages.size())));
|
||||
return;
|
||||
}
|
||||
|
||||
settings.getPingMessages().remove(index - 1);
|
||||
settings.getConfig().set("pingmessages", settings.getPingMessages());
|
||||
pingMessages.remove(index - 1);
|
||||
settings.getConfig().set(timerPingMessages ? "timerspecific-pingmessages" : "pingmessages", pingMessages);
|
||||
settings.saveConfig();
|
||||
sender.sendMessage(getMessage("removedMotd").replace("%INDEX%", args[1]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletion(final SenderInfo sender, final String[] args) {
|
||||
if (args.length != 2) return Collections.emptyList();
|
||||
final int size = plugin.getSettings().getPingMessages().size();
|
||||
final List<String> list = new ArrayList<>(size);
|
||||
for (int i = 1; i <= size; i++) {
|
||||
list.add(String.valueOf(i));
|
||||
if (args.length == 2 || (args.length == 3 && args[1].equalsIgnoreCase("timer"))) {
|
||||
final int size = (args.length == 3 ? plugin.getSettings().getTimerSpecificPingMessages() : plugin.getSettings().getPingMessages()).size();
|
||||
final List<String> list = new ArrayList<>(size);
|
||||
for (int i = 1; i <= size; i++) {
|
||||
list.add(String.valueOf(i));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
+33
-15
@@ -31,21 +31,33 @@ import java.util.List;
|
||||
public final class SetMotdCommand extends CommandInfo {
|
||||
|
||||
public SetMotdCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "setmotd", "§6/maintenance setmotd <index> <1/2> <message> §7(Sets a motd for maintenance mode)");
|
||||
super(plugin, "setmotd");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final SenderInfo sender, final String[] args) {
|
||||
public void execute(final SenderInfo sender, String[] args) {
|
||||
boolean timerPingMessages = false;
|
||||
if (args.length > 1 && args[1].equalsIgnoreCase("timer")) {
|
||||
if (!getSettings().hasTimerSpecificPingMessages()) {
|
||||
sender.sendMessage(getMessage("timerMotdDisabled"));
|
||||
return;
|
||||
}
|
||||
|
||||
// remove the "timer" off the args to keep the rest the code cleaner
|
||||
args = plugin.removeArrayIndex(args, 1);
|
||||
timerPingMessages = true;
|
||||
}
|
||||
if (args.length < 4 || !plugin.isNumeric(args[1])) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
final Settings settings = getSettings();
|
||||
final List<String> pingMessages = timerPingMessages ? settings.getTimerSpecificPingMessages() : settings.getPingMessages();
|
||||
final int index = Integer.parseInt(args[1]);
|
||||
if (index == 0 || index > settings.getPingMessages().size() + 1) {
|
||||
sender.sendMessage(getMessage("setMotdIndexError").replace("%MOTDS%", Integer.toString(settings.getPingMessages().size()))
|
||||
.replace("%NEWAMOUNT%", Integer.toString(settings.getPingMessages().size() + 1)));
|
||||
if (index == 0 || index > pingMessages.size() + 1) {
|
||||
sender.sendMessage(getMessage("setMotdIndexError").replace("%MOTDS%", Integer.toString(pingMessages.size()))
|
||||
.replace("%NEWAMOUNT%", Integer.toString(pingMessages.size() + 1)));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -61,31 +73,37 @@ public final class SetMotdCommand extends CommandInfo {
|
||||
}
|
||||
|
||||
final String message = String.join(" ", Arrays.copyOfRange(args, 3, args.length));
|
||||
final String oldMessage = index > settings.getPingMessages().size() ? "" : settings.getPingMessages().get(index - 1);
|
||||
final String oldMessage = index > pingMessages.size() ? "" : pingMessages.get(index - 1);
|
||||
final String newMessage;
|
||||
if (line == 1)
|
||||
if (line == 1) {
|
||||
newMessage = oldMessage.contains("%NEWLINE%") ?
|
||||
message + "%NEWLINE%" + oldMessage.split("%NEWLINE%", 2)[1] : message;
|
||||
else
|
||||
} else {
|
||||
newMessage = oldMessage.contains("%NEWLINE%") ?
|
||||
oldMessage.split("%NEWLINE%", 2)[0] + "%NEWLINE%" + message : oldMessage + "%NEWLINE%" + message;
|
||||
}
|
||||
|
||||
if (index > settings.getPingMessages().size())
|
||||
settings.getPingMessages().add(newMessage);
|
||||
if (index > pingMessages.size())
|
||||
pingMessages.add(newMessage);
|
||||
else
|
||||
settings.getPingMessages().set(index - 1, newMessage);
|
||||
settings.getConfig().set("pingmessages", settings.getPingMessages());
|
||||
pingMessages.set(index - 1, newMessage);
|
||||
settings.getConfig().set(timerPingMessages ? "timerspecific-pingmessages" : "pingmessages", pingMessages);
|
||||
settings.saveConfig();
|
||||
sender.sendMessage(settings.getMessage("setMotd").replace("%LINE%", args[2]).replace("%INDEX%", args[1])
|
||||
.replace("%MOTD%", "§f" + settings.getColoredString(message)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletion(final SenderInfo sender, final String[] args) {
|
||||
public List<String> getTabCompletion(final SenderInfo sender, String[] args) {
|
||||
boolean timer = false;
|
||||
if (args.length > 1 && args[1].equalsIgnoreCase("timer")) {
|
||||
args = plugin.removeArrayIndex(args, 1);
|
||||
timer = true;
|
||||
}
|
||||
if (args.length == 3) return Arrays.asList("1", "2");
|
||||
if (args.length == 2) {
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (int i = 1; i <= getSettings().getPingMessages().size() + 1; i++) {
|
||||
for (int i = 1; i <= (timer ? getSettings().getTimerSpecificPingMessages() : getSettings().getPingMessages()).size() + 1; i++) {
|
||||
list.add(String.valueOf(i));
|
||||
}
|
||||
return list;
|
||||
|
||||
+2
-2
@@ -25,14 +25,14 @@ import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
public final class StarttimerCommand extends CommandInfo {
|
||||
|
||||
public StarttimerCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "timer", "§6/maintenance starttimer <minutes> §7(After the given time in minutes, maintenance mode will be enabled)");
|
||||
super(plugin, "timer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final SenderInfo sender, final String[] args) {
|
||||
if (checkArgs(sender, args, 2)) return;
|
||||
if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) {
|
||||
sender.sendMessage(helpMessage);
|
||||
sender.sendMessage(getHelpMessage());
|
||||
return;
|
||||
}
|
||||
if (plugin.isMaintenance()) {
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
public final class ToggleCommand extends CommandInfo {
|
||||
|
||||
public ToggleCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "toggle", "§6/maintenance <on/off> §7(Enables/disables maintenance mode)");
|
||||
super(plugin, "toggle");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import eu.kennytv.maintenance.core.util.ServerType;
|
||||
public final class UpdateCommand extends CommandInfo {
|
||||
|
||||
public UpdateCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "update", "§6/maintenance update §7(Remotely downloads the newest version of the plugin onto your server)");
|
||||
super(plugin, "update");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import java.util.UUID;
|
||||
public final class WhitelistAddCommand extends CommandInfo {
|
||||
|
||||
public WhitelistAddCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "whitelist.add", "§6/maintenance add <name/uuid> §7(Adds the player to the maintenance whitelist, so they can join the server even though maintenance is enabled)");
|
||||
super(plugin, "whitelist.add");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-2
@@ -28,7 +28,7 @@ import java.util.UUID;
|
||||
public final class WhitelistCommand extends CommandInfo {
|
||||
|
||||
public WhitelistCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "whitelist.list", "§6/maintenance whitelist §7(Shows all whitelisted players for the maintenance mode)");
|
||||
super(plugin, "whitelist.list");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,7 +41,9 @@ public final class WhitelistCommand extends CommandInfo {
|
||||
} else {
|
||||
sender.sendMessage(getMessage("whitelistedPlayers"));
|
||||
final String format = getMessage("whitelistedPlayersFormat");
|
||||
players.forEach((key, value) -> sender.sendMessage(format.replace("%NAME%", value).replace("%UUID%", key.toString())));
|
||||
for (final Map.Entry<UUID, String> entry : players.entrySet()) {
|
||||
sender.sendMessage(format.replace("%NAME%", entry.getValue()).replace("%UUID%", entry.getKey().toString()));
|
||||
}
|
||||
sender.sendMessage("");
|
||||
}
|
||||
}
|
||||
|
||||
+11
-4
@@ -22,15 +22,15 @@ import eu.kennytv.maintenance.core.MaintenancePlugin;
|
||||
import eu.kennytv.maintenance.core.command.CommandInfo;
|
||||
import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public final class WhitelistRemoveCommand extends CommandInfo {
|
||||
|
||||
public WhitelistRemoveCommand(final MaintenancePlugin plugin) {
|
||||
super(plugin, "whitelist.remove", "§6/maintenance remove <name/uuid> §7(Removes the player from the maintenance whitelist)");
|
||||
super(plugin, "whitelist.remove");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,8 +46,15 @@ public final class WhitelistRemoveCommand extends CommandInfo {
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletion(final SenderInfo sender, final String[] args) {
|
||||
return args.length == 2 ? getSettings().getWhitelistedPlayers().values().stream()
|
||||
.filter(name -> name.toLowerCase().startsWith(args[1])).collect(Collectors.toList()) : Collections.emptyList();
|
||||
if (args.length != 2) return Collections.emptyList();
|
||||
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (final String name : getSettings().getWhitelistedPlayers().values()) {
|
||||
if (name.toLowerCase().startsWith(args[1])) {
|
||||
list.add(name);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void removePlayerFromWhitelist(final SenderInfo sender, final String name) {
|
||||
|
||||
@@ -96,8 +96,9 @@ public final class Config extends ConfigSection {
|
||||
Files.write(this.file.toPath(), bytes);
|
||||
}
|
||||
|
||||
public void addMissingFields(final Map<String, Object> fields, final Map<String, String[]> comments) {
|
||||
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) {
|
||||
@@ -108,14 +109,17 @@ public final class Config extends ConfigSection {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,34 +138,12 @@ public final class Config extends ConfigSection {
|
||||
this.comments.remove(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method, not further established as currently not necessary.
|
||||
*
|
||||
* @see #getSection(String)
|
||||
* @deprecated this config is only made for a quite simple use, only goes one level deeper
|
||||
*/
|
||||
@Deprecated
|
||||
public Object getDeep(final String key) {
|
||||
final String[] split = key.split("\\.", 2);
|
||||
if (split.length != 2) return get(key);
|
||||
|
||||
final Object o = getObject(split[0]);
|
||||
if (!(o instanceof Map)) return null;
|
||||
|
||||
final Map<String, Object> map = (Map<String, Object>) o;
|
||||
return map.get(split[1]);
|
||||
}
|
||||
|
||||
public ConfigSection getSection(final String key) {
|
||||
final Object o = getObject(key);
|
||||
return o instanceof Map ? new ConfigSection((Map<String, Object>) o) : null;
|
||||
}
|
||||
|
||||
private static Yaml createYaml() {
|
||||
final DumperOptions options = new DumperOptions();
|
||||
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
options.setPrettyFlow(false);
|
||||
options.setIndent(2);
|
||||
options.setWidth(10_000); // be sneaky because autobreak on read/save looks disgusting
|
||||
return new Yaml(options);
|
||||
}
|
||||
|
||||
|
||||
+43
-17
@@ -45,7 +45,8 @@ public class ConfigSection {
|
||||
}
|
||||
|
||||
public <E> E get(final String key, final E def) {
|
||||
return values.containsKey(key) ? (E) this.values.get(key) : def;
|
||||
final Object o = this.values.get(key);
|
||||
return o != null ? (E) o : def;
|
||||
}
|
||||
|
||||
public Object getObject(final String key) {
|
||||
@@ -53,14 +54,38 @@ public class ConfigSection {
|
||||
}
|
||||
|
||||
public <E> E getOrSet(final String key, final E def) {
|
||||
if (this.values.containsKey(key)) {
|
||||
return (E) this.values.get(key);
|
||||
final Object o = this.values.get(key);
|
||||
if (o != null) {
|
||||
return (E) o;
|
||||
} else {
|
||||
this.set(key, def);
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method, not further established as currently not necessary.
|
||||
*
|
||||
* @see #getSection(String)
|
||||
* @deprecated this config is only made for a quite simple use, only goes one level deeper
|
||||
*/
|
||||
@Deprecated
|
||||
public Object getDeep(final String key) {
|
||||
final String[] split = key.split("\\.", 2);
|
||||
if (split.length != 2) return get(key);
|
||||
|
||||
final Object o = getObject(split[0]);
|
||||
if (!(o instanceof Map)) return null;
|
||||
|
||||
final Map<String, Object> map = (Map<String, Object>) o;
|
||||
return map.get(split[1]);
|
||||
}
|
||||
|
||||
public ConfigSection getSection(final String key) {
|
||||
final Object o = getObject(key);
|
||||
return o instanceof Map ? new ConfigSection((Map<String, Object>) o) : null;
|
||||
}
|
||||
|
||||
public boolean contains(final String key) {
|
||||
return this.values.containsKey(key);
|
||||
}
|
||||
@@ -93,12 +118,12 @@ public class ConfigSection {
|
||||
}
|
||||
|
||||
public boolean getBoolean(final String key) {
|
||||
final Object o = values.get(key);
|
||||
return o instanceof Boolean && (boolean) o;
|
||||
return getBoolean(key, false);
|
||||
}
|
||||
|
||||
public boolean getBoolean(final String key, final boolean def) {
|
||||
return values.containsKey(key) ? get(key) : def;
|
||||
final Object o = values.get(key);
|
||||
return o instanceof Boolean ? (boolean) o : def;
|
||||
}
|
||||
|
||||
public String getString(final String key) {
|
||||
@@ -106,34 +131,35 @@ public class ConfigSection {
|
||||
}
|
||||
|
||||
public String getString(final String key, final String def) {
|
||||
return values.containsKey(key) ? get(key) : def;
|
||||
final Object o = get(key);
|
||||
return o instanceof String ? (String) o : def;
|
||||
}
|
||||
|
||||
public int getInt(final String key) {
|
||||
final Object o = values.get(key);
|
||||
return o instanceof Number ? ((Number) o).intValue() : 0;
|
||||
return getInt(key, 0);
|
||||
}
|
||||
|
||||
public int getInt(final String key, final int def) {
|
||||
return values.containsKey(key) ? get(key) : def;
|
||||
final Object o = values.get(key);
|
||||
return o instanceof Number ? ((Number) o).intValue() : def;
|
||||
}
|
||||
|
||||
public double getDouble(final String key) {
|
||||
final Object o = values.get(key);
|
||||
return o instanceof Number ? ((Number) o).doubleValue() : 0D;
|
||||
return getDouble(key, 0D);
|
||||
}
|
||||
|
||||
public double getDouble(final String key, final long def) {
|
||||
return values.containsKey(key) ? get(key) : def;
|
||||
public double getDouble(final String key, final double def) {
|
||||
final Object o = values.get(key);
|
||||
return o instanceof Number ? ((Number) o).doubleValue() : def;
|
||||
}
|
||||
|
||||
public long getLong(final String key) {
|
||||
final Object o = values.get(key);
|
||||
return o instanceof Number ? ((Number) o).longValue() : 0L;
|
||||
return getLong(key, 0L);
|
||||
}
|
||||
|
||||
public long getLong(final String key, final long def) {
|
||||
return values.containsKey(key) ? get(key) : def;
|
||||
final Object o = values.get(key);
|
||||
return o instanceof Number ? ((Number) o).longValue() : def;
|
||||
}
|
||||
|
||||
public List<String> getStringList(final String key) {
|
||||
|
||||
+27
-18
@@ -35,44 +35,53 @@ import java.util.regex.Pattern;
|
||||
public final class ConfigSerializer {
|
||||
|
||||
private static final String[] EMPTY = new String[0];
|
||||
private static final int INDENT_UNIT = 2;
|
||||
private static final String PATH_SEPARATOR_STRING = ".";
|
||||
private static final String PATH_SEPARATOR_QUOTED = Pattern.quote(PATH_SEPARATOR_STRING);
|
||||
private static final int INDENT_UNIT = 2;
|
||||
|
||||
public static String serialize(final String header, final Map<String, Object> data, final Map<String, String[]> comments, final Yaml yaml) {
|
||||
if (data.isEmpty()) return yaml.dump(null);
|
||||
|
||||
final String rawYaml = yaml.dump(data);
|
||||
final StringBuilder fileData = new StringBuilder();
|
||||
int currentIndents = 0;
|
||||
int currentKeyIndents = 0;
|
||||
String key = "";
|
||||
for (final String line : rawYaml.split("\n")) {
|
||||
if (line.isEmpty()) continue;
|
||||
|
||||
final int indent = getIndents(line);
|
||||
final int indents = indent / INDENT_UNIT;
|
||||
|
||||
final String indentText = indent > 0 ? line.substring(0, indent) : "";
|
||||
if (indents <= currentIndents) {
|
||||
final boolean keyLine;
|
||||
final String substring = line.substring(indent);
|
||||
if (substring.trim().isEmpty() || substring.charAt(0) == '-') {
|
||||
keyLine = false;
|
||||
} else if (indents <= currentKeyIndents) {
|
||||
final String[] array = key.split(PATH_SEPARATOR_QUOTED);
|
||||
final int backspace = currentIndents - indents + 1;
|
||||
final int backspace = currentKeyIndents - indents + 1;
|
||||
key = join(array, array.length - backspace);
|
||||
keyLine = true;
|
||||
} else {
|
||||
keyLine = line.contains(":");
|
||||
}
|
||||
|
||||
final String separator = key.isEmpty() ? "" : PATH_SEPARATOR_STRING;
|
||||
final String lineKey = line.contains(":") ? line.split(Pattern.quote(":"))[0] : line;
|
||||
key += separator + lineKey.substring(indent);
|
||||
if (keyLine) {
|
||||
final String newKey = substring.split(Pattern.quote(":"))[0]; // Not sure about the quote thing, so I'll just keep it :aaa:
|
||||
if (!key.isEmpty())
|
||||
key += PATH_SEPARATOR_STRING;
|
||||
key += newKey;
|
||||
|
||||
currentIndents = indents;
|
||||
|
||||
final String[] strings = comments.get(key);
|
||||
if (strings != null) {
|
||||
for (final String comment : strings) {
|
||||
if (comment.isEmpty())
|
||||
fileData.append('\n');
|
||||
else
|
||||
fileData.append(indentText).append(comment).append('\n');
|
||||
final String[] strings = comments.get(key);
|
||||
if (strings != null) {
|
||||
final String indentText = indent > 0 ? line.substring(0, indent) : "";
|
||||
for (final String comment : strings) {
|
||||
if (comment.isEmpty())
|
||||
fileData.append('\n');
|
||||
else
|
||||
fileData.append(indentText).append(comment).append('\n');
|
||||
}
|
||||
}
|
||||
|
||||
currentKeyIndents = indents;
|
||||
}
|
||||
|
||||
fileData.append(line).append('\n');
|
||||
|
||||
@@ -37,7 +37,10 @@ public final class EventManager implements IEventManager {
|
||||
|
||||
public void callEvent(final MaintenanceEvent event) {
|
||||
final List<EventListener> list = listeners.get(event.getClass().getSimpleName());
|
||||
if (list != null)
|
||||
list.forEach(listener -> listener.onEvent(event));
|
||||
if (list != null) {
|
||||
for (final EventListener listener : list) {
|
||||
listener.onEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,6 @@
|
||||
# You can report bugs here: https://github.com/KennyTV/Maintenance/issues
|
||||
# If you need any other help/support, you can also join my Discord server: https://discord.gg/vGCUzHq
|
||||
|
||||
# Used for autoupdating the config, do not change this value.
|
||||
config-version: 1
|
||||
|
||||
# Enables maintenance mode.
|
||||
maintenance-enabled: false
|
||||
|
||||
@@ -32,6 +29,13 @@ pingmessages:
|
||||
- "&cMaintenance mode!%NEWLINE%&6We will be back soon!"
|
||||
# - "Other entry"
|
||||
|
||||
# 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: false
|
||||
timerspecific-pingmessages:
|
||||
- "&cMaintenance mode!%NEWLINE%&6We will be back in %TIMER%!"
|
||||
# - "Other entry"
|
||||
|
||||
# If set to true, the message below will be shown at 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.
|
||||
#
|
||||
@@ -50,6 +54,10 @@ custom-maintenance-icon: false
|
||||
# that a player tried to join the server while maintenance is enabled.
|
||||
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.
|
||||
# Currently available are: en (English), de (German), fr (French), pt (Portuguese), es (Spanish)
|
||||
language: en
|
||||
@@ -70,9 +78,6 @@ mysql:
|
||||
# (0 is not recommended if having more than a hundred concurrent players, then I'd recommend keeping it from 10-60).
|
||||
update-interval: 15
|
||||
|
||||
# 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 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:
|
||||
@@ -81,7 +86,13 @@ continue-endtimer-after-restart:
|
||||
# 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 less bugs.
|
||||
# However, you can always check for updates manually using the '/maintenance update' command.
|
||||
update-checks: true
|
||||
update-checks: true
|
||||
|
||||
# Used for autoupdating the config, do not change this value.
|
||||
config-version: 3
|
||||
@@ -7,7 +7,6 @@ maintenanceActivated: "&8[&eMaintenance&8] &6Der Wartungsmodus ist nun aktiviert
|
||||
maintenanceDeactivated: "&8[&eMaintenance&8] &6Der Wartungsmodus ist nun deaktiviert."
|
||||
alreadyEnabled: "&8[&eMaintenance&8] &cDer Wartungsmodus ist bereits aktiviert!"
|
||||
alreadyDisabled: "&8[&eMaintenance&8] &cDer Wartungsmodus ist bereits deaktiviert!"
|
||||
helpPageNotFound: "&8[&eMaintenance&8] &cEs gibt keine Seite mit dieser Nummer!"
|
||||
endtimerBroadcast: "&8[&eMaintenance&8] &7Der Wartungsmodus wird deaktiviert in: &6%TIME%&7."
|
||||
endtimerStarted: "&8[&eMaintenance&8] &aGestarteter Timer: &7Der Wartungsmodus wird deaktiviert in: &6%TIME%&7."
|
||||
starttimerBroadcast: "&8[&eMaintenance&8] &7Der Wartungsmodus wird aktiviert in: &6%TIME%&7."
|
||||
@@ -16,10 +15,12 @@ timerAlreadyRunning: "&8[&eMaintenance&8] &cMomentan läuft bereits ein Timer!"
|
||||
timerNotRunning: "&8[&eMaintenance&8] &cMomentan läuft kein Timer."
|
||||
timerCancelled: "&8[&eMaintenance&8] &cDer laufende Timer wurde beendet."
|
||||
timerTooLong: "&8[&eMaintenance&8] &cDie angegebene Nummer muss kleiner als 40320 sein (= 28 Tage)!"
|
||||
timerMotdDisabled: "&8[&eMaintenance&8] &cDu musst 'enable-timerspecific-messages' in der Config auf 'true' stellen, wenn du timerspezifische Motds benutzen/editieren möchtest."
|
||||
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
|
||||
motdTimerNotRunning: "-"
|
||||
joinNotification: "&8[&eMaintenance&8] &e%PLAYER% &chat versucht den Server beizutreten."
|
||||
motdList: "&8[&eMaintenance&8] &7Liste der Maintenance MOTDs:"
|
||||
motdListEmpty: "8[&eMaintenance&8] &cDu hast keine Maintenance MOTDs gesetzt!"
|
||||
reload: "&8[&eMaintenance&8] &aConfig, WhitelistedPlayers, Language Datei und Maintenance Icon wurden neugeladen."
|
||||
removedMotd: "&8[&eMaintenance&8] &aDie %INDEX%. Maintenance MOTD wurde entfernt."
|
||||
removeMotdError: "&8[&eMaintenance&8] &cDu hast nur eine Maintenance MOTD, daher kannst du auch keine entfernen!"
|
||||
@@ -41,14 +42,7 @@ playerNotFoundUuid: "&8[&eMaintenance&8] &cEs konnte kein Spieler mit dieser UUI
|
||||
playerNotOnline: "&8[&eMaintenance&8] &cEs ist momentan kein Spieler mit diesem Namen online."
|
||||
invalidUuid: "&8[&eMaintenance&8] &cUngültiges UUID Format!"
|
||||
|
||||
second: "Sekunde"
|
||||
seconds: "Sekunden"
|
||||
minute: "Minute"
|
||||
minutes: "Minuten"
|
||||
hour: "Stunde"
|
||||
hours: "Stunden"
|
||||
|
||||
# Nachrichten für den Bungee Teil des Plugins, einfach ignorieren, falls das Plugin auf Spigot verwendet wird
|
||||
# Nachrichten für den Bungee/Velocity Teil des Plugins, einfach ignorieren, falls das Plugin auf Spigot/Sponge verwendet wird
|
||||
serverNotFound: "&8[&eMaintenance&8] &cEs wurde kein Server mit diesem Namen gefunden!"
|
||||
singleTimerAlreadyRunning: "&8[&eMaintenance&8] &cMomentan läuft bereits ein Timer auf diesem Server!"
|
||||
singleTimerNotRunning: "&8[&eMaintenance&8] &cMomentan läuft kein Timer auf diesem Server."
|
||||
@@ -62,4 +56,36 @@ singleMaintenanceDeactivated: "&8[&eMaintenance&8] &6Der Wartungsmodus wurde auf
|
||||
singleServerAlreadyEnabled: "&8[&eMaintenance&8] &cDer Wartungsmodus ist bereits an auf &e%SERVER%&c!"
|
||||
singleServerAlreadyDisabled: "&8[&eMaintenance&8] &cDer Wartungsmodus ist bereits aus auf &e%SERVER%&c!"
|
||||
singleServerMaintenanceList: "&8[&eMaintenance&8] &7Unterserver, die im Wartungsmodus sind:"
|
||||
singleServerMaintenanceListEmpty: "&8[&eMaintenance&8] &7Es befindet sich momentan kein Unterserver im Wartungsmodus."
|
||||
singleServerMaintenanceListEmpty: "&8[&eMaintenance&8] &7Es befindet sich momentan kein Unterserver im Wartungsmodus."
|
||||
|
||||
second: "Sekunde"
|
||||
seconds: "Sekunden"
|
||||
minute: "Minute"
|
||||
minutes: "Minuten"
|
||||
hour: "Stunde"
|
||||
hours: "Stunden"
|
||||
|
||||
helpHeader: "&8========[ &e%NAME% &8| &e%PAGE%/%MAX% &8]========"
|
||||
helpPageNotFound: "&8[&eMaintenance&8] &cEs gibt keine Seite mit dieser Nummer!"
|
||||
helpNextPage: "&7Nutze &b/maintenance help %SEITE%&7, um zur nächsten Hilfeseite zu kommen."
|
||||
helpAbortTimer: "&6/maintenance aborttimer &7(Falls momentan ein Timer läuft, wird dieser abgebrochen)"
|
||||
helpEndtimer: "&6/maintenance endtimer <Minuten> &7(Sobald der Timer abläuft wird der Wartungsmodus deaktiviert)"
|
||||
helpStarttimer: "&6/maintenance starttimer <minutes> &7(Sobald der Timer abläuft wird der Wartungsmodus aktiviert)"
|
||||
helpDump: "&6/maintenance dump &7(Sammelt wichtige Informationen für Bugreports)"
|
||||
helpHelp: "&6/maintenance help [Seite] &7(Zeigt diese wunderschöne Hilfe)"
|
||||
helpMotd: "&6/maintenance motd [timer] &7(Zeigt die momentan gesetzten Maintenance Motds an. Mit dem 'timer' Argument werden die timerspezifischen Motds angezeigt)"
|
||||
helpRemoveMotd: "&6/maintenance removemotd [timer] <Index> &7(Entfernt eine Maintenance Motd. Mit dem 'timer' Argument wird eine timerspezifischen Motd entfernt)"
|
||||
helpSetMotd: "&6/maintenance setmotd [timer] <Index> <1/2> <Nachricht> &7(Setzte eine Motd für den Wartungsmodus. Mit dem 'timer' Argument as an argument wird eine timerspezifische Motd gesetzt)"
|
||||
helpReload: "&6/maintenance reload &7(Lädt Config, Language und Whitelist Dateien sowie das Maintenance Icon neu)"
|
||||
helpToggle: "&6/maintenance <on/off> &7(Aktiviert/deaktiviert den Wartungsmodus)"
|
||||
helpUpdate: "&6/maintenance update &7(Sucht nach neuen Updates für das Plugin und lädt diese auf den Server)"
|
||||
helpWhitelist: "&6/maintenance whitelist &7(Zeigt alle gewhitelisteten Spieler für den Wartungsmodus an)"
|
||||
helpWhitelistAdd: "&6/maintenance add <Name/UUID> &7(Whitelistet einen Spieler für den Wartungsmodus, sodass dieser während Wartungen den Server betreten kann)"
|
||||
helpWhitelistRemove: "&6/maintenance remove <Name/UUID> &7(Entfernt einen Spieler aus der Wartungsmodus Whitelist)"
|
||||
|
||||
# Nachrichten für den Bungee/Velocity Teil des Plugins, einfach ignorieren, falls das Plugin auf Spigot/Sponge verwendet wird
|
||||
helpAbortSingleTimer: "&6/maintenance aborttimer [Server] &7(Falls momentan ein Timer läuft, wird dieser abgebrochen)"
|
||||
helpSingleEndtimer: "&6/maintenance endtimer [Server] <Minuten> &7(Sobald der Timer abläuft wird der Wartungsmodus deaktiviert)"
|
||||
helpSingleStarttimer: "&6/maintenance starttimer [Server] <Minuten> &7(Sobald der Timer abläuft wird der Wartungsmodus aktiviert)"
|
||||
helpSingleToggle: "&6/maintenance <on/off> [Server] &7(Aktiviert/deaktiviert den Wartungsmodus)"
|
||||
helpStatus: "&6/maintenance status &7(Zeigt alle Server an, auf denen momentan der Wartungsmodus aktiviert ist)"
|
||||
@@ -7,7 +7,6 @@ maintenanceActivated: "&8[&eMaintenance&8] &6Maintenance mode is now activated."
|
||||
maintenanceDeactivated: "&8[&eMaintenance&8] &6Maintenance mode is now deactivated."
|
||||
alreadyEnabled: "&8[&eMaintenance&8] &cMaintenance is already enabled!"
|
||||
alreadyDisabled: "&8[&eMaintenance&8] &cMaintenance is already disabled!"
|
||||
helpPageNotFound: "&8[&eMaintenance&8] &cThere is no page with that number!"
|
||||
endtimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be disabled in &6%TIME%&7."
|
||||
endtimerStarted: "&8[&eMaintenance&8] &aStarted timer: &7Maintenance mode will be deactivated in &6%TIME%&7."
|
||||
starttimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be enabled in &6%TIME%&7."
|
||||
@@ -16,10 +15,12 @@ timerAlreadyRunning: "&8[&eMaintenance&8] &cThere is already a timer scheduled!"
|
||||
timerNotRunning: "&8[&eMaintenance&8] &cThere is currently no running timer."
|
||||
timerCancelled: "&8[&eMaintenance&8] &cThe current timer has been disabled."
|
||||
timerTooLong: "&8[&eMaintenance&8] &cThe number has to be less than 40320 (28 days)!"
|
||||
timerMotdDisabled: "&8[&eMaintenance&8] &cYou have to set 'enable-timerspecific-messages' in the config to 'true', if you want to use/edit timerspecific motds."
|
||||
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
|
||||
motdTimerNotRunning: "-"
|
||||
joinNotification: "&8[&eMaintenance&8] &e%PLAYER% &ctried to join the server."
|
||||
motdList: "&8[&eMaintenance&8] &7List of your maintenance motds:"
|
||||
motdListEmpty: "8[&eMaintenance&8] &cYou don't have any maintenance motds set!"
|
||||
reload: "&8[&eMaintenance&8] &aReloaded config, whitelistedplayers, language file and the maintenance icon."
|
||||
removedMotd: "&8[&eMaintenance&8] &aRemoved motd number %INDEX%."
|
||||
removeMotdError: "&8[&eMaintenance&8] &cYou only have one motd, so you cannot remove any!"
|
||||
@@ -41,14 +42,7 @@ playerNotFoundUuid: "&8[&eMaintenance&8] &cNo player with that uuid could be fou
|
||||
playerNotOnline: "&8[&eMaintenance&8] &cThere is no player online with that name."
|
||||
invalidUuid: "&8[&eMaintenance&8] &cInvalid uuid format!"
|
||||
|
||||
second: "second"
|
||||
seconds: "seconds"
|
||||
minute: "minute"
|
||||
minutes: "minutes"
|
||||
hour: "hour"
|
||||
hours: "hours"
|
||||
|
||||
# Some messages for the Bungee part, just ignore them if you use the plugin on Spigot
|
||||
# Messages for the Bungee/Velocity part, just can ignore them if you use the plugin on Spigot/Sponge
|
||||
serverNotFound: "&8[&eMaintenance&8] &cNo server with this name is registered on the proxy!"
|
||||
singleTimerAlreadyRunning: "&8[&eMaintenance&8] &cThere is already a timer scheduled for that server!"
|
||||
singleTimerCancelled: "&8[&eMaintenance&8] &cThe current timer for server &e%SERVER% &chas been disabled."
|
||||
@@ -62,4 +56,36 @@ singleMaintenanceDeactivated: "&8[&eMaintenance&8] &6Maintenance mode is now dea
|
||||
singleServerAlreadyEnabled: "&8[&eMaintenance&8] &cMaintenance is already enabled on server &e%SERVER%&c!"
|
||||
singleServerAlreadyDisabled: "&8[&eMaintenance&8] &cMaintenance is already disabled on server &e%SERVER%&c!"
|
||||
singleServerMaintenanceList: "&8[&eMaintenance&8] &7Proxied servers, that have maintenance enabled:"
|
||||
singleServerMaintenanceListEmpty: "&8[&eMaintenance&8] &7There are no proxied servers that are under maintenance."
|
||||
singleServerMaintenanceListEmpty: "&8[&eMaintenance&8] &7There are no proxied servers that are under maintenance."
|
||||
|
||||
second: "second"
|
||||
seconds: "seconds"
|
||||
minute: "minute"
|
||||
minutes: "minutes"
|
||||
hour: "hour"
|
||||
hours: "hours"
|
||||
|
||||
helpHeader: "&8========[ &e%NAME% &8| &e%PAGE%/%MAX% &8]========"
|
||||
helpPageNotFound: "&8[&eMaintenance&8] &cThere is no page with that number!"
|
||||
helpNextPage: "&7Use &b/maintenance help %PAGE% &7to get to the next help window."
|
||||
helpAbortTimer: "&6/maintenance aborttimer &7(If running, the current timer will be aborted)"
|
||||
helpEndtimer: "&6/maintenance endtimer <minutes> &7(After the given time in minutes, maintenance mode will be disabled)"
|
||||
helpStarttimer: "&6/maintenance starttimer <minutes> &7(After the given time in minutes, maintenance mode will be enabled)"
|
||||
helpDump: "&6/maintenance dump &7(Dumps some server information, used for bug reports)"
|
||||
helpHelp: "&6/maintenance help [page] &7(Shows this beautiful help window)"
|
||||
helpMotd: "&6/maintenance motd [timer] &7(Lists the currently set maintenance motds. If specifying 'timer', the timer motds are shown)"
|
||||
helpRemoveMotd: "&6/maintenance removemotd [timer] <index> &7(Removes a maintenance motd. If using 'timer' as an argument, a timerspecific pingmessage will be removed)"
|
||||
helpSetMotd: "&6/maintenance setmotd [timer] <index> <1/2> <message> &7(Sets a motd for maintenance mode. If using 'timer' as an argument, a timerspecific pingmessage will be set)"
|
||||
helpReload: "&6/maintenance reload &7(Reloads the config file, whitelist file and the server-icon)"
|
||||
helpToggle: "&6/maintenance <on/off> &7(Enables/disables maintenance mode)"
|
||||
helpUpdate: "&6/maintenance update &7(Remotely downloads the newest version of the plugin onto your server)"
|
||||
helpWhitelist: "&6/maintenance whitelist &7(Shows all whitelisted players for the maintenance mode)"
|
||||
helpWhitelistAdd: "&6/maintenance add <name/uuid> &7(Adds the player to the maintenance whitelist, so they can join the server even though maintenance is enabled)"
|
||||
helpWhitelistRemove: "&6/maintenance remove <name/uuid> &7(Removes the player from the maintenance whitelist)"
|
||||
|
||||
# Messages for the Bungee/Velocity part, just can ignore them if you use the plugin on Spigot/Sponge
|
||||
helpAbortSingleTimer: "&6/maintenance aborttimer [server] &7(If running, the current timer will be aborted)"
|
||||
helpSingleEndtimer: "&6/maintenance endtimer [server] <minutes> &7(After the given time in minutes, maintenance mode will be disabled)"
|
||||
helpSingleStarttimer: "&6/maintenance starttimer [server] <minutes> &7(After the given time in minutes, maintenance mode will be enabled)"
|
||||
helpSingleToggle: "&6/maintenance <on/off> [server] &7(Enables/disables maintenance mode)"
|
||||
helpStatus: "&6/maintenance status &7(Lists all proxied servers, that are currently under maintenance)"
|
||||
@@ -7,7 +7,6 @@ maintenanceActivated: "&8[&eMaintenance&8] &6Mantenimiento &7Activado"
|
||||
maintenanceDeactivated: "&8[&eMaintenance&8] &7Modo &6Mantenimiento &7Desactivado"
|
||||
alreadyEnabled: "&8[&eMaintenance&8] &7Modo &6Mantenimiento &7se encuentra Habilitado!"
|
||||
alreadyDisabled: "&8[&eMaintenance&8] &7Modo &6Mantenimiento &7se encuentra Deshabilitado!"
|
||||
helpPageNotFound: "&8[&eMaintenance&8] &7No hay pagina con ese número!"
|
||||
endtimerBroadcast: "&8[&eMaintenance&8] &7El Modo &6Mantenimiento &7se desactivara en &6%TIME%&7."
|
||||
endtimerStarted: "&8[&eMaintenance&8] &7Temporizador Iniciado: El Modo &6Mantenimiento &7se desactivará en &6%TIME%&7."
|
||||
starttimerBroadcast: "&8[&eMaintenance&8] &7El Modo &6Mantenimiento &7se habilitara en &6%TIME%&7."
|
||||
@@ -16,10 +15,12 @@ timerAlreadyRunning: "&8[&eMaintenance&8] &7Ya hay un temporizador programado!"
|
||||
timerNotRunning: "&8[&eMaintenance&8] &7Actualmente no hay temporizador."
|
||||
timerCancelled: "&8[&eMaintenance&8] &cEl Temporizador actual ha sido deshabilitado."
|
||||
timerTooLong: "&8[&eMaintenance&8] &7El numero debe ser menor a 40320 &6(28 dias)"
|
||||
timerMotdDisabled: "&8[&eMaintenance&8] &cTienes que configurar 'enable-timerspecific-messages' en la configuración en 'true', si quieres usar / editar motdspecers específicos."
|
||||
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
|
||||
motdTimerNotRunning: "-"
|
||||
joinNotification: "&8[&eMaintenance&8] &c%PLAYER% &7Intenta unirse al servidor."
|
||||
motdList: "&8[&eMaintenance&8] &7Lista de motds de &6Mantenimiento&7:"
|
||||
motdListEmpty: "8[&eMaintenance&8] &c¡No tiene ningún juego de mantenimiento establecido!"
|
||||
reload: "&8[&eMaintenance&8] &aConfiguracion Recargada"
|
||||
removedMotd: "&8[&eMaintenance&8] &aNumero de Motd eliminado &6%INDEX%."
|
||||
removeMotdError: "&8[&eMaintenance&8] &Solo tienes un Motd, por lo que no puedes eliminar ninguno!"
|
||||
@@ -41,14 +42,7 @@ playerNotFoundUuid: "&8[&eMaintenance&8] &cNo se pudo encontrar el jugador con e
|
||||
playerNotOnline: "&8[&eMaintenance&8] &7No hay jugador en línea con ese nombre."
|
||||
invalidUuid: "&8[&eMaintenance&8] &cFormato inválido!"
|
||||
|
||||
second: "Segundo"
|
||||
seconds: "Segundos"
|
||||
minute: "Minuto"
|
||||
minutes: "Minutos"
|
||||
hour: "Hora"
|
||||
hours: "Horas"
|
||||
|
||||
# Some messages for the Bungee part, just ignore them if you use the plugin on Spigot
|
||||
# Messages for the Bungee/Velocity part, just can ignore them if you use the plugin on Spigot/Sponge
|
||||
serverNotFound: "&8[&eMaintenance&8] &cNingún servidor con este nombre está registrado en el proxy!"
|
||||
singleTimerAlreadyRunning: "&8[&eMaintenance&8] &cYa hay un temporizador programado!"
|
||||
singleTimerNotRunning: "&8[&eMaintenance&8] &cActualmente no hay ningún temporizador en ejecución para ese servidor."
|
||||
@@ -62,4 +56,36 @@ singleMaintenanceDeactivated: "&8[&eMaintenance&8] &7El Modo &6Mantenimiento &7A
|
||||
singleServerAlreadyEnabled: "&8[&eMaintenance&8] &7El Modo &6Mantenimiento &7se encuentra Habilitado en &6%SERVER%&7!"
|
||||
singleServerAlreadyDisabled: "&8[&eMaintenance&8] 7El Modo &6Mantenimiento &7se encuentra Deshabilitado en &6%SERVER%&7!"
|
||||
singleServerMaintenanceList: "&8[&eMaintenance&8] &7Servidores Proxy, que tienen habilitado el &6Mantenimiento:"
|
||||
singleServerMaintenanceListEmpty: "&8[&eMaintenance&8] &7No hay servidores Proxy que están en &6Mantenimiento&7."
|
||||
singleServerMaintenanceListEmpty: "&8[&eMaintenance&8] &7No hay servidores Proxy que están en &6Mantenimiento&7."
|
||||
|
||||
second: "Segundo"
|
||||
seconds: "Segundos"
|
||||
minute: "Minuto"
|
||||
minutes: "Minutos"
|
||||
hour: "Hora"
|
||||
hours: "Horas"
|
||||
|
||||
helpHeader: "&8========[ &e%NAME% &8| &e%PAGE%/%MAX% &8]========"
|
||||
helpPageNotFound: "&8[&eMaintenance&8] &7No hay pagina con ese número!"
|
||||
helpNextPage: "&7Utilice &b/maintenance help %PAGE% &7para pasar a la siguiente ventana de ayuda."
|
||||
helpAbortTimer: "&6/maintenance aborttimer &7(Si se ejecuta, se abortará el temporizador actual)"
|
||||
helpEndtimer: "&6/maintenance endtimer <minutes> &7(Después del tiempo en minutos, se desactivará el modo de mantenimiento)"
|
||||
helpStarttimer: "&6/maintenance starttimer <minutes> &7(Después del tiempo en minutos, se habilitará el modo de mantenimiento)"
|
||||
helpDump: "&6/maintenance dump &7(Vuelca información del servidor, usada para informes de errores)"
|
||||
helpHelp: "&6/maintenance help [page] &7(Muestra esta hermosa ventana de ayuda)"
|
||||
helpMotd: "&6/maintenance motd [timer] &7(Enumera los motivos de mantenimiento establecidos actualmente. Si se especifica el 'temporizador', se muestran los motivos del temporizador)"
|
||||
helpRemoveMotd: "&6/maintenance removemotd [timer] <index> &7(Elimina un mantenimiento motd. Si se usa 'timer' como argumento, se eliminará un pingmessage de temporizador específico)"
|
||||
helpSetMotd: "&6/maintenance setmotd [timer] <index> <1/2> <message> &7(Establece un motd para el modo de mantenimiento. Si usa 'timer' como argumento, se establecerá un mensaje de ping específico para el tiempo)"
|
||||
helpReload: "&6/maintenance reload &7(Vuelve a cargar el archivo de configuración, el archivo de la lista blanca y el ícono del servidor)"
|
||||
helpToggle: "&6/maintenance <on/off> &7(Habilita / deshabilita el modo de mantenimiento)"
|
||||
helpUpdate: "&6/maintenance update &7(Descarga de forma remota la versión más reciente del complemento en su servidor)"
|
||||
helpWhitelist: "&6/maintenance whitelist &7(Muestra todos los reproductores en lista blanca para el modo de mantenimiento)"
|
||||
helpWhitelistAdd: "&6/maintenance add <name/uuid> &7(Agrega el reproductor a la lista blanca de mantenimiento, para que puedan unirse al servidor aunque el mantenimiento esté habilitado)"
|
||||
helpWhitelistRemove: "&6/maintenance remove <name/uuid> &7(Quita el reproductor de la lista blanca de mantenimiento)"
|
||||
|
||||
# Messages for the Bungee/Velocity part, just can ignore them if you use the plugin on Spigot/Sponge
|
||||
helpAbortSingleTimer: "&6/maintenance aborttimer [servidor] &7(Si está funcionando, se abortará el temporizador actual)"
|
||||
helpSingleEndtimer: "&6/maintenance endtimer [server] <minutes> &7(Después del tiempo en minutos, se desactivará el modo de mantenimiento)"
|
||||
helpSingleStarttimer: "&6/maintenance starttimer [server] <minutes> &7(Después del tiempo en minutos, el modo de mantenimiento habilitado)"
|
||||
helpSingleToggle: "&6/maintenance <on/off> [server] &7(Habilita / deshabilita el modo de mantenimiento)"
|
||||
helpStatus: "&6/maintenance status &7(Enumera todos los servidores proxy, que están actualmente en mantenimiento)"
|
||||
@@ -7,7 +7,6 @@ maintenanceActivated: "&8[&eMaintenance&8] &6Le mode maintenance est maintenant
|
||||
maintenanceDeactivated: "&8[&eMaintenance&8] &6Le mode maintenance est maintenant désactivé."
|
||||
alreadyEnabled: "&8[&eMaintenance&8] &cLa maintenance est déjà activée!"
|
||||
alreadyDisabled: "&8[&eMaintenance&8] &cLa maintenance est déjà désactivée!"
|
||||
helpPageNotFound: "&8[&eMaintenance&8] &cIl n'y a pas cette page!"
|
||||
endtimerBroadcast: "&8[&eMaintenance&8] &7Le mode maintenance sera désactivé dans &6%TIME%&7."
|
||||
endtimerStarted: "&8[&eMaintenance&8] &aminuterie: &7Le mode maintenance sera désactivé dans &6%TIME%&7."
|
||||
starttimerBroadcast: "&8[&eMaintenance&8] &7MLe mode de maintenance sera activé dans &6%TIME%&7."
|
||||
@@ -16,10 +15,12 @@ timerAlreadyRunning: "&8[&eMaintenance&8] &cIl y a déjà un horaire prévu!"
|
||||
timerNotRunning: "&8[&eMaintenance&8] &cIl n'y a actuellement aucune maintenance prévue."
|
||||
timerCancelled: "&8[&eMaintenance&8] &cLa minuterie actuelle a été désactivée."
|
||||
timerTooLong: "&8[&eMaintenance&8] &cLe nombre doit être inférieur à 40320 (28 jours)!"
|
||||
timerMotdDisabled: "&8[&eMaintenance&8] &cVous devez définir 'enable-timerspecific-messages' dans la configuration sur 'true', si vous voulez utiliser / éditer des timerspecific motd."
|
||||
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
|
||||
motdTimerNotRunning: "-"
|
||||
joinNotification: "&8[&eMaintenance&8] &e%PLAYER% &ca essayé de rejoindre le serveur."
|
||||
motdList: "&8[&eMaintenance&8] &7Liste de vos motd pour la maintenance:"
|
||||
motdListEmpty: "8[&eMaintenance&8] &cVous n'avez pas de motds d'entretien fixés!"
|
||||
reload: "&8[&eMaintenance&8] &afichier config, liste blanche (whitelist) joueurs, fichier de langue et l'icône de maintenance, recharger."
|
||||
removedMotd: "&8[&eMaintenance&8] &aNuméro de motd supprimé %INDEX%."
|
||||
removeMotdError: "&8[&eMaintenance&8] &cVous n’avez qu’un motd, vous ne pouvez donc en supprimer!"
|
||||
@@ -41,14 +42,7 @@ playerNotFoundUuid: "&8[&eMaintenance&8] &cAucun joueur avec cet uuid n'a pu êt
|
||||
playerNotOnline: "&8[&eMaintenance&8] &cIl n'y a pas de joueur en ligne avec ce nom."
|
||||
invalidUuid: "&8[&eMaintenance&8] &cLe format de l'uuid est invalide!"
|
||||
|
||||
second: "second"
|
||||
seconds: "seconds"
|
||||
minute: "minute"
|
||||
minutes: "minutes"
|
||||
hour: "heur"
|
||||
hours: "heurs"
|
||||
|
||||
# Quelques messages pour la partie Bungee, ignorez-les si vous utilisez le plugin sur Spigot
|
||||
# Quelques messages pour la partie Bungee/Velocity, ignorez-les si vous utilisez le plugin sur Spigot/Sponge
|
||||
serverNotFound: "&8[&eMaintenance&8] &cAucun serveur avec ce nom n'est enregistré sur le proxy!"
|
||||
singleTimerAlreadyRunning: "&8[&eMaintenance&8] &cIl y a déjà un horaire prévu sur ce server!"
|
||||
singleTimerNotRunning: "&8[&eMaintenance&8] &cIl n'y a actuellement aucune maintenance prévue sur ce server."
|
||||
@@ -62,4 +56,36 @@ singleMaintenanceDeactivated: "&8[&eMaintenance&8] &6La maintenance est maintena
|
||||
singleServerAlreadyEnabled: "&8[&eMaintenance&8] &cLa maintenance est déjà activée sur le serveur &e%SERVER%&c!"
|
||||
singleServerAlreadyDisabled: "&8[&eMaintenance&8] &cLa maintenance est déjà désactivée sur le serveur &e%SERVER%&c!"
|
||||
singleServerMaintenanceList: "&8[&eMaintenance&8] &7Serveurs proxy avec maintenance activée:"
|
||||
singleServerMaintenanceListEmpty: "&8[&eMaintenance&8] &7Il n'y a pas de serveurs proxy en maintenance."
|
||||
singleServerMaintenanceListEmpty: "&8[&eMaintenance&8] &7Il n'y a pas de serveurs proxy en maintenance."
|
||||
|
||||
second: "second"
|
||||
seconds: "seconds"
|
||||
minute: "minute"
|
||||
minutes: "minutes"
|
||||
hour: "heur"
|
||||
hours: "heurs"
|
||||
|
||||
helpHeader: "&8========[ &e%NAME% &8| &e%PAGE%/%MAX% &8]========"
|
||||
helpPageNotFound: "&8[&eMaintenance&8] &cIl n'y a pas cette page!"
|
||||
helpNextPage: "&7Utilisez &b/maintenance help %PAGE% &7pour accéder à la fenêtre d’aide suivante."
|
||||
helpAbortTimer: "&6/maintenance aborttimer &7(Si en cours d'exécution, le minuteur actuel sera abandonné)"
|
||||
helpEndtimer: "&6/maintenance endtimer <minutes> &7(Après le temps imparti en minutes, le mode maintenance sera désactivé)"
|
||||
helpStarttimer: "&6/maintenance starttimer <minutes> &7(Après le temps imparti en minutes, le mode maintenance sera activé)"
|
||||
helpDump: "&6/maintenance dump &7(Dépose certaines informations sur le serveur, utilisées pour les rapports de bug)"
|
||||
helpHelp: "&6/maintenance help [page] &7(Montre cette belle fenêtre d'aide)"
|
||||
helpMotd: "&6/maintenance motd [timer] &7(Répertorie les paramètres de maintenance actuellement définis. Si vous spécifiez 'timer', les mots de la minuterie sont affichés)"
|
||||
helpRemoveMotd: "&6/maintenance removemotd [timer] <index> &7(Supprime un motd de maintenance. Si vous utilisez 'timer' comme argument, un message ping spécifique au temporisateur sera supprimé)"
|
||||
helpSetMotd: "&6/maintenance setmotd [timer] <index> <1/2> <message> &7(Définit un motd pour le mode maintenance. Si vous utilisez 'timer' comme argument, un message ping spécifique à un temporisateur sera défini)"
|
||||
helpReload: "&6/maintenance reload &7(Recharge le fichier de configuration, le fichier de liste blanche et l'icône du serveur)"
|
||||
helpToggle: "&6/maintenance <on/off> &7(Active/désactive le mode maintenance)"
|
||||
helpUpdate: "&6/maintenance update &7(Télécharger la dernière version du plugin sur votre serveur)"
|
||||
helpWhitelist: "&6/maintenance whitelist &7(Affiche les joueurs de la liste blanche pour le mode maintenance)"
|
||||
helpWhitelistAdd: "&6/maintenance add <name/uuid> &7(Ajoute un joueur à la liste blanche de la maintenance afin qu'il puisse rejoindre le serveur même si la maintenance est activée)"
|
||||
helpWhitelistRemove: "&6/maintenance remove <name/uuid> &7(Supprime un joueur de la liste blanche de la maintenance)"
|
||||
|
||||
# Quelques messages pour la partie Bungee/Velocity, ignorez-les si vous utilisez le plugin sur Spigot/Sponge
|
||||
helpAbortSingleTimer: "&6/maintenance aborttimer [server] &7(Si en cours d'exécution, le minuteur actuel sera abandonné)"
|
||||
helpSingleEndtimer: "&6/maintenance endtimer [server] <minutes> &7(Après le temps imparti en minutes, le mode maintenance sera désactivé)"
|
||||
helpSingleStarttimer: "&6/maintenance starttimer [server] <minutes> &7(Après le temps imparti en minutes, le mode maintenance sera activé)"
|
||||
helpSingleToggle: "&6/maintenance <on/off> [server] &7(Active/désactive le mode maintenance)"
|
||||
helpStatus: "&6/maintenance status &7(Répertorie tout les serveurs mandatés, actuellement en maintenance)"
|
||||
@@ -7,7 +7,6 @@ maintenanceActivated: "&8[&cManutencao&8] &6Manutencao esta agora ativada!"
|
||||
maintenanceDeactivated: "&8[&cManutencao&8] &6Manutencao esta agora desativada!"
|
||||
alreadyEnabled: "&8[&cManutencao&8] &cManutencao ja esta ativada!"
|
||||
alreadyDisabled: "&8[&cManutencao&8] &cManutencao ja esta desativada!"
|
||||
helpPageNotFound: "&8[&eManutencao&8] &cNao existe nenhuma pagina com esse numero!"
|
||||
endtimerBroadcast: "&8[&cManutencao&8] &7Manutencao vai ser desativada em &6%TIME%&7"
|
||||
endtimerStarted: "&8[&cManutencao&8] &aTemporizador: &7Manutencao vai ser desativada em &6%TIME%&7"
|
||||
starttimerBroadcast: "&8[&cManutencao&8] &7Manutencao vai ser ativada em &6%TIME%&7"
|
||||
@@ -16,15 +15,17 @@ timerAlreadyRunning: "&8[&cManutencao&8] &cO Timer ja esta a decorrer!"
|
||||
timerNotRunning: "&8[&cManutencao&8] &cO Timer nao esta a decorrer!"
|
||||
timerCancelled: "&8[&cManutencao&8] &cO Timer foi cancelado!"
|
||||
timerTooLong: "&8[&cManutencao&8] &cO numero tem de ser menor que 40320 (28 dias)!"
|
||||
timerMotdDisabled: "&8[&eMaintenance&8] &cYou have to set 'enable-timerspecific-messages' in the config to 'true', if you want to use/edit timerspecific motds."
|
||||
motdTimer: "%HOURS%:%MINUTES%:%SECONDS%"
|
||||
motdTimerNotRunning: "-"
|
||||
joinNotification: "&8[&cManutencao&8] &e%PLAYER% &ctentou entrar no servidor."
|
||||
motdList: "&8[&cManutencao&8] &7Lista de motds de manutencao:"
|
||||
motdListEmpty: "8[&eMaintenance&8] &cYou don't have any maintenance motds set!"
|
||||
reload: "&8[&cManutencao&8] &aReloaded config, whitelistedplayers, linguagem e icon de manutencao."
|
||||
removedMotd: "&8[&cManutencao&8] &aRemovida motd numero %INDEX%."
|
||||
removeMotdError: "&8[&cManutencao&8] &cSo tens uma motd, entao nao podes remover esta!"
|
||||
setMotd: "&8[&eManutencao&8] &aLinha %LINE% do %INDEX%. Motd de manutencao %MOTD%"
|
||||
setMotdIndexError: "&8[&cManutencao&8] §cTens atualmente %MOTDS% motds, entao escolhe um numero entre 1 e %NEWAMOUNT%."
|
||||
setMotdIndexError: "&8[&cManutencao&8] &cTens atualmente %MOTDS% motds, entao escolhe um numero entre 1 e %NEWAMOUNT%."
|
||||
setMotdLineError: "&8[&cManutencao&8] &cO segundo argumento tem de ser na linha (1 ou 2)!"
|
||||
updateDownloading: "&8[&cManutencao&8] &c&lDownloading update..."
|
||||
updateFailed: "&8[&cManutencao&8] &4&lUpdate falhado!"
|
||||
@@ -41,14 +42,7 @@ playerNotFoundUuid: "&8[&cManutencao&8] &cNenhum player com esse uuid foi encont
|
||||
playerNotOnline: "&8[&cManutencao&8] &cNao esta ninguem online com esse nome"
|
||||
invalidUuid: "&8[&eMaintenance&8] &cFormato de uuid invalido!"
|
||||
|
||||
second: "segundo"
|
||||
seconds: "segundos"
|
||||
minute: "minuto"
|
||||
minutes: "minutos"
|
||||
hour: "hora"
|
||||
hours: "horas"
|
||||
|
||||
# Algumas mensagens para o Bungee, ignora-as se estas a usar Spigot
|
||||
# Algumas mensagens para o Bungee/Velocity, ignora-as se estas a usar Spigot/Sponge
|
||||
serverNotFound: "&8[&cManutencao&8] &cServidor nao encontrado!"
|
||||
singleTimerAlreadyRunning: "&8[&cManutencao&8] &cO Timer ja esta a decorrer!"
|
||||
singleTimerNotRunning: "&8[&cManutencao&8] &cO Timer nao esta a decorrer!"
|
||||
@@ -62,4 +56,36 @@ singleMaintenanceDeactivated: "&8[&cManutencao&8] &6Manutencao esta agora desati
|
||||
singleServerAlreadyEnabled: "&8[&cManutencao&8] &cManutencao ja esta ativada no &e%SERVER%&c!"
|
||||
singleServerAlreadyDisabled: "&8[&cManutencao&8] &cManutencao ja esta desativada no &e%SERVER%&c!"
|
||||
singleServerMaintenanceList: "&8[&cManutencao&8] &7Servidores com manutencao ativa:"
|
||||
singleServerMaintenanceListEmpty: "&8[&cManutencao&8] &7Nao existem servidores com a manutencao ativa."
|
||||
singleServerMaintenanceListEmpty: "&8[&cManutencao&8] &7Nao existem servidores com a manutencao ativa."
|
||||
|
||||
second: "segundo"
|
||||
seconds: "segundos"
|
||||
minute: "minuto"
|
||||
minutes: "minutos"
|
||||
hour: "hora"
|
||||
hours: "horas"
|
||||
|
||||
helpHeader: "&8========[ &e%NAME% &8| &e%PAGE%/%MAX% &8]========"
|
||||
helpPageNotFound: "&8[&eManutencao&8] &cNao existe nenhuma pagina com esse numero!"
|
||||
helpNextPage: "&7Use &b/maintenance help %PAGE% &7to get to the next help window."
|
||||
helpAbortTimer: "&6/maintenance aborttimer &7(If running, the current timer will be aborted)"
|
||||
helpEndtimer: "&6/maintenance endtimer <minutes> &7(After the given time in minutes, maintenance mode will be disabled)"
|
||||
helpStarttimer: "&6/maintenance starttimer <minutes> &7(After the given time in minutes, maintenance mode will be enabled)"
|
||||
helpDump: "&6/maintenance dump &7(Dumps some server information, used for bug reports)"
|
||||
helpHelp: "&6/maintenance help [page] &7(Shows this beautiful help window)"
|
||||
helpMotd: "&6/maintenance motd [timer] &7(Lists the currently set maintenance motds. If specifying 'timer', the timer motds are shown)"
|
||||
helpRemoveMotd: "&6/maintenance removemotd [timer] <index> &7(Removes a maintenance motd. If using \"timer\" as an argument, a timerspecific pingmessage will be removed)"
|
||||
helpSetMotd: "&6/maintenance setmotd [timer] <index> <1/2> <message> &7(Sets a motd for maintenance mode. If using \"timer\" as an argument, a timerspecific pingmessage will be set)"
|
||||
helpReload: "&6/maintenance reload &7(Reloads the config file, whitelist file and the server-icon)"
|
||||
helpToggle: "&6/maintenance <on/off> &7(Enables/disables maintenance mode)"
|
||||
helpUpdate: "&6/maintenance update &7(Remotely downloads the newest version of the plugin onto your server)"
|
||||
helpWhitelist: "&6/maintenance whitelist &7(Shows all whitelisted players for the maintenance mode)"
|
||||
helpWhitelistAdd: "&6/maintenance add <name/uuid> &7(Adds the player to the maintenance whitelist, so they can join the server even though maintenance is enabled)"
|
||||
helpWhitelistRemove: "&6/maintenance remove <name/uuid> &7(Removes the player from the maintenance whitelist)"
|
||||
|
||||
# Algumas mensagens para o Bungee/Velocity, ignora-as se estas a usar Spigot/Sponge
|
||||
helpAbortSingleTimer: "&6/maintenance aborttimer [server] &7(If running, the current timer will be aborted)"
|
||||
helpSingleEndtimer: "&6/maintenance endtimer [server] <minutes> &7(After the given time in minutes, maintenance mode will be disabled)"
|
||||
helpSingleStarttimer: "&6/maintenance starttimer [server] <minutes> &7(After the given time in minutes, maintenance mode will be enabled)"
|
||||
helpSingleToggle: "&6/maintenance <on/off> [server] &7(Enables/disables maintenance mode)"
|
||||
helpStatus: "&6/maintenance status &7(Lists all proxied servers, that are currently under maintenance)"
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.kennytv.maintenance</groupId>
|
||||
<artifactId>maintenance-parent</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maintenance-spigot</artifactId>
|
||||
@@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>com.destroystokyo.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Needed for backwards compatibility with Paper -->
|
||||
|
||||
+13
-5
@@ -43,6 +43,7 @@ import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.util.CachedServerIcon;
|
||||
@@ -79,7 +80,7 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
|
||||
final PluginManager pm = getServer().getPluginManager();
|
||||
pm.registerEvents(new PlayerLoginListener(this, settings), plugin);
|
||||
|
||||
if (isAcceptablePaper()) {
|
||||
if (canUsePaperListener()) {
|
||||
pm.registerEvents(new PaperServerListPingListener(this, settings), plugin);
|
||||
} else {
|
||||
if (pm.isPluginEnabled("ProtocolLib")) {
|
||||
@@ -102,9 +103,14 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isAcceptablePaper() {
|
||||
private boolean canUsePaperListener() {
|
||||
try {
|
||||
Class.forName("com.destroystokyo.paper.event.server.PaperServerListPingEvent");
|
||||
if (getServer().getPluginManager().isPluginEnabled("ProtocolSupport")) {
|
||||
getLogger().warning("Found ProtocolSupport - switching to ProtocolLib packet adapter, as PS does not fire Paper's ping event");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (final ClassNotFoundException e) {
|
||||
return false;
|
||||
@@ -157,9 +163,11 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
|
||||
|
||||
@Override
|
||||
protected void kickPlayers() {
|
||||
getServer().getOnlinePlayers().stream()
|
||||
.filter(p -> !hasPermission(p, "bypass") && !settings.getWhitelistedPlayers().containsKey(p.getUniqueId()))
|
||||
.forEach(p -> p.kickPlayer(settings.getKickMessage()));
|
||||
for (final Player p : getServer().getOnlinePlayers()) {
|
||||
if (!hasPermission(p, "bypass") && !settings.getWhitelistedPlayers().containsKey(p.getUniqueId())) {
|
||||
p.kickPlayer(settings.getKickMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
-34
@@ -46,40 +46,6 @@ public final class MaintenanceSpigotCommand extends MaintenanceCommand implement
|
||||
return true;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
protected void addPlayerToWhitelist(final SenderInfo sender, final String name) {
|
||||
final Player selected = Bukkit.getOfflinePlayer(name);
|
||||
if (selected != null) {
|
||||
whitelistAddMessage(sender, new BukkitSenderInfo(selected));
|
||||
return;
|
||||
}
|
||||
|
||||
final OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(name);
|
||||
if (!offlinePlayer.hasPlayedBefore()) {
|
||||
sender.sendMessage(settings.getMessage("playerNotFound"));
|
||||
return;
|
||||
}
|
||||
|
||||
whitelistAddMessage(sender, new BukkitOfflinePlayerInfo(offlinePlayer));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void removePlayerFromWhitelist(final SenderInfo sender, final String name) {
|
||||
final Player selected = Bukkit.getOfflinePlayer(name);
|
||||
if (selected != null) {
|
||||
whitelistRemoveMessage(sender, new BukkitSenderInfo(selected));
|
||||
return;
|
||||
}
|
||||
|
||||
final OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(name);
|
||||
if (!offlinePlayer.hasPlayedBefore()) {
|
||||
sender.sendMessage(settings.getMessage("playerNotFound"));
|
||||
return;
|
||||
}
|
||||
|
||||
whitelistRemoveMessage(sender, new BukkitOfflinePlayerInfo(offlinePlayer));
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(final CommandSender sender, final Command command, final String alias, final String[] args) {
|
||||
return getSuggestions(new BukkitSenderInfo(sender), args);
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public final class PaperServerListPingListener implements Listener {
|
||||
event.setMotd(settings.getRandomPingMessage());
|
||||
|
||||
if (settings.hasCustomPlayerCountMessage()) {
|
||||
event.setProtocolVersion(0);
|
||||
event.setProtocolVersion(-1);
|
||||
event.setVersion(settings.getPlayerCountMessage()
|
||||
.replace("%ONLINE%", Integer.toString(plugin.getServer().getOnlinePlayers().size()))
|
||||
.replace("%MAX%", Integer.toString(plugin.getServer().getMaxPlayers())));
|
||||
|
||||
+6
-2
@@ -22,6 +22,7 @@ import eu.kennytv.maintenance.core.Settings;
|
||||
import eu.kennytv.maintenance.core.listener.JoinListenerBase;
|
||||
import eu.kennytv.maintenance.spigot.MaintenanceSpigotPlugin;
|
||||
import eu.kennytv.maintenance.spigot.util.BukkitSenderInfo;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
@@ -45,7 +46,10 @@ public final class PlayerLoginListener extends JoinListenerBase implements Liste
|
||||
|
||||
@Override
|
||||
protected void broadcastJoinNotification(final String name) {
|
||||
plugin.getServer().getOnlinePlayers().stream().filter(p -> plugin.hasPermission(p, "joinnotification"))
|
||||
.forEach(p -> p.sendMessage(settings.getMessage("joinNotification").replace("%PLAYER%", name)));
|
||||
for (final Player p : plugin.getServer().getOnlinePlayers()) {
|
||||
if (plugin.hasPermission(p, "joinnotification")) {
|
||||
p.sendMessage(settings.getMessage("joinNotification").replace("%PLAYER%", name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+56
-31
@@ -1,16 +1,18 @@
|
||||
package eu.kennytv.maintenance.spigot.metrics;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.ServicePriority;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Timer;
|
||||
@@ -19,11 +21,16 @@ import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
/**
|
||||
* bStats collects some data for plugin authors.
|
||||
* <p>
|
||||
* Check out https://bStats.org/ to learn more about bStats!
|
||||
*/
|
||||
public final class MetricsLite {
|
||||
|
||||
public static final int B_STATS_VERSION = 1;
|
||||
private static final String URL = "https://bStats.org/submitData/bukkit";
|
||||
private boolean enabled;
|
||||
private final boolean enabled;
|
||||
private static boolean logFailedRequests;
|
||||
private static boolean logSentData;
|
||||
private static boolean logResponseStatusText;
|
||||
@@ -55,15 +62,15 @@ public final class MetricsLite {
|
||||
).copyDefaults(true);
|
||||
try {
|
||||
config.save(configFile);
|
||||
} catch (IOException ignored) {
|
||||
} catch (final IOException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
serverUUID = config.getString("serverUuid");
|
||||
logFailedRequests = config.getBoolean("logFailedRequests", false);
|
||||
enabled = config.getBoolean("enabled", true);
|
||||
logSentData = config.getBoolean("logSentData", false);
|
||||
logResponseStatusText = config.getBoolean("logResponseStatusText", false);
|
||||
enabled = config.getBoolean("enabled", true);
|
||||
if (enabled) {
|
||||
boolean found = false;
|
||||
for (final Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
|
||||
@@ -90,7 +97,7 @@ public final class MetricsLite {
|
||||
timer.scheduleAtFixedRate(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!plugin.isEnabled()) {
|
||||
if (!plugin.isEnabled()) { // Plugin was disabled
|
||||
timer.cancel();
|
||||
return;
|
||||
}
|
||||
@@ -99,24 +106,24 @@ public final class MetricsLite {
|
||||
}, 1000 * 60 * 5, 1000 * 60 * 30);
|
||||
}
|
||||
|
||||
public JSONObject getPluginData() {
|
||||
final JSONObject data = new JSONObject();
|
||||
public JsonObject getPluginData() {
|
||||
final JsonObject data = new JsonObject();
|
||||
|
||||
final String pluginName = plugin.getDescription().getName();
|
||||
final String pluginVersion = plugin.getDescription().getVersion();
|
||||
|
||||
data.put("pluginName", pluginName);
|
||||
data.put("pluginVersion", pluginVersion);
|
||||
final JSONArray customCharts = new JSONArray();
|
||||
data.put("customCharts", customCharts);
|
||||
data.addProperty("pluginName", pluginName);
|
||||
data.addProperty("pluginVersion", pluginVersion);
|
||||
data.add("customCharts", new JsonArray());
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
private JSONObject getServerData() {
|
||||
private JsonObject getServerData() {
|
||||
final int playerAmount = Bukkit.getOnlinePlayers().size();
|
||||
final int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
|
||||
final String bukkitVersion = Bukkit.getVersion();
|
||||
final String bukkitName = Bukkit.getName();
|
||||
|
||||
final String javaVersion = System.getProperty("java.version");
|
||||
final String osName = System.getProperty("os.name");
|
||||
@@ -124,34 +131,53 @@ public final class MetricsLite {
|
||||
final String osVersion = System.getProperty("os.version");
|
||||
final int coreCount = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
final JSONObject data = new JSONObject();
|
||||
final JsonObject data = new JsonObject();
|
||||
|
||||
data.put("serverUUID", serverUUID);
|
||||
data.addProperty("serverUUID", serverUUID);
|
||||
|
||||
data.put("playerAmount", playerAmount);
|
||||
data.put("onlineMode", onlineMode);
|
||||
data.put("bukkitVersion", bukkitVersion);
|
||||
data.addProperty("playerAmount", playerAmount);
|
||||
data.addProperty("onlineMode", onlineMode);
|
||||
data.addProperty("bukkitVersion", bukkitVersion);
|
||||
data.addProperty("bukkitName", bukkitName);
|
||||
|
||||
data.put("javaVersion", javaVersion);
|
||||
data.put("osName", osName);
|
||||
data.put("osArch", osArch);
|
||||
data.put("osVersion", osVersion);
|
||||
data.put("coreCount", coreCount);
|
||||
data.addProperty("javaVersion", javaVersion);
|
||||
data.addProperty("osName", osName);
|
||||
data.addProperty("osArch", osArch);
|
||||
data.addProperty("osVersion", osVersion);
|
||||
data.addProperty("coreCount", coreCount);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
private void submitData() {
|
||||
final JSONObject data = getServerData();
|
||||
final JsonObject data = getServerData();
|
||||
|
||||
final JSONArray pluginData = new JSONArray();
|
||||
final JsonArray pluginData = new JsonArray();
|
||||
for (final Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
|
||||
try {
|
||||
service.getField("B_STATS_VERSION");
|
||||
|
||||
for (final RegisteredServiceProvider<?> provider : Bukkit.getServicesManager().getRegistrations(service)) {
|
||||
try {
|
||||
pluginData.add(provider.getService().getMethod("getPluginData").invoke(provider.getProvider()));
|
||||
final Object plugin = provider.getService().getMethod("getPluginData").invoke(provider.getProvider());
|
||||
if (plugin instanceof JsonObject) {
|
||||
pluginData.add((JsonObject) plugin);
|
||||
} else {
|
||||
try {
|
||||
final Class<?> jsonObjectJsonSimple = Class.forName("org.json.simple.JSONObject");
|
||||
if (plugin.getClass().isAssignableFrom(jsonObjectJsonSimple)) {
|
||||
final Method jsonStringGetter = jsonObjectJsonSimple.getDeclaredMethod("toJSONString");
|
||||
jsonStringGetter.setAccessible(true);
|
||||
final String jsonString = (String) jsonStringGetter.invoke(plugin);
|
||||
final JsonObject object = new JsonParser().parse(jsonString).getAsJsonObject();
|
||||
pluginData.add(object);
|
||||
}
|
||||
} catch (final ClassNotFoundException e) {
|
||||
if (logFailedRequests) {
|
||||
this.plugin.getLogger().log(Level.SEVERE, "Encountered unexpected exception ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (final NullPointerException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
|
||||
}
|
||||
}
|
||||
@@ -159,7 +185,7 @@ public final class MetricsLite {
|
||||
}
|
||||
}
|
||||
|
||||
data.put("plugins", pluginData);
|
||||
data.add("plugins", pluginData);
|
||||
|
||||
new Thread(() -> {
|
||||
try {
|
||||
@@ -172,7 +198,7 @@ public final class MetricsLite {
|
||||
}).start();
|
||||
}
|
||||
|
||||
private static void sendData(final Plugin plugin, final JSONObject data) throws Exception {
|
||||
private static void sendData(final Plugin plugin, final JsonObject data) throws Exception {
|
||||
if (data == null) {
|
||||
throw new IllegalArgumentException("Data cannot be null!");
|
||||
}
|
||||
@@ -180,7 +206,7 @@ public final class MetricsLite {
|
||||
throw new IllegalAccessException("This method must not be called from the main thread!");
|
||||
}
|
||||
if (logSentData) {
|
||||
plugin.getLogger().info("Sending data to bStats: " + data.toString());
|
||||
plugin.getLogger().info("Sending data to bStats: " + data);
|
||||
}
|
||||
final HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();
|
||||
|
||||
@@ -210,7 +236,7 @@ public final class MetricsLite {
|
||||
builder.append(line);
|
||||
}
|
||||
bufferedReader.close();
|
||||
plugin.getLogger().info("Sent data to bStats and received response: " + builder.toString());
|
||||
plugin.getLogger().info("Sent data to bStats and received response: " + builder);
|
||||
} else {
|
||||
connection.getInputStream().close();
|
||||
}
|
||||
@@ -226,5 +252,4 @@ public final class MetricsLite {
|
||||
gzip.close();
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@ version: ${project.version}
|
||||
main: eu.kennytv.maintenance.spigot.MaintenanceSpigotBase
|
||||
author: KennyTV
|
||||
description: Enable maintenance mode with a custom maintenance motd and icon.
|
||||
softdepend: [ProtocolLib, ServerListPlus]
|
||||
softdepend: [ProtocolLib, ServerListPlus, ProtocolSupport]
|
||||
website: https://www.spigotmc.org/resources/maintenance.40699/
|
||||
api-version: 1.13
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.kennytv.maintenance</groupId>
|
||||
<artifactId>maintenance-parent</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maintenance-sponge</artifactId>
|
||||
|
||||
+8
-4
@@ -37,9 +37,11 @@ import eu.kennytv.maintenance.sponge.util.SpongeOfflinePlayerInfo;
|
||||
import eu.kennytv.maintenance.sponge.util.SpongeSenderInfo;
|
||||
import eu.kennytv.maintenance.sponge.util.SpongeTask;
|
||||
import org.spongepowered.api.Game;
|
||||
import org.spongepowered.api.Platform;
|
||||
import org.spongepowered.api.Server;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.config.ConfigDir;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.event.EventManager;
|
||||
import org.spongepowered.api.event.Listener;
|
||||
import org.spongepowered.api.event.game.GameReloadEvent;
|
||||
@@ -175,9 +177,11 @@ public final class MaintenanceSpongePlugin extends MaintenancePlugin {
|
||||
|
||||
@Override
|
||||
protected void kickPlayers() {
|
||||
getServer().getOnlinePlayers().stream()
|
||||
.filter(p -> !hasPermission(p, "bypass") && !settings.getWhitelistedPlayers().containsKey(p.getUniqueId()))
|
||||
.forEach(p -> p.kick(Text.of(settings.getKickMessage())));
|
||||
for (final Player p : getServer().getOnlinePlayers()) {
|
||||
if (!hasPermission(p, "bypass") && !settings.getWhitelistedPlayers().containsKey(p.getUniqueId())) {
|
||||
p.kick(Text.of(settings.getKickMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,7 +212,7 @@ public final class MaintenanceSpongePlugin extends MaintenancePlugin {
|
||||
|
||||
@Override
|
||||
public String getServerVersion() {
|
||||
return game.getPlatform().getImplementation().getName();
|
||||
return game.getPlatform().getContainer(Platform.Component.IMPLEMENTATION).getVersion().orElse("woop wooop");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-2
@@ -36,9 +36,9 @@ import org.spongepowered.api.world.Location;
|
||||
import org.spongepowered.api.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@NonnullByDefault
|
||||
public final class MaintenanceSpongeCommand extends MaintenanceCommand implements CommandCallable {
|
||||
@@ -91,7 +91,11 @@ public final class MaintenanceSpongeCommand extends MaintenanceCommand implement
|
||||
|
||||
@Override
|
||||
public List<String> getPlayersCompletion() {
|
||||
return Sponge.getServer().getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList());
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (final Player player : Sponge.getServer().getOnlinePlayers()) {
|
||||
list.add(player.getName());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private String[] getArgs(final String arguments, final int limit) {
|
||||
|
||||
+6
-2
@@ -23,6 +23,7 @@ import eu.kennytv.maintenance.core.listener.JoinListenerBase;
|
||||
import eu.kennytv.maintenance.sponge.MaintenanceSpongePlugin;
|
||||
import eu.kennytv.maintenance.sponge.util.SpongeSenderInfo;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.event.Listener;
|
||||
import org.spongepowered.api.event.network.ClientConnectionEvent;
|
||||
import org.spongepowered.api.text.Text;
|
||||
@@ -50,8 +51,11 @@ public final class ClientConnectionListener extends JoinListenerBase {
|
||||
|
||||
@Override
|
||||
protected void broadcastJoinNotification(final String name) {
|
||||
|
||||
final Text text = plugin.translate(settings.getMessage("joinNotification").replace("%PLAYER%", name));
|
||||
Sponge.getServer().getOnlinePlayers().stream().filter(p -> plugin.hasPermission(p, "joinnotification")).forEach(p -> p.sendMessage(text));
|
||||
for (final Player p : Sponge.getServer().getOnlinePlayers()) {
|
||||
if (plugin.hasPermission(p, "joinnotification")) {
|
||||
p.sendMessage(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.kennytv.maintenance</groupId>
|
||||
<artifactId>maintenance-parent</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maintenance-velocity</artifactId>
|
||||
@@ -29,7 +29,7 @@
|
||||
<dependency>
|
||||
<groupId>com.velocitypowered</groupId>
|
||||
<artifactId>velocity-api</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
+14
-11
@@ -55,7 +55,7 @@ import eu.kennytv.maintenance.velocity.util.VelocityTask;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.event.ClickEvent;
|
||||
import net.kyori.text.event.HoverEvent;
|
||||
import net.kyori.text.serializer.ComponentSerializers;
|
||||
import net.kyori.text.serializer.legacy.LegacyComponentSerializer;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.io.File;
|
||||
@@ -131,28 +131,30 @@ public final class MaintenanceVelocityPlugin extends MaintenanceProxyPlugin {
|
||||
final TextComponent tc1 = translate(getPrefix());
|
||||
final TextComponent tc2 = translate("§cDownload it at: §6https://www.spigotmc.org/resources/maintenance.40699/");
|
||||
final TextComponent click = translate(" §7§l§o(CLICK ME)");
|
||||
click.clickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.spigotmc.org/resources/maintenance.40699/"));
|
||||
click.hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("§aDownload the latest version")));
|
||||
click.clickEvent(ClickEvent.openUrl("https://www.spigotmc.org/resources/maintenance.40699/"));
|
||||
click.hoverEvent(HoverEvent.showText(TextComponent.of("§aDownload the latest version")));
|
||||
tc1.append(tc2);
|
||||
tc1.append(click);
|
||||
((VelocitySenderInfo) sender).sendMessage(tc1);
|
||||
}
|
||||
|
||||
public boolean isMaintenance(final RegisteredServer serverInfo) {
|
||||
return settingsProxy.isMaintenance(new VelocityServer(serverInfo));
|
||||
return settingsProxy.isMaintenance(serverInfo.getServerInfo().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void kickPlayers() {
|
||||
server.getAllPlayers().stream()
|
||||
.filter(p -> !hasPermission(p, "bypass") && !settingsProxy.getWhitelistedPlayers().containsKey(p.getUniqueId()))
|
||||
.forEach(p -> p.disconnect(TextComponent.of(settingsProxy.getKickMessage())));
|
||||
for (final Player p : server.getAllPlayers()) {
|
||||
if (!hasPermission(p, "bypass") && !settingsProxy.getWhitelistedPlayers().containsKey(p.getUniqueId())) {
|
||||
p.disconnect(TextComponent.of(settingsProxy.getKickMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void kickPlayers(final Server server, final Server fallback) {
|
||||
final RegisteredServer fallbackServer = fallback != null ? ((VelocityServer) fallback).getServer() : null;
|
||||
((VelocityServer) server).getServer().getPlayersConnected().forEach(p -> {
|
||||
for (final Player p : ((VelocityServer) server).getServer().getPlayersConnected()) {
|
||||
if (!hasPermission(p, "bypass") && !settingsProxy.getWhitelistedPlayers().containsKey(p.getUniqueId())) {
|
||||
if (fallbackServer != null && !isMaintenance(fallback)) {
|
||||
p.sendMessage(translate(settingsProxy.getMessage("singleMaintenanceActivated").replace("%SERVER%", server.getName())));
|
||||
@@ -166,7 +168,7 @@ public final class MaintenanceVelocityPlugin extends MaintenanceProxyPlugin {
|
||||
} else {
|
||||
p.sendMessage(translate(settingsProxy.getMessage("singleMaintenanceActivated").replace("%SERVER%", server.getName())));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,7 +197,8 @@ public final class MaintenanceVelocityPlugin extends MaintenanceProxyPlugin {
|
||||
@Override
|
||||
public String getServer(final SenderInfo sender) {
|
||||
final Optional<Player> player = server.getPlayer(sender.getUuid());
|
||||
return player.map(p -> p.getCurrentServer().get().getServerInfo().getName()).orElse("");
|
||||
if (!player.isPresent() || player.get().getCurrentServer().isPresent()) return "";
|
||||
return player.get().getCurrentServer().get().getServerInfo().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -261,6 +264,6 @@ public final class MaintenanceVelocityPlugin extends MaintenanceProxyPlugin {
|
||||
}
|
||||
|
||||
public TextComponent translate(final String s) {
|
||||
return ComponentSerializers.LEGACY.deserialize(s);
|
||||
return LegacyComponentSerializer.INSTANCE.deserialize(s);
|
||||
}
|
||||
}
|
||||
+19
-9
@@ -21,6 +21,7 @@ package eu.kennytv.maintenance.velocity.command;
|
||||
import com.velocitypowered.api.command.Command;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import eu.kennytv.maintenance.core.proxy.SettingsProxy;
|
||||
import eu.kennytv.maintenance.core.proxy.command.MaintenanceProxyCommand;
|
||||
import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
@@ -31,8 +32,8 @@ import net.kyori.text.event.ClickEvent;
|
||||
import net.kyori.text.event.HoverEvent;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public final class MaintenanceVelocityCommand extends MaintenanceProxyCommand implements Command {
|
||||
private final MaintenanceVelocityPlugin plugin;
|
||||
@@ -61,8 +62,8 @@ public final class MaintenanceVelocityCommand extends MaintenanceProxyCommand im
|
||||
@Override
|
||||
protected void sendUpdateMessage(final SenderInfo sender) {
|
||||
final TextComponent tc = TextComponent.builder("").append(plugin.translate("§6× §8[§aUpdate§8]"))
|
||||
.clickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/maintenance forceupdate"))
|
||||
.hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, plugin.translate("§aClick here to update the plugin")))
|
||||
.clickEvent(ClickEvent.runCommand("/maintenance forceupdate"))
|
||||
.hoverEvent(HoverEvent.showText(plugin.translate("§aClick here to update the plugin")))
|
||||
.append(plugin.translate(" §8(§7Or use the command §c/maintenance forceupdate§8)")).build();
|
||||
((VelocitySenderInfo) sender).sendMessage(tc);
|
||||
}
|
||||
@@ -70,20 +71,29 @@ public final class MaintenanceVelocityCommand extends MaintenanceProxyCommand im
|
||||
@Override
|
||||
public void sendDumpMessage(final SenderInfo sender, final String url) {
|
||||
final TextComponent clickText = TextComponent.builder("").append(plugin.translate(plugin.getPrefix() + "§7Click here to copy the link."))
|
||||
.clickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, url))
|
||||
.hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, plugin.translate("§aClick here to copy the link"))).build();
|
||||
.clickEvent(ClickEvent.suggestCommand(url))
|
||||
.hoverEvent(HoverEvent.showText(plugin.translate("§aClick here to copy the link"))).build();
|
||||
((VelocitySenderInfo) sender).sendMessage(clickText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getServersCompletion(final String s) {
|
||||
return plugin.getServer().getAllServers().stream().filter(server -> server.getServerInfo().getName().toLowerCase().startsWith(s))
|
||||
.filter(server -> !plugin.getSettingsProxy().getFallbackServer().contains(server.getServerInfo().getName()))
|
||||
.map(server -> server.getServerInfo().getName()).collect(Collectors.toList());
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (final RegisteredServer server : plugin.getServer().getAllServers()) {
|
||||
final String name = server.getServerInfo().getName();
|
||||
if (name.toLowerCase().startsWith(s) && !plugin.getSettingsProxy().getFallbackServer().contains(name)) {
|
||||
list.add(name);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getPlayersCompletion() {
|
||||
return plugin.getServer().getAllPlayers().stream().map(Player::getUsername).collect(Collectors.toList());
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (final Player player : plugin.getServer().getAllPlayers()) {
|
||||
list.add(player.getUsername());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -22,6 +22,7 @@ import com.velocitypowered.api.event.ResultedEvent;
|
||||
import com.velocitypowered.api.event.Subscribe;
|
||||
import com.velocitypowered.api.event.connection.LoginEvent;
|
||||
import com.velocitypowered.api.event.connection.PostLoginEvent;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import eu.kennytv.maintenance.core.Settings;
|
||||
import eu.kennytv.maintenance.core.listener.JoinListenerBase;
|
||||
import eu.kennytv.maintenance.velocity.MaintenanceVelocityPlugin;
|
||||
@@ -51,6 +52,10 @@ public final class LoginListener extends JoinListenerBase {
|
||||
@Override
|
||||
protected void broadcastJoinNotification(final String name) {
|
||||
final TextComponent s = plugin.translate(settings.getMessage("joinNotification").replace("%PLAYER%", name));
|
||||
plugin.getServer().getAllPlayers().stream().filter(p -> plugin.hasPermission(p, "joinnotification")).forEach(p -> p.sendMessage(s));
|
||||
for (final Player p : plugin.getServer().getAllPlayers()) {
|
||||
if (plugin.hasPermission(p, "joinnotification")) {
|
||||
p.sendMessage(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-2
@@ -43,14 +43,22 @@ public final class ServerConnectListener implements EventHandler<ServerPreConnec
|
||||
if (!event.getResult().isAllowed()) return;
|
||||
|
||||
final Player player = event.getPlayer();
|
||||
if (!event.getResult().getServer().isPresent()) return;
|
||||
|
||||
final RegisteredServer target = event.getResult().getServer().get();
|
||||
if (!plugin.isMaintenance(target)) return;
|
||||
if (plugin.hasPermission(player, "bypass") || settings.getWhitelistedPlayers().containsKey(player.getUniqueId())) return;
|
||||
if (plugin.hasPermission(player, "bypass") || settings.getWhitelistedPlayers().containsKey(player.getUniqueId())
|
||||
|| plugin.hasPermission(player, "singleserver.bypass." + target.getServerInfo().getName().toLowerCase()))
|
||||
return;
|
||||
|
||||
event.setResult(ServerPreConnectEvent.ServerResult.denied());
|
||||
if (settings.isJoinNotifications()) {
|
||||
final TextComponent s = plugin.translate(settings.getMessage("joinNotification").replace("%PLAYER%", player.getUsername()));
|
||||
target.getPlayersConnected().stream().filter(p -> plugin.hasPermission(p, "joinnotification")).forEach(p -> p.sendMessage(s));
|
||||
for (final Player p : target.getPlayersConnected()) {
|
||||
if (plugin.hasPermission(p, "joinnotification")) {
|
||||
p.sendMessage(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Normal serverconnect
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import eu.kennytv.maintenance.core.util.SenderInfo;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.serializer.ComponentSerializers;
|
||||
import net.kyori.text.serializer.legacy.LegacyComponentSerializer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -50,7 +50,7 @@ public final class VelocitySenderInfo implements SenderInfo {
|
||||
|
||||
@Override
|
||||
public void sendMessage(final String message) {
|
||||
sender.sendMessage(ComponentSerializers.LEGACY.deserialize(message));
|
||||
sender.sendMessage(LegacyComponentSerializer.INSTANCE.deserialize(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-3
@@ -18,10 +18,11 @@
|
||||
|
||||
package eu.kennytv.maintenance.velocity.util;
|
||||
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import eu.kennytv.maintenance.api.proxy.Server;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.serializer.ComponentSerializers;
|
||||
import net.kyori.text.serializer.legacy.LegacyComponentSerializer;
|
||||
|
||||
public final class VelocityServer implements Server {
|
||||
private final RegisteredServer server;
|
||||
@@ -42,8 +43,10 @@ public final class VelocityServer implements Server {
|
||||
|
||||
@Override
|
||||
public void broadcast(final String message) {
|
||||
final TextComponent s = ComponentSerializers.LEGACY.deserialize(message);
|
||||
server.getPlayersConnected().forEach(p -> p.sendMessage(s));
|
||||
final TextComponent s = LegacyComponentSerializer.INSTANCE.deserialize(message);
|
||||
for (final Player p : server.getPlayersConnected()) {
|
||||
p.sendMessage(s);
|
||||
}
|
||||
}
|
||||
|
||||
public RegisteredServer getServer() {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>eu.kennytv.maintenance</groupId>
|
||||
<artifactId>maintenance-parent</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.3</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Maintenance</name>
|
||||
@@ -39,16 +39,12 @@
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>bungeecord-repo</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spigotmc-repo</id>
|
||||
<id>spigotmc</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
@@ -60,7 +56,7 @@
|
||||
<url>https://repo.velocitypowered.com/snapshots</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>dmulloy2-repo</id>
|
||||
<id>dmulloy2</id>
|
||||
<url>http://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
|
||||
Reference in new issue
Block a user