diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 06d2fdd8..64a83852 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,6 +1,17 @@ # Maintenance Changelog This file contains update logs for this project. The top may contain a `Unreleased` section, gathering update logs for a future update during development. +--- +## 3.0.7 - August 17th 2021 +### Changed +* Bungee/Velocity: `/maintenance add ` now works for offline players as well +* Added config options `commands-on-maintenance-enable` and `commands-on-maintenance-disable` to define commands to be executed after maintenance has been toggled +* Added config option `enable-pingmessages` to can change whether a custom maintenance motd should be displayed during maintenance +* Added language fields `scheduletimerBroadcast` and `singleScheduletimerBroadcast` with the variables `%SERVER%`, `%TIME%`, and `%DURATION%` instead of using the normal starttimer broadcasts +### Fixed +* Fixed SQL loading issues on some platforms +* Fixed missing language key warning for the debug command +* Velocity: Fixed the update message --- ## 3.0.6 - February 17th 2021 ### Changed diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 407d9e87..e002d2db 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -7,24 +7,25 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.3.4 - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.6 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-maven- - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - name: Set up JDK 11 + uses: actions/setup-java@v2.1.0 with: - java-version: 1.8 + java-version: 11 + distribution: 'adopt' - name: Build with Maven run: mvn -B package --file pom.xml - name: Upload a Build Artifact - uses: actions/upload-artifact@v2.1.4 + uses: actions/upload-artifact@v2.2.4 with: name: MaintenanceFiles path: | diff --git a/LICENSE.txt b/LICENSE.txt index 9e419e04..e72bfdda 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,7 +1,7 @@ -GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found. 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 . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. \ No newline at end of file +. \ No newline at end of file diff --git a/README.md b/README.md index 36a54186..dcf4671a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # Maintenance -[![Version](https://img.shields.io/github/release/KennyTV/Maintenance.svg)](https://github.com/KennyTV/Maintenance/releases) -![Build Status](https://github.com/KennyTV/Maintenance/workflows/Build/badge.svg) -[![GH Downloads](https://img.shields.io/github/downloads/KennyTV/Maintenance/total)](https://github.com/KennyTV/Maintenance/releases) +[![Version](https://img.shields.io/github/release/kennytv/Maintenance.svg)](https://github.com/kennytv/Maintenance/releases) +![Build Status](https://github.com/kennytv/Maintenance/workflows/Build/badge.svg) +[![GH Downloads](https://img.shields.io/github/downloads/kennytv/Maintenance/total)](https://github.com/kennytv/Maintenance/releases) [![Discord](https://img.shields.io/discord/489135856284729384.svg?label=Discord&logo=discord&logoColor=fff)](https://discord.gg/vGCUzHq) -[![Twitter](https://img.shields.io/twitter/follow/KennyTVN.svg?label=Twitter)](https://twitter.com/KennyTVN) -Maintenance is probably the most customizable free maintenance plugin for your Minecraft server you can find. It runs on Spigot, BungeeCord, Sponge, as well as Velocity. +[![Twitter](https://img.shields.io/twitter/follow/kennytvn.svg?label=Twitter)](https://twitter.com/kennytvn) + +Maintenance is the most customizable free maintenance plugin for your Minecraft server you can find. It runs on Spigot, BungeeCord, Sponge, as well as Velocity. Its features include: * A custom motd as well as server icon, that will be shown during maintenance @@ -15,15 +16,15 @@ 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 ` command * Link multiple proxy instances through a MySQL database connection, so you don't have to change maintenance on each proxy by hand - * Use PlaceholderAPI placeholders with the [**MaintenanceAddon**](https://github.com/KennyTV/Maintenance/wiki/MaintenanceAddon) (only for Bungee) + * Use PlaceholderAPI placeholders with the [**MaintenanceAddon**](https://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) (configuration, permissions, API usage) -* [Downloads](https://github.com/KennyTV/Maintenance/releases) (GitHub) -* [Changelogs](https://github.com/KennyTV/Maintenance/blob/master/.github/CHANGELOG.md) -* [Issue tracker/bug reports](https://github.com/KennyTV/Maintenance/issues) +* [Wiki](https://github.com/kennytv/Maintenance/wiki) (configuration, permissions, API usage) +* [Downloads](https://github.com/kennytv/Maintenance/releases) (GitHub) +* [Changelogs](https://github.com/kennytv/Maintenance/blob/master/.github/CHANGELOG.md) +* [Issue tracker/bug reports](https://github.com/kennytv/Maintenance/issues) * [Discord](https://discord.gg/vGCUzHq) -* [PlaceholderAPI addon](https://github.com/KennyTV/Maintenance/wiki/MaintenanceAddon) +* [PlaceholderAPI addon](https://github.com/kennytv/Maintenance/wiki/MaintenanceAddon) Other forum threads * [Spigot forums](https://www.spigotmc.org/resources/maintenance.40699/) @@ -33,5 +34,5 @@ Other forum threads ## 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 -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)). +## License +This project is licensed under the [GNU General Public License v3](LICENSE.txt). diff --git a/maintenance-api/pom.xml b/maintenance-api/pom.xml index dbdb3ce5..e495f3c1 100644 --- a/maintenance-api/pom.xml +++ b/maintenance-api/pom.xml @@ -6,7 +6,7 @@ eu.kennytv.maintenance maintenance-parent - 3.0.6 + 3.0.7 maintenance-api @@ -16,13 +16,13 @@ net.md-5 bungeecord-api - 1.15-SNAPSHOT + 1.17-R0.1-SNAPSHOT provided org.spigotmc spigot-api - 1.15.2-R0.1-SNAPSHOT + 1.16.5-R0.1-SNAPSHOT provided diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/IMaintenance.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/IMaintenance.java index 5fff3d68..87d1ccd9 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/IMaintenance.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/IMaintenance.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,13 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api; import eu.kennytv.maintenance.api.event.manager.IEventManager; /** - * @author KennyTV + * @author kennytv * @since 2.1 */ public interface IMaintenance { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/IMaintenanceBase.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/IMaintenanceBase.java index 40a8ec8c..8f783c41 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/IMaintenanceBase.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/IMaintenanceBase.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,11 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api; /** - * @author KennyTV + * @author kennytv * @since 2.2.2 */ public interface IMaintenanceBase { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/ISettings.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/ISettings.java index 80eccca5..a81b3e08 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/ISettings.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/ISettings.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,14 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api; import java.util.Map; import java.util.UUID; /** - * @author KennyTV + * @author kennytv * @since 2.1 */ public interface ISettings { @@ -34,6 +33,11 @@ public interface ISettings { */ boolean isMaintenance(); + /** + * @return true if custom ping messages during maintenance should be used + */ + boolean isEnablePingMessages(); + /** * @return value of the 'send-join-notification' config field */ diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/bungee/MaintenanceBungeeAPI.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/bungee/MaintenanceBungeeAPI.java index 0206b990..5ade23ce 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/bungee/MaintenanceBungeeAPI.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/bungee/MaintenanceBungeeAPI.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.bungee; import com.google.common.base.Preconditions; @@ -30,7 +29,7 @@ * Only access this class if you're running the plugin on a BungeeCord server! *

* - * @author KennyTV + * @author kennytv * @since 2.5 */ public final class MaintenanceBungeeAPI { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/MaintenanceChangedEvent.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/MaintenanceChangedEvent.java index 70706883..48694709 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/MaintenanceChangedEvent.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/MaintenanceChangedEvent.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.event; import eu.kennytv.maintenance.api.event.manager.MaintenanceEvent; @@ -23,7 +22,7 @@ /** * Notification event fired when maintenance mode has been changed. * - * @author KennyTV + * @author kennytv * @since 3.0.1 */ public final class MaintenanceChangedEvent implements MaintenanceEvent { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/MaintenanceReloadedEvent.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/MaintenanceReloadedEvent.java index 177bd85b..1762ffcf 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/MaintenanceReloadedEvent.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/MaintenanceReloadedEvent.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.event; import eu.kennytv.maintenance.api.IMaintenance; @@ -25,7 +24,7 @@ /** * Notification event fired when Maintenance configuration is reloaded. * - * @author KennyTV + * @author kennytv * @see IMaintenance#isMaintenance() for the new maintenance status * @see IMaintenanceProxy#getMaintenanceServers() for the new list of servers under maintenance * @since 3.0.6 diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/EventListener.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/EventListener.java index a0e7961a..cf63e0d3 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/EventListener.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/EventListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,14 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.event.manager; /** * Abstract class representing a maintenance eventlistener. * * @param event to be listened to - * @author KennyTV + * @author kennytv * @since 3.0.1 */ public abstract class EventListener { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/IEventManager.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/IEventManager.java index 91192fa4..d72cefba 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/IEventManager.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/IEventManager.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,11 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.event.manager; /** - * @author KennyTV + * @author kennytv * @since 3.0.1 */ public interface IEventManager { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/MaintenanceEvent.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/MaintenanceEvent.java index 330926bd..890e3f2f 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/MaintenanceEvent.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/manager/MaintenanceEvent.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,13 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.event.manager; /** * Dummy interface representing a maintenance event. * - * @author KennyTV + * @author kennytv * @since 3.0.1 */ public interface MaintenanceEvent { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/proxy/ServerMaintenanceChangedEvent.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/proxy/ServerMaintenanceChangedEvent.java index cc48b937..3209e3b2 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/proxy/ServerMaintenanceChangedEvent.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/event/proxy/ServerMaintenanceChangedEvent.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.event.proxy; import eu.kennytv.maintenance.api.event.manager.MaintenanceEvent; @@ -24,7 +23,7 @@ /** * Notification event fired when maintenance mode has been changed on a proxied server. * - * @author KennyTV + * @author kennytv * @since 3.0.1 */ public final class ServerMaintenanceChangedEvent implements MaintenanceEvent { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/proxy/IMaintenanceProxy.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/proxy/IMaintenanceProxy.java index d140b3c4..2544fca0 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/proxy/IMaintenanceProxy.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/proxy/IMaintenanceProxy.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.proxy; import eu.kennytv.maintenance.api.IMaintenance; @@ -24,7 +23,7 @@ import java.util.Set; /** - * @author KennyTV + * @author kennytv * @since 3.0 */ public interface IMaintenanceProxy extends IMaintenance { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/proxy/Server.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/proxy/Server.java index 01dbf33f..b138b0bf 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/proxy/Server.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/proxy/Server.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,14 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.proxy; /** * Wrapper for a proxied server. * Use {@link IMaintenanceProxy#getServer(String)} to get a server instance. * - * @author KennyTV + * @author kennytv * @since 3.0 */ public interface Server { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/spigot/MaintenanceSpigotAPI.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/spigot/MaintenanceSpigotAPI.java index 668e51ea..f7124596 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/spigot/MaintenanceSpigotAPI.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/spigot/MaintenanceSpigotAPI.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.spigot; import com.google.common.base.Preconditions; @@ -30,7 +29,7 @@ * Only access this class if you're running the plugin on a Spigot server! *

* - * @author KennyTV + * @author kennytv * @since 2.5 */ public final class MaintenanceSpigotAPI { diff --git a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/sponge/MaintenanceSpongeAPI.java b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/sponge/MaintenanceSpongeAPI.java index c4b92b9e..fcfd8074 100644 --- a/maintenance-api/src/main/java/eu/kennytv/maintenance/api/sponge/MaintenanceSpongeAPI.java +++ b/maintenance-api/src/main/java/eu/kennytv/maintenance/api/sponge/MaintenanceSpongeAPI.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.api.sponge; import com.google.common.base.Preconditions; @@ -31,7 +30,7 @@ * Only access this class if you're running the plugin on a Sponge server! *

* - * @author KennyTV + * @author kennytv * @since 3.0 */ public final class MaintenanceSpongeAPI { diff --git a/maintenance-build/pom.xml b/maintenance-build/pom.xml index 5e5afcc7..e278ee26 100644 --- a/maintenance-build/pom.xml +++ b/maintenance-build/pom.xml @@ -6,7 +6,7 @@ eu.kennytv.maintenance maintenance-parent - 3.0.6 + 3.0.7 maintenance-build diff --git a/maintenance-bungee/pom.xml b/maintenance-bungee/pom.xml index 92fbdea4..69d85c27 100644 --- a/maintenance-bungee/pom.xml +++ b/maintenance-bungee/pom.xml @@ -6,7 +6,7 @@ eu.kennytv.maintenance maintenance-parent - 3.0.6 + 3.0.7 maintenance-bungee @@ -29,7 +29,7 @@ net.md-5 bungeecord-api - 1.16-R0.4-SNAPSHOT + 1.17-R0.1-SNAPSHOT provided diff --git a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/MaintenanceBungeeBase.java b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/MaintenanceBungeeBase.java index a0d66207..09f00ee7 100644 --- a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/MaintenanceBungeeBase.java +++ b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/MaintenanceBungeeBase.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.bungee; import eu.kennytv.maintenance.api.IMaintenance; diff --git a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/MaintenanceBungeePlugin.java b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/MaintenanceBungeePlugin.java index d061ec79..466d67d6 100644 --- a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/MaintenanceBungeePlugin.java +++ b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/MaintenanceBungeePlugin.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.bungee; import eu.kennytv.maintenance.api.bungee.MaintenanceBungeeAPI; @@ -33,6 +32,8 @@ import eu.kennytv.maintenance.core.hook.ServerListPlusHook; import eu.kennytv.maintenance.core.proxy.MaintenanceProxyPlugin; import eu.kennytv.maintenance.core.proxy.SettingsProxy; +import eu.kennytv.maintenance.core.proxy.util.ProfileLookup; +import eu.kennytv.maintenance.core.proxy.util.ProxyOfflineSenderInfo; import eu.kennytv.maintenance.core.util.SenderInfo; import eu.kennytv.maintenance.core.util.ServerType; import eu.kennytv.maintenance.core.util.Task; @@ -61,7 +62,7 @@ import java.util.stream.Collectors; /** - * @author KennyTV + * @author kennytv * @since 1.0 */ public final class MaintenanceBungeePlugin extends MaintenanceProxyPlugin { @@ -90,7 +91,9 @@ public final class MaintenanceBungeePlugin extends MaintenanceProxyPlugin { final Plugin serverListPlus = pm.getPlugin("ServerListPlus"); if (serverListPlus != null) { serverListPlusHook = new ServerListPlusHook(serverListPlus); - serverListPlusHook.setEnabled(!settingsProxy.isMaintenance()); + if (settings.isEnablePingMessages()) { + serverListPlusHook.setEnabled(!settingsProxy.isMaintenance()); + } plugin.getLogger().info("Enabled ServerListPlus integration!"); } } @@ -178,7 +181,18 @@ public Server getServer(final String server) { @Nullable public SenderInfo getOfflinePlayer(final String name) { final ProxiedPlayer player = getProxy().getPlayer(name); - return player != null ? new BungeeSenderInfo(player) : null; + if (player != null) { + return new BungeeSenderInfo(player); + } + + final ProfileLookup profile; + try { + profile = doUUIDLookup(name); + } catch (final IOException e) { + e.printStackTrace(); + return null; + } + return new ProxyOfflineSenderInfo(profile.getUuid(), profile.getName()); } @Override @@ -201,6 +215,11 @@ public void async(final Runnable runnable) { getProxy().getScheduler().runAsync(plugin, runnable); } + @Override + protected void executeConsoleCommand(final String command) { + getProxy().getPluginManager().dispatchCommand(getProxy().getConsole(), command); + } + @Override public void broadcast(final String message) { getProxy().broadcast(message); diff --git a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/command/MaintenanceBungeeCommand.java b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/command/MaintenanceBungeeCommand.java index 16315c7e..5f9eb3b4 100644 --- a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/command/MaintenanceBungeeCommand.java +++ b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/command/MaintenanceBungeeCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.bungee.command; import eu.kennytv.maintenance.bungee.MaintenanceBungeePlugin; diff --git a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/command/MaintenanceBungeeCommandBase.java b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/command/MaintenanceBungeeCommandBase.java index 9e32708e..d9fea6fa 100644 --- a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/command/MaintenanceBungeeCommandBase.java +++ b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/command/MaintenanceBungeeCommandBase.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.bungee.command; import eu.kennytv.maintenance.bungee.util.BungeeSenderInfo; diff --git a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/listener/ProxyPingListener.java b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/listener/ProxyPingListener.java index d27cb0c1..9acbf5ab 100644 --- a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/listener/ProxyPingListener.java +++ b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/listener/ProxyPingListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.bungee.listener; import eu.kennytv.maintenance.bungee.MaintenanceBungeePlugin; @@ -36,7 +35,7 @@ public ProxyPingListener(final MaintenanceBungeePlugin plugin, final SettingsPro @EventHandler(priority = 80) public void proxyPing(final ProxyPingEvent event) { - if (!settings.isMaintenance()) return; + if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return; final ServerPing ping = event.getResponse(); ServerPing.Players players = ping.getPlayers(); diff --git a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/listener/ServerConnectListener.java b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/listener/ServerConnectListener.java index 565c5e15..82182cd7 100644 --- a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/listener/ServerConnectListener.java +++ b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/listener/ServerConnectListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.bungee.listener; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeSenderInfo.java b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeSenderInfo.java index caa2bba3..a0b187db 100644 --- a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeSenderInfo.java +++ b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeSenderInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.bungee.util; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeServer.java b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeServer.java index 9212daf6..07f78779 100644 --- a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeServer.java +++ b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeServer.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.bungee.util; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeTask.java b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeTask.java index a2782019..78589c86 100644 --- a/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeTask.java +++ b/maintenance-bungee/src/main/java/eu/kennytv/maintenance/bungee/util/BungeeTask.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.bungee.util; import eu.kennytv.maintenance.core.util.Task; diff --git a/maintenance-bungee/src/main/resources/bungee.yml b/maintenance-bungee/src/main/resources/bungee.yml index 73a76d1a..cc6fd8ff 100644 --- a/maintenance-bungee/src/main/resources/bungee.yml +++ b/maintenance-bungee/src/main/resources/bungee.yml @@ -1,7 +1,7 @@ name: Maintenance version: ${project.version} main: eu.kennytv.maintenance.bungee.MaintenanceBungeeBase -author: KennyTV +author: kennytv description: Enable maintenance mode with a custom maintenance motd and icon. softDepends: [ServerListPlus] website: https://www.spigotmc.org/resources/maintenance.40699/ \ No newline at end of file diff --git a/maintenance-core-proxy/pom.xml b/maintenance-core-proxy/pom.xml index 025cef93..04fa81e8 100644 --- a/maintenance-core-proxy/pom.xml +++ b/maintenance-core-proxy/pom.xml @@ -6,7 +6,7 @@ eu.kennytv.maintenance maintenance-parent - 3.0.6 + 3.0.7 maintenance-core-proxy @@ -22,7 +22,7 @@ com.zaxxer HikariCP - 3.4.2 + 4.0.3 compile @@ -32,5 +32,17 @@ + + com.google.guava + guava + 29.0-jre + provided + + + com.google.code.gson + gson + 2.8.5 + provided + \ No newline at end of file diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/MaintenanceProxyPlugin.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/MaintenanceProxyPlugin.java index 32446047..2b49ecbe 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/MaintenanceProxyPlugin.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/MaintenanceProxyPlugin.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,9 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy; +import com.google.common.io.CharStreams; +import com.google.gson.JsonObject; import eu.kennytv.maintenance.api.event.proxy.ServerMaintenanceChangedEvent; import eu.kennytv.maintenance.api.proxy.IMaintenanceProxy; import eu.kennytv.maintenance.api.proxy.Server; @@ -25,22 +26,29 @@ import eu.kennytv.maintenance.core.proxy.command.MaintenanceProxyCommand; import eu.kennytv.maintenance.core.proxy.runnable.SingleMaintenanceRunnable; import eu.kennytv.maintenance.core.proxy.runnable.SingleMaintenanceScheduleRunnable; +import eu.kennytv.maintenance.core.proxy.util.ProfileLookup; import eu.kennytv.maintenance.core.runnable.MaintenanceRunnableBase; import eu.kennytv.maintenance.core.util.SenderInfo; import eu.kennytv.maintenance.core.util.ServerType; import eu.kennytv.maintenance.core.util.Task; import org.jetbrains.annotations.Nullable; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.UUID; import java.util.concurrent.TimeUnit; /** - * @author KennyTV + * @author kennytv * @since 3.0 */ public abstract class MaintenanceProxyPlugin extends MaintenancePlugin implements IMaintenanceProxy { @@ -167,6 +175,19 @@ protected void kickPlayers() { kickPlayersFromProxy(); } + protected ProfileLookup doUUIDLookup(final String name) throws IOException { + final URL url = new URL("https://api.ashcon.app/mojang/v2/user/" + name); + final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + try (final InputStream in = connection.getInputStream()) { + final String output = CharStreams.toString(new InputStreamReader(in)); + final JsonObject json = GSON.fromJson(output, JsonObject.class); + + final UUID uuid = UUID.fromString(json.getAsJsonPrimitive("uuid").getAsString()); + final String username = json.getAsJsonPrimitive("username").getAsString(); + return new ProfileLookup(uuid, username); + } + } + public SettingsProxy getSettingsProxy() { return settingsProxy; } diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/SettingsProxy.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/SettingsProxy.java index 18a62a93..8ab4f9cf 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/SettingsProxy.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/SettingsProxy.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/MaintenanceProxyCommand.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/MaintenanceProxyCommand.java index 378baa77..60184ebd 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/MaintenanceProxyCommand.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/MaintenanceProxyCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.command; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/ProxyCommandInfo.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/ProxyCommandInfo.java index 38148da1..af11841e 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/ProxyCommandInfo.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/ProxyCommandInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.command; import eu.kennytv.maintenance.core.command.CommandInfo; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/AbortSingleTimerCommand.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/AbortSingleTimerCommand.java index 5360a32a..5a14eef2 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/AbortSingleTimerCommand.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/AbortSingleTimerCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.command.subcommand; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleEndtimerCommand.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleEndtimerCommand.java index c2f44a15..393ddc40 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleEndtimerCommand.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleEndtimerCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.command.subcommand; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleScheduleTimerCommand.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleScheduleTimerCommand.java index c0500fd4..96f136e9 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleScheduleTimerCommand.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleScheduleTimerCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.command.subcommand; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleStarttimerCommand.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleStarttimerCommand.java index abc6fe9c..c064c2bf 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleStarttimerCommand.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleStarttimerCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.command.subcommand; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleToggleCommand.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleToggleCommand.java index 700a1cb3..7720385a 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleToggleCommand.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleToggleCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.command.subcommand; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/StatusCommand.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/StatusCommand.java index 5cef8cea..d8b7427b 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/StatusCommand.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/StatusCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.command.subcommand; import eu.kennytv.maintenance.core.proxy.MaintenanceProxyPlugin; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/listener/ProxyJoinListenerBase.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/listener/ProxyJoinListenerBase.java index 171dd933..e5fef7f9 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/listener/ProxyJoinListenerBase.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/listener/ProxyJoinListenerBase.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.listener; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/mysql/MySQL.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/mysql/MySQL.java index 9e51d2cb..af4daab1 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/mysql/MySQL.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/mysql/MySQL.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,11 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.mysql; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; +import org.jetbrains.annotations.Nullable; import java.sql.Connection; import java.sql.PreparedStatement; @@ -49,10 +49,22 @@ public MySQL(final Logger logger, final String hostname, final int port, final S hikariConfig.addDataSourceProperty("url", urlProperty); hikariConfig.setJdbcUrl(urlProperty); - hikariConfig.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource"); + hikariConfig.setDataSourceClassName(findDriver("com.mysql.jdbc.jdbc2.optional.MysqlDataSource", "com.mysql.cj.jdbc.MysqlDataSource", "org.mariadb.jdbc.MariaDbDataSource")); hikariDataSource = new HikariDataSource(hikariConfig); } + @Nullable + private String findDriver(final String... classNames) { + for (final String name : classNames) { + try { + Class.forName(name); + return name; + } catch (final ClassNotFoundException ignored) { + } + } + throw new IllegalArgumentException("No sql driver class found"); + } + public void executeUpdate(final String query, final Consumer callback, final Object... objects) { try (final Connection connection = hikariDataSource.getConnection()) { try (final PreparedStatement preparedStatement = connection.prepareStatement(query)) { @@ -79,9 +91,9 @@ public void executeQuery(final String query, final Consumer callback, current++; } - final ResultSet resultSet = preparedStatement.executeQuery(); - callback.accept(resultSet); - resultSet.close(); + try (final ResultSet resultSet = preparedStatement.executeQuery()) { + callback.accept(resultSet); + } } } catch (final SQLException e) { logger.log(Level.SEVERE, "Error while executing query method: " + query); diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceRunnable.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceRunnable.java index dff7e69c..266de5b8 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceRunnable.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceRunnable.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.runnable; import eu.kennytv.maintenance.api.proxy.IMaintenanceProxy; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceScheduleRunnable.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceScheduleRunnable.java index cb165f0f..30335730 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceScheduleRunnable.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceScheduleRunnable.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.runnable; import eu.kennytv.maintenance.api.proxy.Server; @@ -38,4 +37,10 @@ protected void finish() { super.finish(); ((MaintenanceProxyPlugin) plugin).startSingleMaintenanceRunnable(server, maintenanceDuration, TimeUnit.SECONDS, false); } + + @Override + protected String getStartMessage() { + return settings.getMessage("singleScheduletimerBroadcast").replace("%SERVER%", server.getName()) + .replace("%TIME%", getTime()).replace("%DURATION%", plugin.getFormattedTime(maintenanceDuration)); + } } diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/server/DummyServer.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/server/DummyServer.java index 99bcf82c..f964fe30 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/server/DummyServer.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/server/DummyServer.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.server; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProfileLookup.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProfileLookup.java new file mode 100644 index 00000000..fc099149 --- /dev/null +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProfileLookup.java @@ -0,0 +1,38 @@ +/* + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 . + */ +package eu.kennytv.maintenance.core.proxy.util; + +import java.util.UUID; + +public final class ProfileLookup { + private final UUID uuid; + private final String name; + + public ProfileLookup(final UUID uuid, final String name) { + this.uuid = uuid; + this.name = name; + } + + public UUID getUuid() { + return uuid; + } + + public String getName() { + return name; + } +} diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProxyOfflineSenderInfo.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProxyOfflineSenderInfo.java new file mode 100644 index 00000000..82b2ef90 --- /dev/null +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProxyOfflineSenderInfo.java @@ -0,0 +1,65 @@ +/* + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 . + */ +package eu.kennytv.maintenance.core.proxy.util; + +import eu.kennytv.maintenance.api.proxy.Server; + +import java.util.UUID; + +public final class ProxyOfflineSenderInfo implements ProxySenderInfo { + private final UUID uuid; + private final String name; + + public ProxyOfflineSenderInfo(final UUID uuid, final String name) { + this.uuid = uuid; + this.name = name; + } + + @Override + public boolean canAccess(final Server server) { + return false; + } + + @Override + public void disconnect(final String message) { + } + + @Override + public UUID getUuid() { + return uuid; + } + + @Override + public String getName() { + return name; + } + + @Override + public boolean hasPermission(final String permission) { + return false; + } + + @Override + public void sendMessage(final String message) { + } + + @Override + public boolean isPlayer() { + return true; + } +} diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProxySenderInfo.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProxySenderInfo.java index a9a04302..772cd5b2 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProxySenderInfo.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ProxySenderInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.util; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ServerConnectResult.java b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ServerConnectResult.java index bd3399da..918d5c22 100644 --- a/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ServerConnectResult.java +++ b/maintenance-core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/util/ServerConnectResult.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.proxy.util; import eu.kennytv.maintenance.api.proxy.Server; diff --git a/maintenance-core/pom.xml b/maintenance-core/pom.xml index 5b16b747..50c5369e 100644 --- a/maintenance-core/pom.xml +++ b/maintenance-core/pom.xml @@ -6,7 +6,7 @@ eu.kennytv.maintenance maintenance-parent - 3.0.6 + 3.0.7 maintenance-core diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/MaintenancePlugin.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/MaintenancePlugin.java index e577bbb4..07233a05 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/MaintenancePlugin.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/MaintenancePlugin.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.io.CharStreams; +import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import eu.kennytv.maintenance.api.IMaintenance; @@ -61,6 +61,7 @@ import java.util.logging.Logger; public abstract class MaintenancePlugin implements IMaintenance { + public static final Gson GSON = new GsonBuilder().create(); protected final EventManager eventManager; protected final Version version; protected Settings settings; @@ -88,13 +89,22 @@ public void setMaintenance(final boolean maintenance) { settings.getConfig().set("maintenance-enabled", maintenance); settings.saveConfig(); serverActions(maintenance); + + for (final String command : (maintenance ? settings.getCommandsOnMaintenanceEnable() : settings.getCommandsOnMaintenanceDisable())) { + try { + executeConsoleCommand(command); + } catch (final Exception e) { + getLogger().severe("Error while executing extra maintenance " + (maintenance ? "enable" : "disable") + " command: " + command); + e.printStackTrace(); + } + } } public void serverActions(final boolean maintenance) { if (isTaskRunning()) { cancelTask(); } - if (serverListPlusHook != null) { + if (serverListPlusHook != null && settings.isEnablePingMessages()) { serverListPlusHook.setEnabled(!maintenance); } @@ -134,6 +144,26 @@ public String getTimerMessage() { .replace("%SECONDS%", String.format("%02d", seconds)); } + public String getFormattedTime(final int timeSeconds) { + final int preHours = timeSeconds / 60; + final int minutes = preHours % 60; + final int seconds = timeSeconds % 60; + + final StringBuilder buider = new StringBuilder(); + append(buider, "hour", preHours / 60); + append(buider, "minute", minutes); + append(buider, "second", seconds); + return buider.toString(); + } + + private void append(final StringBuilder builder, final String timeUnit, final int time) { + if (time == 0) return; + if (builder.length() != 0) { + builder.append(' '); + } + builder.append(time).append(' ').append(settings.getMessage(time == 1 ? timeUnit : timeUnit + "s")); + } + public void startMaintenanceRunnable(final long duration, final TimeUnit unit, final boolean enable) { runnable = new MaintenanceRunnable(this, settings, (int) unit.toSeconds(duration), enable); // Save the endtimer to be able to continue it after a server stop @@ -189,7 +219,7 @@ protected void sendEnableMessage() { 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://discord.gg/vGCUzHq) or the GitHub issue tracker (https://github.com/KennyTV/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!"); } @@ -202,7 +232,7 @@ public boolean installUpdate() { Preconditions.checkArgument(serverType != ServerType.SPONGE); try { final String fileSuffix = serverType == ServerType.VELOCITY ? "Velocity" : ""; - final URLConnection conn = new URL("https://github.com/KennyTV/Maintenance/releases/download/" + newestVersion + "/Maintenance" + fileSuffix + ".jar").openConnection(); + 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(); @@ -250,27 +280,25 @@ public String pasteDump() { connection.setRequestProperty("User-Agent", "Maintenance/" + getVersion()); connection.setRequestProperty("Content-Type", "text/plain"); - final GsonBuilder gsonBuilder = new GsonBuilder(); - final OutputStream out = connection.getOutputStream(); - out.write(gsonBuilder.disableHtmlEscaping().setPrettyPrinting().create().toJson(dump).getBytes(StandardCharsets.UTF_8)); - out.close(); + try (final OutputStream out = connection.getOutputStream()) { + out.write(new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create().toJson(dump).getBytes(StandardCharsets.UTF_8)); + } if (connection.getResponseCode() == 503) { getLogger().warning("Could not paste dump, hastebin.com down?"); return null; } - final InputStream in = connection.getInputStream(); - final String output = CharStreams.toString(new InputStreamReader(in)); - in.close(); + try (final InputStream in = connection.getInputStream()) { + final String output = CharStreams.toString(new InputStreamReader(in)); + final JsonObject jsonOutput = GSON.fromJson(output, JsonObject.class); + if (!jsonOutput.has("key")) { + getLogger().log(Level.WARNING, "Could not paste dump, there was no key returned :("); + return null; + } - final JsonObject jsonOutput = gsonBuilder.create().fromJson(output, JsonObject.class); - if (!jsonOutput.has("key")) { - getLogger().log(Level.WARNING, "Could not paste dump, there was no key returned :("); - return null; + return jsonOutput.get("key").getAsString(); } - - return jsonOutput.get("key").getAsString(); } catch (final IOException e) { getLogger().log(Level.WARNING, "Could not paste dump :("); e.printStackTrace(); @@ -398,12 +426,21 @@ protected String getPluginFolder() { public abstract void async(Runnable runnable); + protected abstract void executeConsoleCommand(String command); + public abstract void broadcast(String message); public abstract void sendUpdateNotification(SenderInfo sender); public abstract Task startMaintenanceRunnable(Runnable runnable); + /** + * Returns offline sender info of a player. + * This method may do a web lookup. + * + * @param name name of the player + * @return sender info if found, else null + */ @Nullable public abstract SenderInfo getOfflinePlayer(String name); diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/Settings.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/Settings.java index 9eb68b3a..9728d346 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/Settings.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/Settings.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core; import eu.kennytv.maintenance.api.ISettings; @@ -38,7 +37,7 @@ import java.util.UUID; public class Settings implements ISettings { - private static final int CURRENT_CONFIG_VERSION = 4; + private static final int CURRENT_CONFIG_VERSION = 5; private static final Random RANDOM = new Random(); protected final MaintenancePlugin plugin; private final Map whitelistedPlayers = new HashMap<>(); @@ -47,9 +46,12 @@ public class Settings implements ISettings { private Set broadcastIntervals; private List pingMessages; private List timerSpecificPingMessages; + private List commandsOnMaintenanceEnable; + private List commandsOnMaintenanceDisable; private String playerCountMessage; private String playerCountHoverMessage; private String languageName; + private boolean enablePingMessages; private boolean customPlayerCountMessage; private boolean customMaintenanceIcon; private boolean joinNotifications; @@ -170,11 +172,14 @@ private void createLanguageFile() { private void loadSettings() { updateConfig(); + enablePingMessages = config.getBoolean("enable-pingmessages", true); pingMessages = config.getStringList("pingmessages"); if (config.getBoolean("enable-timerspecific-messages")) { timerSpecificPingMessages = config.getStringList("timerspecific-pingmessages"); } maintenance = config.getBoolean("maintenance-enabled"); + commandsOnMaintenanceEnable = config.getStringList("commands-on-maintenance-enable"); + commandsOnMaintenanceDisable = config.getStringList("commands-on-maintenance-disable"); customPlayerCountMessage = config.getBoolean("enable-playercountmessage"); customMaintenanceIcon = config.getBoolean("custom-maintenance-icon"); joinNotifications = config.getBoolean("send-join-notification"); @@ -398,6 +403,11 @@ public void setMaintenance(final boolean maintenance) { this.maintenance = maintenance; } + @Override + public boolean isEnablePingMessages() { + return enablePingMessages; + } + @Override public boolean isJoinNotifications() { return joinNotifications; @@ -449,6 +459,14 @@ public List getPingMessages() { return pingMessages; } + public List getCommandsOnMaintenanceEnable() { + return commandsOnMaintenanceEnable; + } + + public List getCommandsOnMaintenanceDisable() { + return commandsOnMaintenanceDisable; + } + @Nullable public List getTimerSpecificPingMessages() { return timerSpecificPingMessages; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/CommandInfo.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/CommandInfo.java index 6b5e8d3d..13efb9ee 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/CommandInfo.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/CommandInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command; import eu.kennytv.maintenance.core.MaintenancePlugin; @@ -30,18 +29,28 @@ public abstract class CommandInfo { protected final MaintenancePlugin plugin; private final String helpMessageKey; private final String permission; + private final boolean visible; protected CommandInfo(final MaintenancePlugin plugin, @Nullable final String permission) { + this(plugin, permission, true); + } + + protected CommandInfo(final MaintenancePlugin plugin, @Nullable final String permission, final boolean visible) { this.plugin = plugin; this.permission = permission; // Just take the class name as the language key this.helpMessageKey = "help" + getClass().getSimpleName().replace("Command", ""); + this.visible = visible; } public boolean hasPermission(final SenderInfo sender) { return sender.hasMaintenancePermission(permission); } + public boolean isVisible() { + return visible; + } + public String getHelpMessage() { return getMessage(helpMessageKey); } diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/MaintenanceCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/MaintenanceCommand.java index bd68d8c9..c74832c5 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/MaintenanceCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/MaintenanceCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command; import eu.kennytv.maintenance.core.MaintenancePlugin; @@ -114,7 +113,8 @@ public List getSuggestions(final SenderInfo sender, final String[] args) final List list = new ArrayList<>(); for (final Map.Entry entry : commandExecutors.entrySet()) { final String command = entry.getKey(); - if (command.startsWith(s) && entry.getValue().hasPermission(sender)) { + final CommandInfo info = entry.getValue(); + if (info.isVisible() && command.startsWith(s) && info.hasPermission(sender)) { list.add(command); } } @@ -140,7 +140,7 @@ public boolean checkTimerArgs(final SenderInfo sender, final String time, final return true; } if (minutes < 1) { - sender.sendMessage("§8§o[KennyTV whispers to you] §7§oThink about running a timer for a negative amount of minutes. Doesn't work §lthat §7§owell."); + sender.sendMessage("§8§o[kennytv whispers to you] §7§oThink about running a timer for a negative amount of minutes. Doesn't work §lthat §7§owell."); return true; } return false; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/AbortTimerCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/AbortTimerCommand.java index 0dbb47ba..7074feba 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/AbortTimerCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/AbortTimerCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/DebugCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/DebugCommand.java index 61eb0578..669dbb27 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/DebugCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/DebugCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; @@ -25,14 +24,13 @@ public final class DebugCommand extends CommandInfo { public DebugCommand(final MaintenancePlugin plugin) { - super(plugin, "debug"); + super(plugin, "debug", false); } @Override public void execute(final SenderInfo sender, final String[] args) { if (checkArgs(sender, args, 1)) return; - //TODO put this and the help message into language files plugin.setDebug(!plugin.isDebug()); sender.sendMessage("Debug mode is now " + (plugin.isDebug() ? "enabled" : "disabled")); } diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/DumpCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/DumpCommand.java index 81e46ba0..22c4bff9 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/DumpCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/DumpCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/EndtimerCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/EndtimerCommand.java index 99d7d188..50a65166 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/EndtimerCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/EndtimerCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/HelpCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/HelpCommand.java index 97d5b0d2..87c79099 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/HelpCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/HelpCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import com.google.common.base.Preconditions; @@ -62,7 +61,7 @@ public void sendUsage(final SenderInfo sender, final int page) { Preconditions.checkArgument(page > 0); final List commands = new ArrayList<>(); for (final CommandInfo cmd : plugin.getCommandManager().getCommands()) { - if (cmd.hasPermission(sender)) { + if (cmd.isVisible() && cmd.hasPermission(sender)) { commands.add(cmd.getHelpMessage()); } } @@ -84,7 +83,7 @@ public void sendUsage(final SenderInfo sender, final int page) { if (page * COMMANDS_PER_PAGE < commands.size()) { sender.sendMessage(getMessage("helpNextPage").replace("%PAGE%", Integer.toString(page + 1))); } else { - sender.sendMessage("§8× §eVersion " + plugin.getVersion() + " §7by §bKennyTV"); + sender.sendMessage("§8× §eVersion " + plugin.getVersion() + " §7by §bkennytv"); } sender.sendMessage(header); diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/MotdCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/MotdCommand.java index ae576191..1b0d7d4a 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/MotdCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/MotdCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ReloadCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ReloadCommand.java index 0613c0f0..8a4d733c 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ReloadCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ReloadCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/RemoveMotdCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/RemoveMotdCommand.java index 4ca4a2de..f7448cf9 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/RemoveMotdCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/RemoveMotdCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ScheduleTimerCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ScheduleTimerCommand.java index 3f33a7bb..4a5212e6 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ScheduleTimerCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ScheduleTimerCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/SetMotdCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/SetMotdCommand.java index 6a1ec44c..bd2fad94 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/SetMotdCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/SetMotdCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/StarttimerCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/StarttimerCommand.java index 583522ab..5f6256ec 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/StarttimerCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/StarttimerCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ToggleCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ToggleCommand.java index 5ecfbb6b..552b16e1 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ToggleCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ToggleCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/UpdateCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/UpdateCommand.java index 5919d3ad..79e26b15 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/UpdateCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/UpdateCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistAddCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistAddCommand.java index 134b99d0..35eace64 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistAddCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistAddCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistCommand.java index 4fa8e97f..e2aa6a7b 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistRemoveCommand.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistRemoveCommand.java index 6bed948b..e2c6a750 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistRemoveCommand.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/WhitelistRemoveCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.command.subcommand; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/Config.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/Config.java index 0e6e6516..c838c44d 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/Config.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/Config.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.config; import com.google.common.collect.Sets; @@ -37,7 +36,7 @@ * Further modified version of the SimpleConfig project of PSandro (https://github.com/PSandro/SimpleConfig). * * @author PSandro on 26.01.19 - * @author KennyTV + * @author kennytv */ public final class Config extends ConfigSection { @@ -50,7 +49,7 @@ public final class Config extends ConfigSection { "# |_| |_|\\__,_|_|_| |_|\\__\\___|_| |_|\\__,_|_| |_|\\___\\___| |_.__/ \\__, | |_|\\_\\___|_| |_|_| |_|\\__, ||_| \\_/ #\n" + "# |___/ |___/ #\n" + "#######################################################################################################################\n" + - "# You can report bugs here: https://github.com/KennyTV/Maintenance/issues\n" + + "# You can report bugs here: https://github.com/kennytv/Maintenance/issues\n" + "# If you need any other help/support, you can also join my Discord server: https://discord.gg/vGCUzHq\n"; private final Yaml yaml = createYaml(); private final File file; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/ConfigSection.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/ConfigSection.java index e2f40d07..bad1dfb2 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/ConfigSection.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/ConfigSection.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.config; import org.jetbrains.annotations.Nullable; @@ -28,7 +27,7 @@ /** * Further modified version of the SimpleConfig project of PSandro (https://github.com/PSandro/SimpleConfig). * - * @author KennyTV + * @author kennytv */ public class ConfigSection { diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/ConfigSerializer.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/ConfigSerializer.java index 2dfc1918..e2bb45e9 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/ConfigSerializer.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/config/ConfigSerializer.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.config; import org.yaml.snakeyaml.Yaml; @@ -30,7 +29,7 @@ * Further modified version of the SimpleConfig project of PSandro (https://github.com/PSandro/SimpleConfig). * * @author PSandro on 26.01.19 - * @author KennyTV + * @author kennytv */ public final class ConfigSerializer { diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/MaintenanceDump.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/MaintenanceDump.java index 36bce75b..b08dc9f3 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/MaintenanceDump.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/MaintenanceDump.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,10 +15,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.dump; -import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import eu.kennytv.maintenance.core.MaintenancePlugin; import eu.kennytv.maintenance.core.Settings; @@ -46,7 +44,7 @@ public MaintenanceDump(final MaintenancePlugin plugin, final Settings settings) configuration.put("icon-exists", new File(plugin.getDataFolder(), "maintenance-icon.png").exists()); final JsonObject jsonObject = new JsonObject(); - jsonObject.add("plugins", new GsonBuilder().create().toJsonTree(plugin.getPlugins())); + jsonObject.add("plugins", MaintenancePlugin.GSON.toJsonTree(plugin.getPlugins())); plugins = jsonObject; } } diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/PluginDump.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/PluginDump.java index d158990f..d4361ede 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/PluginDump.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/PluginDump.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.dump; import java.util.List; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/ServerDump.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/ServerDump.java index ee021a7a..f8321759 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/ServerDump.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/dump/ServerDump.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.dump; import java.util.List; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/event/EventManager.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/event/EventManager.java index 3c6b6049..9e67b2fa 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/event/EventManager.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/event/EventManager.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.event; import eu.kennytv.maintenance.api.event.manager.EventListener; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/hook/ServerListPlusHook.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/hook/ServerListPlusHook.java index 7b916d96..df4ac5bc 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/hook/ServerListPlusHook.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/hook/ServerListPlusHook.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.hook; import net.minecrell.serverlistplus.core.ServerListPlusCore; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/listener/JoinListenerBase.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/listener/JoinListenerBase.java index 1c29e53b..e4d3dae6 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/listener/JoinListenerBase.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/listener/JoinListenerBase.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.listener; import eu.kennytv.maintenance.core.MaintenancePlugin; @@ -29,7 +28,6 @@ public abstract class JoinListenerBase { protected final MaintenancePlugin plugin; protected final Settings settings; - protected final UUID notifyUuid = new UUID(-6334418481592579467L, -4779835342378829761L); private final Set notifiedPlayers = new HashSet<>(); protected JoinListenerBase(final MaintenancePlugin plugin, final Settings settings) { @@ -59,10 +57,6 @@ protected boolean shouldKick(final SenderInfo sender) { } protected void updateCheck(final SenderInfo sender) { - if (sender.getUuid().equals(notifyUuid)) { - sender.sendMessage("§6Maintenance §aVersion " + plugin.getVersion()); - return; - } if (!settings.hasUpdateChecks()) return; if (!sender.hasPermission("maintenance.admin") || notifiedPlayers.contains(sender.getUuid())) return; plugin.async(() -> { diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceRunnable.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceRunnable.java index d778b5e2..70b5aa8e 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceRunnable.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceRunnable.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.runnable; import eu.kennytv.maintenance.core.MaintenancePlugin; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceRunnableBase.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceRunnableBase.java index f6b4c391..8963cbf4 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceRunnableBase.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceRunnableBase.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.runnable; import eu.kennytv.maintenance.core.MaintenancePlugin; @@ -49,23 +48,7 @@ public void run() { } public String getTime() { - final int preHours = this.seconds / 60; - final int minutes = preHours % 60; - final int seconds = this.seconds % 60; - - final StringBuilder buider = new StringBuilder(); - append(buider, "hour", preHours / 60); - append(buider, "minute", minutes); - append(buider, "second", seconds); - return buider.toString(); - } - - private void append(final StringBuilder builder, final String timeUnit, final int time) { - if (time == 0) return; - if (builder.length() != 0) { - builder.append(' '); - } - builder.append(time).append(' ').append(settings.getMessage(time == 1 ? timeUnit : timeUnit + "s")); + return plugin.getFormattedTime(seconds); } public boolean shouldEnable() { diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceScheduleRunnable.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceScheduleRunnable.java index f77b65e1..2441d45d 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceScheduleRunnable.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceScheduleRunnable.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.runnable; import eu.kennytv.maintenance.core.MaintenancePlugin; @@ -38,4 +37,10 @@ protected void finish() { // Start the timer to disable maintenance again plugin.startMaintenanceRunnable(maintenanceDuration, TimeUnit.SECONDS, false); } + + @Override + protected String getStartMessage() { + return settings.getMessage("scheduletimerBroadcast") + .replace("%TIME%", getTime()).replace("%DURATION%", plugin.getFormattedTime(maintenanceDuration)); + } } diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/DummySenderInfo.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/DummySenderInfo.java index f151127c..2f2f4cd0 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/DummySenderInfo.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/DummySenderInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.util; import java.util.UUID; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/SenderInfo.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/SenderInfo.java index 992dab4a..d2e90adc 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/SenderInfo.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/SenderInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.util; import java.util.UUID; diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/ServerType.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/ServerType.java index c2f8e716..64edff1d 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/ServerType.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/ServerType.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.util; public enum ServerType { diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/Task.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/Task.java index 81a2134b..b849362f 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/Task.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/Task.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.util; public interface Task { diff --git a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/Version.java b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/Version.java index 71ae82ee..d70fbf79 100644 --- a/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/Version.java +++ b/maintenance-core/src/main/java/eu/kennytv/maintenance/core/util/Version.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.core.util; import com.google.common.base.Preconditions; diff --git a/maintenance-core/src/main/resources/WhitelistedPlayers.yml b/maintenance-core/src/main/resources/WhitelistedPlayers.yml index 496f3074..3c4cfac1 100644 --- a/maintenance-core/src/main/resources/WhitelistedPlayers.yml +++ b/maintenance-core/src/main/resources/WhitelistedPlayers.yml @@ -1,3 +1,3 @@ # You can add and remove players with the '/maintenance ' command. # Alternatively, you can just add their uuid and name here by hand in the following format: -# a8179ff3-c201-4a75-bdaa-9d14aca6f83f: KennyTV \ No newline at end of file +# a8179ff3-c201-4a75-bdaa-9d14aca6f83f: kennytv \ No newline at end of file diff --git a/maintenance-core/src/main/resources/config.yml b/maintenance-core/src/main/resources/config.yml index 090652ea..992fb4de 100644 --- a/maintenance-core/src/main/resources/config.yml +++ b/maintenance-core/src/main/resources/config.yml @@ -6,7 +6,7 @@ # |_| |_|\__,_|_|_| |_|\__\___|_| |_|\__,_|_| |_|\___\___| |_.__/ \__, | |_|\_\___|_| |_|_| |_|\__, ||_| \_/ # # |___/ |___/ # ####################################################################################################################### -# You can report bugs here: https://github.com/KennyTV/Maintenance/issues +# 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 # Enables maintenance mode. @@ -32,6 +32,12 @@ waiting-server: "" pingmessages: - "&cMaintenance mode!%NEWLINE%&6We will be back soon!" # - "Other entry" +enable-pingmessages: true + +# Any extra commands inside of the arrays will be executed when maintenance is enabled/disabled. +# Example: commands-on-maintenance-enable: ["say hello!", "stop"] +commands-on-maintenance-enable: [] +commands-on-maintenance-disable: [] # 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. @@ -102,4 +108,4 @@ timer-broadcast-for-seconds: [1200, 900, 600, 300, 120, 60, 30, 20, 10, 5, 4, 3, update-checks: true # Used for autoupdating the config, do not change this value. -config-version: 4 \ No newline at end of file +config-version: 5 \ No newline at end of file diff --git a/maintenance-core/src/main/resources/language-de.yml b/maintenance-core/src/main/resources/language-de.yml index f8fdcdf0..9896ee10 100644 --- a/maintenance-core/src/main/resources/language-de.yml +++ b/maintenance-core/src/main/resources/language-de.yml @@ -1,4 +1,4 @@ -# Maintenance Plugin by KennyTV +# Maintenance Plugin by kennytv # Wörter zwischen dem '%'-Zeichen nur entfernen, wenn Du wirklich weißt, warum Du sie entfernen willst noPermission: "&cDu hast nicht die erforderliche Berechtigung für diesen Befehl." @@ -11,6 +11,7 @@ endtimerBroadcast: "&8[&eMaintenance&8] &7Der Wartungsmodus wird deaktiviert in: 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." starttimerStarted: "&8[&eMaintenance&8] &aGestarteter Timer: &7Der Wartungsmodus wird aktiviert in: &6%TIME%&7" +scheduletimerBroadcast: "&8[&eMaintenance&8] &7Der Wartungsmodus wird in &6%TIME% &7aktiviert und &6%DURATION% &7dauern." 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." @@ -52,6 +53,7 @@ singleTimerNotRunning: "&8[&eMaintenance&8] &cMomentan läuft kein Timer auf die singleTimerCancelled: "&8[&eMaintenance&8] &cDer laufende Timer dieses Servers wurde beendet." singleEndtimerBroadcast: "&8[&eMaintenance&8] &7Der Wartungsmodus auf Server %SERVER% wird deaktiviert in: &6%TIME%&7." singleStarttimerBroadcast: "&8[&eMaintenance&8] &7Der Wartungsmodus auf Server %SERVER% wird aktiviert in: &6%TIME%&7." +singleScheduletimerBroadcast: "&8[&eMaintenance&8] &7Der Wartungsmodus auf Server %SERVER% wird aktiviert in &6%TIME% &7und wird &6%DURATION% &7dauern." singleMaintenanceKick: "&8[&eMaintenance&8] &cDer Server %SERVER% befindet sich momentan im Wartungsmodus! Probier es später nochmal!" singleMaintenanceKickComplete: "&cDer Server %SERVER% befindet sich in Wartung!%NEWLINE%&cDu kannst versuchen zu rejoinen, um andere Server zu betreten!" singleMaintenanceActivated: "&8[&eMaintenance&8] &6Der Wartungsmodus wurde auf &e%SERVER% &6aktiviert." @@ -74,6 +76,7 @@ helpNextPage: "&7Nutze &b/maintenance help %SEITE%&7, um zur nächsten Hilfeseit helpAbortTimer: "&6/maintenance aborttimer &7(Falls momentan ein Timer läuft, wird dieser abgebrochen)" helpEndtimer: "&6/maintenance endtimer &7(Sobald der Timer abläuft wird der Wartungsmodus deaktiviert)" helpStarttimer: "&6/maintenance starttimer &7(Sobald der Timer abläuft wird der Wartungsmodus aktiviert)" +helpDebug: "&6/maintenance debug &7(Aktiviert Debug Nachrichten in der Konsole)" 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)" diff --git a/maintenance-core/src/main/resources/language-en.yml b/maintenance-core/src/main/resources/language-en.yml index 6e75be88..242347ed 100644 --- a/maintenance-core/src/main/resources/language-en.yml +++ b/maintenance-core/src/main/resources/language-en.yml @@ -1,4 +1,4 @@ -# Maintenance Plugin by KennyTV +# Maintenance Plugin by kennytv # Don't remove words inbetween the '%' if you don't exactly know why you're doing it noPermission: "&cYou do not have the permission to execute that command." @@ -11,6 +11,7 @@ endtimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be disabled in & 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." starttimerStarted: "&8[&eMaintenance&8] &aStarted timer: &7Maintenance mode will be activated in &6%TIME%&7." +scheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." 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." @@ -52,6 +53,7 @@ singleTimerCancelled: "&8[&eMaintenance&8] &cThe current timer for server &e%SER singleTimerNotRunning: "&8[&eMaintenance&8] &cThere is currently no running timer for that server." singleEndtimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode on server %SERVER% will be disabled in &6%TIME%&7." singleStarttimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode on server %SERVER% will be enabled in &6%TIME%&7." +singleScheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode on server %SERVER% will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." singleMaintenanceKick: "&8[&eMaintenance&8] &cThe server %SERVER% is currently under maintenance! Try again later!" singleMaintenanceKickComplete: "&cThe server %SERVER% is under maintenance!%NEWLINE%&cYou may try to rejoin to go onto another server!" singleMaintenanceActivated: "&8[&eMaintenance&8] &6Maintenance mode is now activated on server &e%SERVER%&6." @@ -75,6 +77,7 @@ helpAbortTimer: "&6/maintenance aborttimer &7(If running, the current timer will helpEndtimer: "&6/maintenance endtimer &7(After the given time in minutes, maintenance mode will be disabled)" helpStarttimer: "&6/maintenance starttimer &7(After the given time in minutes, maintenance mode will be enabled)" helpScheduleTimer: "&6/maintenance scheduletimer &7(After the given time in minutes, maintenance mode will be enabled for the given duration in minutes)" +helpDebug: "&6/maintenance debug &7(Enables some debug logging)" 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)" diff --git a/maintenance-core/src/main/resources/language-es.yml b/maintenance-core/src/main/resources/language-es.yml index b56cf7e0..30437dc3 100644 --- a/maintenance-core/src/main/resources/language-es.yml +++ b/maintenance-core/src/main/resources/language-es.yml @@ -1,4 +1,4 @@ -# Maintenance Plugin by KennyTV +# Maintenance Plugin by kennytv # Translators: Vixo_Ulises # Don't remove words inbetween the '%' if you don't exactly know why you're doing it @@ -12,6 +12,7 @@ endtimerBroadcast: "&8[&eMaintenance&8] &7El modo mantenimiento se desactivara e endtimerStarted: "&8[&eMaintenance&8] &7Temporizador iniciado: El modo mantenimiento se desactivará en &6%TIME%&7." starttimerBroadcast: "&8[&eMaintenance&8] &7El modo mantenimiento se habilitara en &6%TIME%&7." starttimerStarted: "&8[&eMaintenance&8] &7Temporizador iniciado: El modo mantenimiento se activará en &6%TIME%&7." +scheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." timerAlreadyRunning: "&8[&eMaintenance&8] &cYa hay un temporizador programado!" timerNotRunning: "&8[&eMaintenance&8] &7Actualmente no hay temporizador." timerCancelled: "&8[&eMaintenance&8] &cEl Temporizador actual ha sido deshabilitado." @@ -53,6 +54,7 @@ singleTimerNotRunning: "&8[&eMaintenance&8] &cActualmente no hay ningún tempori singleTimerCancelled: "&8[&eMaintenance&8] &cEl temporizador actual para el servidor &6%SERVER% &cha sido desactivado." singleEndtimerBroadcast: "&8[&eMaintenance&8] &7El modo mantenimiento en el Servidor &6%SERVER% &7se desactivará en &a%TIME%&7." singleStarttimerBroadcast: "&8[&eMaintenance&8] &7El modo mantenimiento en el servidor &6%SERVER%&7 se activará en &a%TIME%&7" +singleScheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode on server %SERVER% will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." singleMaintenanceKick: "&8[&eMaintenance&8] &7El servidor &6%SERVER% &7se encuentra en mantenimiento&7! Intentalo mas tarde!" singleMaintenanceKickComplete: "&7El Servidor &6%SERVER% &7esta en mantenimiento&7!%NEWLINE%&cVuelve Mas Tarde!" singleMaintenanceActivated: "&8[&eMaintenance&8] &7El modo mantenimiento esta activado en el servidor &6%SERVER%&7." @@ -75,6 +77,7 @@ helpNextPage: "&7Utilice &b/maintenance help %PAGE% &7Para pasar a la siguiente helpAbortTimer: "&6/maintenance aborttimer &8(&7Si se ejecuta, se abortará el temporizador actual&8)" helpEndtimer: "&6/maintenance endtimer &8(&7Después del tiempo en minutos, se desactivará el modo de mantenimiento&8)" helpStarttimer: "&6/maintenance starttimer &8(&7Después del tiempo en minutos, se habilitará el modo de mantenimiento&8)" +helpDebug: "&6/maintenance debug &7(Enables some debug logging)" helpDump: "&6/maintenance dump &8(&7Descarga información del servidor, usada para informes de errores&8)" helpHelp: "&6/maintenance help [page] &8(&7Muestra la pagina de ayuda&8)" helpMotd: "&6/maintenance motd [timer] &8(&7Enumera los motivos de mantenimiento establecidos actualmente. Si se especifica el 'temporizador', se muestran los motivos del temporizador&8)" diff --git a/maintenance-core/src/main/resources/language-fr.yml b/maintenance-core/src/main/resources/language-fr.yml index 22d9fa49..9add2c26 100644 --- a/maintenance-core/src/main/resources/language-fr.yml +++ b/maintenance-core/src/main/resources/language-fr.yml @@ -1,4 +1,4 @@ -# Plugin Maintenance par KennyTV, traduit en Français par Zendrique & Aurelien30000. +# Plugin Maintenance par kennytv, traduit en Français par Zendrique & Aurelien30000. # Ne supprimez pas de mots entre les '%' si vous ne savez pas exactement pourquoi, ils correspondent à des référencements de valeurs changeantes. noPermission: "&cVous n'avez pas la permission d'exécuter cette commande." @@ -11,6 +11,7 @@ endtimerBroadcast: "&8[&eMaintenance&8] &7Le mode maintenance sera désactivé d endtimerStarted: "&8[&eMaintenance&8] &aMinuterie : &7Le mode maintenance sera désactivé dans &6%TIME%&7." starttimerBroadcast: "&8[&eMaintenance&8] &7Le mode de maintenance sera activé dans &6%TIME%&7." starttimerStarted: "&8[&eMaintenance&8] &aMinuterie : &7Le mode maintenance sera activé dans &6%TIME%&7." +scheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." 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." @@ -52,6 +53,7 @@ singleTimerNotRunning: "&8[&eMaintenance&8] &cIl n'y a actuellement aucune maint singleTimerCancelled: "&8[&eMaintenance&8] &cLa minuterie actuelle a été désactivée sur ce serveur." singleEndtimerBroadcast: "&8[&eMaintenance&8] &7La maintenance sur le serveur %SERVER% sera désactivée dans &6%TIME%&7." singleStarttimerBroadcast: "&8[&eMaintenance&8] &7La maintenance sur le serveur %SERVER% sera activée dans &6%TIME%&7." +singleScheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode on server %SERVER% will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." singleMaintenanceKick: "&8[&eMaintenance&8] &cLe serveur %SERVER% est actuellement en maintenance ! Réessayez plus tard !" singleMaintenanceKickComplete: "&cLe serveur %SERVER% est en maintenance !%NEWLINE%&cVous pouvez essayer un autre serveur !" singleMaintenanceActivated: "&8[&eMaintenance&8] &6La maintenance est maintenant activée sur le serveur &e%SERVER%&6." @@ -74,6 +76,7 @@ helpNextPage: "&7Utilisez &b/maintenance help %PAGE% &7pour accéder à la fenê helpAbortTimer: "&6/maintenance aborttimer &7(Si en cours d'exécution, le minuteur actuel sera abandonné)" helpEndtimer: "&6/maintenance endtimer &7(Après le temps imparti en minutes, le mode maintenance sera désactivé)" helpStarttimer: "&6/maintenance starttimer &7(Après le temps imparti en minutes, le mode maintenance sera activé)" +helpDebug: "&6/maintenance debug &7(Enables some debug logging)" helpDump: "&6/maintenance dump &7(Enregistre 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 seront affichés)" @@ -90,6 +93,6 @@ helpWhitelistRemove: "&6/maintenance remove &7(Supprime un joueur de helpAbortSingleTimer: "&6/maintenance aborttimer [server] &7(Si en cours d'exécution, le minuteur actuel sera abandonné)" helpSingleEndtimer: "&6/maintenance endtimer [server] &7(Après le temps imparti en minutes, le mode maintenance sera désactivé)" helpSingleStarttimer: "&6/maintenance starttimer [server] &7(Après le temps imparti en minutes, le mode maintenance sera activé)" -helpSingleScheduleTimer: "&6/maintenance scheduletimer [server] &7(After the given time in minutes, maintenance mode will be enabled for the given duration in minutes)" +helpSingleScheduleTimer: "&6/maintenance scheduletimer [server] &7(Après le temps imparti en minutes, le mode maintenance sera activé pour la durée spécifiée en minutes)" helpSingleToggle: "&6/maintenance [server] &7(Active/désactive le mode maintenance)" helpStatus: "&6/maintenance status &7(Répertorie tous les serveurs mandatés actuellement en maintenance)" diff --git a/maintenance-core/src/main/resources/language-it.yml b/maintenance-core/src/main/resources/language-it.yml index 28123456..c5e8626b 100644 --- a/maintenance-core/src/main/resources/language-it.yml +++ b/maintenance-core/src/main/resources/language-it.yml @@ -1,4 +1,4 @@ -# Maintenance Plugin by KennyTV +# Maintenance Plugin by kennytv # Translators: TheViperShow # Don't remove words inbetween the '%' if you don't exactly know why you're doing it @@ -12,6 +12,7 @@ endtimerBroadcast: "&8[&eMaintenance&8] &7La modalità manutenzione verrà disat endtimerStarted: "&8[&eMaintenance&8] &aTimer avviato: &7La modalità manutenzione verrà disattivata tra &6%TIME%&7." starttimerBroadcast: "&8[&eMaintenance&8] &7La modalità manutenzione verrà attivata tra &6%TIME%&7." starttimerStarted: "&8[&eMaintenance&8] &aTimer avviato: &7La modalità manutenzione verrà attivata tra &6%TIME%&7." +scheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." timerAlreadyRunning: "&8[&eMaintenance&8] &cC'è già un timer programmato!" timerNotRunning: "&8[&eMaintenance&8] &cNon c'è nessun timer attivo al momento." timerCancelled: "&8[&eMaintenance&8] &cIl timer attuale è stato disattivato." @@ -53,6 +54,7 @@ singleTimerCancelled: "&8[&eMaintenance&8] &cIl timer attuale per il server &e%S singleTimerNotRunning: "&8[&eMaintenance&8] &cNon c'è nessun timer correntemente attivo per quel server." singleEndtimerBroadcast: "&8[&eMaintenance&8] &7La modalità manutenzione per il server %SERVER% verrà disabilitata tra &6%TIME%&7." singleStarttimerBroadcast: "&8[&eMaintenance&8] &7La modalità manutenzione per il server %SERVER% verrà disabilitata tra &6%TIME%&7." +singleScheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode on server %SERVER% will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." singleMaintenanceKick: "&8[&eMaintenance&8] &cIl server %SERVER% è in manutenzione al momento! Ritenta più tardi!" singleMaintenanceKickComplete: "&cIl server %SERVER% è in manutenzione!%NEWLINE%&cProva a rientrare per accedere ad un'altro server!" singleMaintenanceActivated: "&8[&eMaintenance&8] &6La modalità manutenzione è ora attiva sul server &e%SERVER%&6." @@ -75,6 +77,7 @@ helpNextPage: "&7Usa &b/maintenance help %PAGE% &7per andare alla prossima pagin helpAbortTimer: "&6/maintenance aborttimer &7(Se attivo, l'attuale timer verrà fermato)" helpEndtimer: "&6/maintenance endtimer &7(Dopo il tempo fornito in minuti, la modalità manutenzione sarà rimossa)" helpStarttimer: "&6/maintenance starttimer &7(Dopo il tempo fornito in minuti, la modalità manutenzione sarà attivata)" +helpDebug: "&6/maintenance debug &7(Enables some debug logging)" helpDump: "&6/maintenance dump &7(Copia alcune informazioni dal server, usato per segnalare problemi)" helpHelp: "&6/maintenance help [page] &7(Mostra questa fantastica pagina d'aiuto)" helpMotd: "&6/maintenance motd [timer] &7(Elenca le attuali motds di manutenzione impostate. Se specifichi 'timer', verranno mostrati i motds dei timer)" diff --git a/maintenance-core/src/main/resources/language-pt.yml b/maintenance-core/src/main/resources/language-pt.yml index 7751648f..deb5dd23 100644 --- a/maintenance-core/src/main/resources/language-pt.yml +++ b/maintenance-core/src/main/resources/language-pt.yml @@ -1,4 +1,4 @@ -# Maintenance Plugin by KennyTV +# Maintenance Plugin by kennytv # Translators: JoaoPinto # Nao removas o '%' se nao souberes exatamente o que estas a fazer @@ -12,6 +12,7 @@ endtimerBroadcast: "&8[&cManutencao&8] &7Manutencao vai ser desativada em &6%TIM 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" starttimerStarted: "&8[&cManutencao&8] &7Manutencao vai ser ativada em &6%TIME%&7" +scheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." 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!" @@ -53,6 +54,7 @@ singleTimerNotRunning: "&8[&cManutencao&8] &cO Timer nao esta a decorrer!" singleTimerCancelled: "&8[&cManutencao&8] &cO Timer foi cancelado no!" singleEndtimerBroadcast: "&8[&cManutencao&8] &7Manutencao no %SERVER% vai ser desativada em &6%TIME%&7." singleStarttimerBroadcast: "&8[&cManutencao&8] &7Manutencao no %SERVER% vai ser ativada em &6%TIME%&7." +singleScheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode on server %SERVER% will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." singleMaintenanceKick: "&8[&cManutencao&8] &cO %SERVER% esta em manutencao! Tente mais tarde!" singleMaintenanceKickComplete: "&cO %SERVER% esta em manutencao!%NEWLINE%&cTente mais tarde!" singleMaintenanceActivated: "&8[&cManutencao&8] &6Manutencao esta agora ativada no &e%SERVER%&6." @@ -75,6 +77,7 @@ helpNextPage: "&7Use &b/maintenance help %PAGE% &7para ir para a próxima págin helpAbortTimer: "&6/maintenance aborttimer &7(Se estiver a correr o temporizador vai ser abortado)" helpEndtimer: "&6/maintenance endtimer &7(Depois do temporizador acabar a manutenção vai ser desativada)" helpStarttimer: "&6/maintenance starttimer &7(Depois do temporizador acabar a manutenção vai ser ativa)" +helpDebug: "&6/maintenance debug &7(Enables some debug logging)" helpDump: "&6/maintenance dump &7(Discarta alguma informação do server, usado para bugs)" helpHelp: "&6/maintenance help [page] &7(Mostra o help da manutenção)" helpMotd: "&6/maintenance motd [timer] &7(Lista as motd currentes. Se usar 'timer', os temporizadores vão ser mostrados)" diff --git a/maintenance-core/src/main/resources/language-ru.yml b/maintenance-core/src/main/resources/language-ru.yml index 51dc28d3..1b1a54a5 100644 --- a/maintenance-core/src/main/resources/language-ru.yml +++ b/maintenance-core/src/main/resources/language-ru.yml @@ -1,4 +1,4 @@ -# Maintenance Plugin by KennyTV +# Maintenance Plugin by kennytv # Translators: En_0t_S # Don't remove words inbetween the '%' if you don't exactly know why you're doing it @@ -12,6 +12,7 @@ endtimerBroadcast: "&aСервер будет открыт через &f%TIME%&a endtimerStarted: "&aТаймер успешно запущен! &aСервер будет открыт через &f%TIME%&a!" starttimerBroadcast: "&aСервер будет закрыт на технические работы через &f%TIME%&a!" starttimerStarted: "&aТаймер успешно запущен! &aСервер будет закрыт на технические работы через &f%TIME%&a!" +scheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." timerAlreadyRunning: "&cТаймер уже запущен!" timerNotRunning: "&cТаймер не был запущен." timerCancelled: "&7Таймер был остановлен." @@ -53,6 +54,7 @@ singleTimerCancelled: "&7Таймер сервера &f%SERVER% &7был ост singleTimerNotRunning: "&cТаймер сервера &f%SERVER% &cне был запущен." singleEndtimerBroadcast: "&aСервер &f%SERVER% &aбудет открыт через &f%TIME%&a!" singleStarttimerBroadcast: "&cВнимание! Сервер &f%SERVER% &cбудет закрыт на технические работы через &f%TIME%&c!" +singleScheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode on server %SERVER% will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." singleMaintenanceKick: "&cДанный сервер закрыт на технические работы! Попробуйте позже." singleMaintenanceKickComplete: "&cДанный сервер закрыт на технические работы!%NEWLINE%&cПопробуйте позже." singleMaintenanceActivated: "&aРежим технических работ на сервере &f%SERVER% &aвключен!" @@ -75,6 +77,7 @@ helpNextPage: "&fИспользуйте &6/maintenance help %PAGE% &fчтобы helpAbortTimer: "&6/maintenance aborttimer &7- &fОстановить таймер включения/выключения режима технических работ." helpEndtimer: "&6/maintenance endtimer [время в минутах] &7- &fЗапустить таймер выключения режима технических работ." helpStarttimer: "&6/maintenance starttimer [время в минутах] &7- &fЗапустить таймер включения режима технических работ." +helpDebug: "&6/maintenance debug &7(Enables some debug logging)" helpDump: "&6/maintenance dump &7- &fСоздать дамп." helpHelp: "&6/maintenance help [страница] &7- &fОтобразить список доступных команд." helpMotd: "&6/maintenance motd &7- &fОтобразить список титульных сообщений." diff --git a/maintenance-core/src/main/resources/language-zh.yml b/maintenance-core/src/main/resources/language-zh.yml index 73d73f09..3a7527c0 100644 --- a/maintenance-core/src/main/resources/language-zh.yml +++ b/maintenance-core/src/main/resources/language-zh.yml @@ -1,4 +1,4 @@ -# Maintenance 插件由 KennyTV 开发 +# Maintenance 插件由 kennytv 开发 # 简体中文由 RinAfter 提供 # 如果你不清楚请不要删除 '%' 之间的单词 @@ -12,6 +12,7 @@ endtimerBroadcast: "&8[&eMaintenance&8] &7维护模式将在&6%TIME%&7后关闭" endtimerStarted: "&8[&eMaintenance&8] &a开始计时: &7维护模式将在&6%TIME%&7后关闭" starttimerBroadcast: "&8[&eMaintenance&8] &7维护模式将在&6%TIME%&7后开启" starttimerStarted: "&8[&eMaintenance&8] &a开始计时: &7维护模式将在&6%TIME%&7后开启。" +scheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." timerAlreadyRunning: "&8[&eMaintenance&8] &c当前已有计时正在执行!" timerNotRunning: "&8[&eMaintenance&8] &c当前没有正在运行的计时器。" timerCancelled: "&8[&eMaintenance&8] &c当前计时器已中止。" @@ -53,6 +54,7 @@ singleTimerCancelled: "&8[&eMaintenance&8] &c服务器&e%SERVER%&c的计时器 singleTimerNotRunning: "&8[&eMaintenance&8] &c该服务器当前没有正在运行的计时器。" singleEndtimerBroadcast: "&8[&eMaintenance&8] &7服务器%SERVER%的维护模式将在&6%TIME%&7后关闭。" singleStarttimerBroadcast: "&8[&eMaintenance&8] &7服务器%SERVER%的维护模式将在&6%TIME%&7后开启。" +singleScheduletimerBroadcast: "&8[&eMaintenance&8] &7Maintenance mode on server %SERVER% will be enabled in &6%TIME% &7and will last for &6%DURATION%&7." singleMaintenanceKick: "&8[&eMaintenance&8] &c服务器%SERVER%正在维护!请稍后再试!" singleMaintenanceKickComplete: "&c服务器%SERVER%正在维护!%NEWLINE%&c你可以尝试重新加入另一个服务器!" singleMaintenanceActivated: "&8[&eMaintenance&8] &6服务器&e%SERVER%&6的维护模式已启用。" @@ -75,6 +77,7 @@ helpNextPage: "&7使用&b/maintenance help %PAGE% &7切换到下一帮助页" helpAbortTimer: "&6/maintenance aborttimer &7(中止当前开启的计时器)" helpEndtimer: "&6/maintenance endtimer &7(在以分钟为单位给定时间后将关闭维护模式)" helpStarttimer: "&6/maintenance starttimer &7(在以分钟为单位给定时间后将开启维护模式)" +helpDebug: "&6/maintenance debug &7(Enables some debug logging)" helpDump: "&6/maintenance dump &7(转储一些服务器信息,用于错误报告)" helpHelp: "&6/maintenance help [page] &7(显示帮助信息)" helpMotd: "&6/maintenance motd [timer] &7(显示当前设置的维护模式MOTD。如果指定'timer',则显示计时器MOTD)" diff --git a/maintenance-core/src/test/java/eu/kennytv/maintenance/core/config/ConfigTest.java b/maintenance-core/src/test/java/eu/kennytv/maintenance/core/config/ConfigTest.java index 1c40a5c7..cb0cec75 100644 --- a/maintenance-core/src/test/java/eu/kennytv/maintenance/core/config/ConfigTest.java +++ b/maintenance-core/src/test/java/eu/kennytv/maintenance/core/config/ConfigTest.java @@ -1,3 +1,20 @@ +/* + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 . + */ package eu.kennytv.maintenance.core.config; import com.google.common.io.Files; diff --git a/maintenance-spigot/pom.xml b/maintenance-spigot/pom.xml index e79e0137..82f516bf 100644 --- a/maintenance-spigot/pom.xml +++ b/maintenance-spigot/pom.xml @@ -6,7 +6,7 @@ eu.kennytv.maintenance maintenance-parent - 3.0.6 + 3.0.7 maintenance-spigot @@ -22,7 +22,7 @@ com.destroystokyo.paper paper-api - 1.16.3-R0.1-SNAPSHOT + 1.16.5-R0.1-SNAPSHOT provided diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/MaintenanceSpigotBase.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/MaintenanceSpigotBase.java index ca0906d8..99f57310 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/MaintenanceSpigotBase.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/MaintenanceSpigotBase.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot; import eu.kennytv.maintenance.api.IMaintenance; diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/MaintenanceSpigotPlugin.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/MaintenanceSpigotPlugin.java index bde9d91f..97546c10 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/MaintenanceSpigotPlugin.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/MaintenanceSpigotPlugin.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot; import eu.kennytv.maintenance.api.IMaintenance; @@ -59,7 +58,7 @@ import java.util.stream.Collectors; /** - * @author KennyTV + * @author kennytv * @since 2.0 */ public final class MaintenanceSpigotPlugin extends MaintenancePlugin { @@ -97,7 +96,9 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin { final Plugin serverListPlus = pm.getPlugin("ServerListPlus"); if (pm.isPluginEnabled(serverListPlus)) { serverListPlusHook = new ServerListPlusHook(serverListPlus); - serverListPlusHook.setEnabled(!settings.isMaintenance()); + if (settings.isEnablePingMessages()) { + serverListPlusHook.setEnabled(!settings.isMaintenance()); + } plugin.getLogger().info("Enabled ServerListPlus integration!"); } } @@ -131,6 +132,11 @@ public void async(final Runnable runnable) { getServer().getScheduler().runTaskAsynchronously(plugin, runnable); } + @Override + protected void executeConsoleCommand(final String command) { + getServer().dispatchCommand(getServer().getConsoleSender(), command); + } + @Override public void broadcast(final String message) { getServer().broadcastMessage(message); diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/command/MaintenanceSpigotCommand.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/command/MaintenanceSpigotCommand.java index c1cb1272..f9caa2ff 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/command/MaintenanceSpigotCommand.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/command/MaintenanceSpigotCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot.command; import eu.kennytv.maintenance.core.Settings; diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/PaperServerListPingListener.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/PaperServerListPingListener.java index 598cb8b6..0a2d210a 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/PaperServerListPingListener.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/PaperServerListPingListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot.listener; import com.destroystokyo.paper.event.server.PaperServerListPingEvent; diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/PlayerLoginListener.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/PlayerLoginListener.java index 49afbb2f..2b6538e8 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/PlayerLoginListener.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/PlayerLoginListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot.listener; import eu.kennytv.maintenance.core.Settings; diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/ServerInfoPacketListener.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/ServerInfoPacketListener.java index ae5cabea..ced12e9c 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/ServerInfoPacketListener.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/ServerInfoPacketListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot.listener; import com.comphenix.protocol.PacketType; @@ -51,7 +50,7 @@ public ServerInfoPacketListener(final MaintenanceSpigotPlugin plugin, final Main @Override public void onPacketSending(final PacketEvent event) { - if (!settings.isMaintenance()) return; + if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return; final WrappedServerPing ping = event.getPacket().getServerPings().read(0); ping.setMotD(settings.getRandomPingMessage()); diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/ServerListPingListener.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/ServerListPingListener.java index 394cef31..812dab4d 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/ServerListPingListener.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/listener/ServerListPingListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot.listener; import eu.kennytv.maintenance.core.Settings; @@ -36,7 +35,7 @@ public ServerListPingListener(final MaintenanceSpigotPlugin plugin, final Settin @EventHandler(priority = EventPriority.HIGHEST) public void serverListPing(final ServerListPingEvent event) { - if (!settings.isMaintenance()) return; + if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return; if (settings.hasCustomPlayerCountMessage()) { event.setMaxPlayers(0); diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitOfflinePlayerInfo.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitOfflinePlayerInfo.java index 85cd45c8..58a99360 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitOfflinePlayerInfo.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitOfflinePlayerInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot.util; import eu.kennytv.maintenance.core.util.SenderInfo; diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitSenderInfo.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitSenderInfo.java index e30b053a..0b2afc79 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitSenderInfo.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitSenderInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot.util; import eu.kennytv.maintenance.core.util.SenderInfo; diff --git a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitTask.java b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitTask.java index c64c834c..9abe049c 100644 --- a/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitTask.java +++ b/maintenance-spigot/src/main/java/eu/kennytv/maintenance/spigot/util/BukkitTask.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.spigot.util; import eu.kennytv.maintenance.core.util.Task; diff --git a/maintenance-spigot/src/main/resources/plugin.yml b/maintenance-spigot/src/main/resources/plugin.yml index cd208b99..4e6aa812 100644 --- a/maintenance-spigot/src/main/resources/plugin.yml +++ b/maintenance-spigot/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: Maintenance version: ${project.version} main: eu.kennytv.maintenance.spigot.MaintenanceSpigotBase -author: KennyTV +author: kennytv description: Enable maintenance mode with a custom maintenance motd and icon. softdepend: [ProtocolLib, ServerListPlus, ProtocolSupport] website: https://www.spigotmc.org/resources/maintenance.40699/ diff --git a/maintenance-sponge/pom.xml b/maintenance-sponge/pom.xml index 66507894..cda34f01 100644 --- a/maintenance-sponge/pom.xml +++ b/maintenance-sponge/pom.xml @@ -6,7 +6,7 @@ eu.kennytv.maintenance maintenance-parent - 3.0.6 + 3.0.7 maintenance-sponge diff --git a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/MaintenanceSpongePlugin.java b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/MaintenanceSpongePlugin.java index b6c44545..4f668a01 100644 --- a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/MaintenanceSpongePlugin.java +++ b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/MaintenanceSpongePlugin.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.sponge; import com.google.inject.Inject; @@ -72,10 +71,10 @@ import java.util.stream.Collectors; /** - * @author KennyTV + * @author kennytv * @since 3.0 */ -@Plugin(id = "maintenance", name = "Maintenance", version = MaintenanceVersion.VERSION, authors = "KennyTV", +@Plugin(id = "maintenance", name = "Maintenance", version = MaintenanceVersion.VERSION, authors = "kennytv", description = "Enable maintenance mode with a custom maintenance motd and icon.", url = "https://ore.spongepowered.org/KennyTV/Maintenance", dependencies = @Dependency(id = "serverlistplus", optional = true)) public final class MaintenanceSpongePlugin extends MaintenancePlugin { @@ -112,7 +111,9 @@ public void onEnable(final GameInitializationEvent event) { // ServerListPlus integration game.getPluginManager().getPlugin("serverlistplus").ifPresent(slpContainer -> slpContainer.getInstance().ifPresent(serverListPlus -> { serverListPlusHook = new ServerListPlusHook(serverListPlus); - serverListPlusHook.setEnabled(!settings.isMaintenance()); + if (settings.isEnablePingMessages()) { + serverListPlusHook.setEnabled(!settings.isMaintenance()); + } logger.info("Enabled ServerListPlus integration!"); })); } @@ -143,6 +144,11 @@ public void async(final Runnable runnable) { game.getScheduler().createTaskBuilder().async().execute(runnable).submit(this); } + @Override + protected void executeConsoleCommand(final String command) { + game.getCommandManager().process(game.getServer().getConsole(), command); + } + @Override public void broadcast(final String message) { getServer().getBroadcastChannel().send(translate(message)); diff --git a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/command/MaintenanceSpongeCommand.java b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/command/MaintenanceSpongeCommand.java index 1b8eb6c7..451f6713 100644 --- a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/command/MaintenanceSpongeCommand.java +++ b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/command/MaintenanceSpongeCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.sponge.command; import eu.kennytv.maintenance.core.Settings; diff --git a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/listener/ClientConnectionListener.java b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/listener/ClientConnectionListener.java index dd0d359e..e25f7bf0 100644 --- a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/listener/ClientConnectionListener.java +++ b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/listener/ClientConnectionListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.sponge.listener; import eu.kennytv.maintenance.core.Settings; diff --git a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/listener/ClientPingServerListener.java b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/listener/ClientPingServerListener.java index 45c764f2..356a3c9b 100644 --- a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/listener/ClientPingServerListener.java +++ b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/listener/ClientPingServerListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.sponge.listener; import eu.kennytv.maintenance.core.Settings; @@ -41,7 +40,7 @@ public ClientPingServerListener(final MaintenanceSpongePlugin plugin, final Sett @Listener(order = Order.LAST) public void proxyPing(final ClientPingServerEvent event) { - if (!settings.isMaintenance()) return; + if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return; final ClientPingServerEvent.Response response = event.getResponse(); if (settings.hasCustomPlayerCountMessage()) { diff --git a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/LoggerWrapper.java b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/LoggerWrapper.java index 63bf367f..d2080360 100644 --- a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/LoggerWrapper.java +++ b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/LoggerWrapper.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.sponge.util; import org.slf4j.Logger; diff --git a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeOfflinePlayerInfo.java b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeOfflinePlayerInfo.java index 38d5b463..1729a939 100644 --- a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeOfflinePlayerInfo.java +++ b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeOfflinePlayerInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.sponge.util; import eu.kennytv.maintenance.core.util.SenderInfo; diff --git a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeSenderInfo.java b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeSenderInfo.java index 4854f9ae..6833141f 100644 --- a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeSenderInfo.java +++ b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeSenderInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.sponge.util; import eu.kennytv.maintenance.core.util.SenderInfo; diff --git a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeTask.java b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeTask.java index 194be704..59409b37 100644 --- a/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeTask.java +++ b/maintenance-sponge/src/main/java/eu/kennytv/maintenance/sponge/util/SpongeTask.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.sponge.util; import eu.kennytv.maintenance.core.util.Task; diff --git a/maintenance-velocity/pom.xml b/maintenance-velocity/pom.xml index 37adadf7..7daff513 100644 --- a/maintenance-velocity/pom.xml +++ b/maintenance-velocity/pom.xml @@ -6,7 +6,7 @@ eu.kennytv.maintenance maintenance-parent - 3.0.6 + 3.0.7 maintenance-velocity @@ -22,9 +22,15 @@ com.velocitypowered velocity-api - 1.1.0 + 3.0.0-SNAPSHOT provided + + mysql + mysql-connector-java + 8.0.25 + compile + @@ -46,6 +52,14 @@ com.zaxxer.hikari eu.kennytv.lib.hikari + + com.mysql + eu.kennytv.lib.mysql + + + com.google.protobuf + eu.kennytv.lib.protobuf + diff --git a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/MaintenanceVelocityPlugin.java b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/MaintenanceVelocityPlugin.java index 36ef7dc9..8f8c30cc 100644 --- a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/MaintenanceVelocityPlugin.java +++ b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/MaintenanceVelocityPlugin.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.velocity; import com.google.inject.Inject; @@ -39,6 +38,8 @@ import eu.kennytv.maintenance.core.hook.ServerListPlusHook; import eu.kennytv.maintenance.core.proxy.MaintenanceProxyPlugin; import eu.kennytv.maintenance.core.proxy.SettingsProxy; +import eu.kennytv.maintenance.core.proxy.util.ProfileLookup; +import eu.kennytv.maintenance.core.proxy.util.ProxyOfflineSenderInfo; import eu.kennytv.maintenance.core.util.MaintenanceVersion; import eu.kennytv.maintenance.core.util.SenderInfo; import eu.kennytv.maintenance.core.util.ServerType; @@ -69,10 +70,10 @@ import java.util.stream.Collectors; /** - * @author KennyTV + * @author kennytv * @since 3.0 */ -@Plugin(id = "maintenance", name = "Maintenance", version = MaintenanceVersion.VERSION, authors = "KennyTV", +@Plugin(id = "maintenance", name = "Maintenance", version = MaintenanceVersion.VERSION, authors = "kennytv", description = "Enable maintenance mode with a custom maintenance motd and icon.", url = "https://forums.velocitypowered.com/t/maintenance/129", dependencies = @Dependency(id = "serverlistplus", optional = true)) public final class MaintenanceVelocityPlugin extends MaintenanceProxyPlugin { @@ -109,7 +110,9 @@ public void onEnable(final ProxyInitializeEvent event) { // ServerListPlus integration server.getPluginManager().getPlugin("serverlistplus").ifPresent(slpContainer -> slpContainer.getInstance().ifPresent(serverListPlus -> { serverListPlusHook = new ServerListPlusHook(serverListPlus); - serverListPlusHook.setEnabled(!settingsProxy.isMaintenance()); + if (settings.isEnablePingMessages()) { + serverListPlusHook.setEnabled(!settingsProxy.isMaintenance()); + } logger.info("Enabled ServerListPlus integration!"); })); } @@ -127,14 +130,11 @@ public void onDisable(final ProxyShutdownEvent event) { @Override public void sendUpdateNotification(final SenderInfo sender) { - 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(ClickEvent.openUrl("https://www.spigotmc.org/resources/maintenance.40699/")); - click.hoverEvent(HoverEvent.showText(translate("§aDownload the latest version"))); - tc1.append(tc2); - tc1.append(click); - ((VelocitySenderInfo) sender).sendMessage(tc1); + final TextComponent component = translate(getPrefix()).append(translate("§cDownload it at: §6https://www.spigotmc.org/resources/maintenance.40699/")); + final TextComponent clickText = translate(" §7§l§o(CLICK ME)") + .clickEvent(ClickEvent.openUrl("https://www.spigotmc.org/resources/maintenance.40699/")) + .hoverEvent(HoverEvent.showText(translate("§aDownload the latest version"))); + ((VelocitySenderInfo) sender).sendMessage(component.append(clickText)); } public boolean isMaintenance(final RegisteredServer serverInfo) { @@ -210,7 +210,18 @@ public Server getServer(final String server) { @Nullable public SenderInfo getOfflinePlayer(final String name) { final Optional player = server.getPlayer(name); - return player.map(VelocitySenderInfo::new).orElse(null); + if (player.isPresent()) { + return new VelocitySenderInfo(player.get()); + } + + final ProfileLookup profile; + try { + profile = doUUIDLookup(name); + } catch (final IOException e) { + e.printStackTrace(); + return null; + } + return new ProxyOfflineSenderInfo(profile.getUuid(), profile.getName()); } @Override @@ -233,6 +244,11 @@ public void async(final Runnable runnable) { server.getScheduler().buildTask(this, runnable).schedule(); } + @Override + protected void executeConsoleCommand(final String command) { + server.getCommandManager().executeAsync(server.getConsoleCommandSource(), command); + } + @Override public void broadcast(final String message) { server.sendMessage(translate(message)); diff --git a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/command/MaintenanceVelocityCommand.java b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/command/MaintenanceVelocityCommand.java index 65857c74..595aa111 100644 --- a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/command/MaintenanceVelocityCommand.java +++ b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/command/MaintenanceVelocityCommand.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.velocity.command; import com.velocitypowered.api.command.CommandSource; diff --git a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/listener/ProxyPingListener.java b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/listener/ProxyPingListener.java index 2cc04470..18220a04 100644 --- a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/listener/ProxyPingListener.java +++ b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/listener/ProxyPingListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.velocity.listener; import com.velocitypowered.api.event.EventHandler; @@ -38,7 +37,7 @@ public ProxyPingListener(final MaintenanceVelocityPlugin plugin, final SettingsP @Override public void execute(final ProxyPingEvent event) { - if (!settings.isMaintenance()) return; + if (!settings.isMaintenance() || !settings.isEnablePingMessages()) return; final ServerPing ping = event.getPing(); final ServerPing.Builder builder = ping.asBuilder(); diff --git a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/listener/ServerConnectListener.java b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/listener/ServerConnectListener.java index c591d63e..e7502889 100644 --- a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/listener/ServerConnectListener.java +++ b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/listener/ServerConnectListener.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.velocity.listener; import com.velocitypowered.api.event.PostOrder; diff --git a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/LoggerWrapper.java b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/LoggerWrapper.java index 7e52848d..f59ebe67 100644 --- a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/LoggerWrapper.java +++ b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/LoggerWrapper.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.velocity.util; import org.slf4j.Logger; diff --git a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocitySenderInfo.java b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocitySenderInfo.java index 5aaf073d..847aae4d 100644 --- a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocitySenderInfo.java +++ b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocitySenderInfo.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.velocity.util; import com.velocitypowered.api.command.CommandSource; diff --git a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocityServer.java b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocityServer.java index 916f199d..262e9e21 100644 --- a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocityServer.java +++ b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocityServer.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.velocity.util; import com.velocitypowered.api.proxy.Player; diff --git a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocityTask.java b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocityTask.java index e190bb85..1199d2b0 100644 --- a/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocityTask.java +++ b/maintenance-velocity/src/main/java/eu/kennytv/maintenance/velocity/util/VelocityTask.java @@ -1,6 +1,6 @@ /* - * Maintenance - https://git.io/maintenancemode - * Copyright (C) 2018-2021 KennyTV (https://github.com/KennyTV) + * This file is part of Maintenance - https://github.com/kennytv/Maintenance + * Copyright (C) 2018-2021 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 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package eu.kennytv.maintenance.velocity.util; import com.velocitypowered.api.scheduler.ScheduledTask; diff --git a/pom.xml b/pom.xml index 98036ed0..0e5445e4 100644 --- a/pom.xml +++ b/pom.xml @@ -6,17 +6,17 @@ eu.kennytv.maintenance maintenance-parent - 3.0.6 + 3.0.7 pom Maintenance - https://github.com/KennyTV/Maintenance + https://github.com/kennytv/Maintenance 2018 - KennyTV - https://github.com/KennyTV/ + kennytv + https://github.com/kennytv/ @@ -39,17 +39,17 @@ - - spigotmc - https://hub.spigotmc.org/nexus/content/groups/public/ - papermc https://papermc.io/repo/repository/maven-public/ + + spigotmc + https://hub.spigotmc.org/nexus/content/groups/public/ + sponge - http://repo.spongepowered.org/maven + https://repo.spongepowered.org/repository/maven-public/ velocity @@ -57,7 +57,7 @@ dmulloy2 - http://repo.dmulloy2.net/nexus/repository/public/ + https://repo.dmulloy2.net/repository/public/ minecrell @@ -69,13 +69,13 @@ org.jetbrains annotations - 19.0.0 + 21.0.1 provided org.junit.jupiter junit-jupiter-engine - 5.6.2 + 5.7.2 test