Remove platform suffix from plugin identifier

This commit is contained in:
KennyTV committed 2020-04-22 10:59:27 +02:00
1 parent b4c3fbeb19
commit 5e0809c448
12 files changed
+19 -17

No files matched your search

+2 -1
View File
@@ -6,7 +6,8 @@ This file contains update logs for this project. The top may contain a `Unreleas
* Added Chinese language file (thanks to Spigot user yeban)
* Added Italian language file (thanks to @TheViperShow)
* Updated Russian language file (thanks to Spigot user En_0t_S)
* API change: The plugin identifiers are now all `Maintenance` instead of the previous `MaintenanceSpigot`, `MaintenanceBungee`, etc.
* If you are using the MaintenancePlaceholderAddon, you need to update it to 1.0.3
### Fixed
* Fixed the `use-ssl` option being inverted
* Fixed disabling the playercount-message still hiding online/max players
+1 -2
View File
@@ -19,9 +19,8 @@ Its features include:
* 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)
* [Wiki](https://github.com/KennyTV/Maintenance/wiki) (configuration, permissions, API usage)
* [Downloads](https://github.com/KennyTV/Maintenance/releases) (GitHub)
* [Development builds](https://kennytv.eu/maintenance/snapshot/) (out of order at the moment)
* [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)
@@ -41,9 +41,9 @@ public final class MaintenanceBungeeAPI {
* @throws IllegalArgumentException if using a custom (or broken?) version of the plugin, that can't be identified
*/
public static IMaintenanceProxy getAPI() {
final Plugin maintenance = ProxyServer.getInstance().getPluginManager().getPlugin("MaintenanceBungee");
final Plugin maintenance = ProxyServer.getInstance().getPluginManager().getPlugin("Maintenance");
if (maintenance == null)
throw new IllegalArgumentException("Could not get instance of MaintenanceBungee! Broken/custom build of the plugin?");
throw new IllegalArgumentException("Could not get instance of Maintenance! Broken/custom build of the plugin?");
return (IMaintenanceProxy) ((IMaintenanceBase) maintenance).getApi();
}
}
@@ -41,9 +41,9 @@ public final class MaintenanceSpigotAPI {
* @throws IllegalArgumentException if using a custom (or broken?) version of the plugin, that can't be identified
*/
public static IMaintenance getAPI() {
final Plugin maintenance = Bukkit.getPluginManager().getPlugin("MaintenanceSpigot");
final Plugin maintenance = Bukkit.getPluginManager().getPlugin("Maintenance");
if (maintenance == null)
throw new IllegalArgumentException("Could not get instance of MaintenanceSpigot! Broken/custom build of the plugin?");
throw new IllegalArgumentException("Could not get instance of Maintenance! Broken/custom build of the plugin?");
return ((IMaintenanceBase) maintenance).getApi();
}
}
@@ -42,9 +42,9 @@ public final class MaintenanceSpongeAPI {
* @throws IllegalArgumentException if using a custom (or broken?) version of the plugin, that can't be identified
*/
public static IMaintenance getAPI() {
final Optional<PluginContainer> container = Sponge.getPluginManager().getPlugin("maintenancesponge");
final Optional<PluginContainer> container = Sponge.getPluginManager().getPlugin("maintenance");
if (!container.isPresent() || !container.get().getInstance().isPresent())
throw new IllegalArgumentException("Could not get instance of MaintenanceSponge! Broken/custom build of the plugin?");
throw new IllegalArgumentException("Could not get instance of Maintenance! Broken/custom build of the plugin?");
return (IMaintenance) container.get().getInstance().get();
}
}
@@ -76,7 +76,8 @@ public final class MetricsLite {
public JsonObject getPluginData() {
final JsonObject data = new JsonObject();
final String pluginName = plugin.getDescription().getName();
//final String pluginName = plugin.getDescription().getName();
final String pluginName = "MaintenanceBungee"; // I cut off the suffix, not sure how bStats would like the name change
final String pluginVersion = plugin.getDescription().getVersion();
data.addProperty("pluginName", pluginName);
@@ -1,4 +1,4 @@
name: MaintenanceBungee
name: Maintenance
version: ${project.version}
main: eu.kennytv.maintenance.bungee.MaintenanceBungeeBase
author: KennyTV
@@ -76,7 +76,7 @@ public final class MaintenanceSpigotPlugin extends MaintenancePlugin {
final MaintenanceSpigotCommand command = new MaintenanceSpigotCommand(this, settings);
commandManager = command;
plugin.getCommand("maintenancespigot").setExecutor(command);
plugin.getCommand("maintenance").setExecutor(command);
final PluginManager pm = getServer().getPluginManager();
pm.registerEvents(new PlayerLoginListener(this, settings), plugin);
@@ -110,7 +110,8 @@ public final class MetricsLite {
public JsonObject getPluginData() {
final JsonObject data = new JsonObject();
final String pluginName = plugin.getDescription().getName();
//final String pluginName = plugin.getDescription().getName();
final String pluginName = "MaintenanceSpigot"; // I cut off the suffix, not sure how bStats would like the name change
final String pluginVersion = plugin.getDescription().getVersion();
data.addProperty("pluginName", pluginName);
@@ -1,4 +1,4 @@
name: MaintenanceSpigot
name: Maintenance
version: ${project.version}
main: eu.kennytv.maintenance.spigot.MaintenanceSpigotBase
author: KennyTV
@@ -75,7 +75,7 @@ import java.util.stream.Collectors;
* @author KennyTV
* @since 3.0
*/
@Plugin(id = "maintenancesponge", name = "MaintenanceSponge", 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 {
@@ -72,7 +72,7 @@ import java.util.stream.Collectors;
* @author KennyTV
* @since 3.0
*/
@Plugin(id = "maintenancevelocity", name = "MaintenanceVelocity", 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 {
@@ -245,7 +245,7 @@ public final class MaintenanceVelocityPlugin extends MaintenanceProxyPlugin {
@Override
public File getPluginFile() {
return server.getPluginManager().getPlugin("maintenancevelocity")
return server.getPluginManager().getPlugin("maintenance")
.orElseThrow(() -> new IllegalArgumentException("Couldn't get Maintenance instance. Custom/broken build?")).getDescription().getSource()
.orElseThrow(IllegalArgumentException::new).toFile();
}