From f5007f94dc34623a7ca2138556c73a8d53b04307 Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 12 Mar 2017 14:59:27 +0000 Subject: [PATCH] Add server version info to the startup banner --- .../java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java | 2 +- .../me/lucko/luckperms/common/plugin/LuckPermsPlugin.java | 1 + .../java/me/lucko/luckperms/sponge/LPSpongePlugin.java | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java index ecfc6c51b..05e974e43 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java @@ -454,7 +454,7 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin { @Override public String getServerVersion() { - return getServer().getVersion(); + return getServer().getVersion() + " - " + getServer().getBukkitVersion(); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/plugin/LuckPermsPlugin.java b/common/src/main/java/me/lucko/luckperms/common/plugin/LuckPermsPlugin.java index c406b380f..0066a0185 100644 --- a/common/src/main/java/me/lucko/luckperms/common/plugin/LuckPermsPlugin.java +++ b/common/src/main/java/me/lucko/luckperms/common/plugin/LuckPermsPlugin.java @@ -390,6 +390,7 @@ public interface LuckPermsPlugin { sender.sendMessage(Util.color("&b |___ \\__/ \\__, | \\ &3| |___ | \\ | | .__/ ")); sender.sendMessage(Util.color(" ")); sender.sendMessage(Util.color("&2 Loading version &bv" + plugin.getVersion() + "&2 on " + plugin.getServerType().getFriendlyName() + " - " + plugin.getServerName())); + sender.sendMessage(Util.color("&8 Running on server version " + plugin.getServerVersion())); sender.sendMessage(Util.color(" ")); } diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java index c2dfe8d4f..9a9e39ef4 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java @@ -77,6 +77,7 @@ import me.lucko.luckperms.sponge.utils.VersionData; import org.slf4j.Logger; import org.spongepowered.api.Game; +import org.spongepowered.api.Platform; import org.spongepowered.api.Sponge; import org.spongepowered.api.command.CommandManager; import org.spongepowered.api.config.ConfigDir; @@ -406,12 +407,15 @@ public class LPSpongePlugin implements LuckPermsPlugin { @Override public String getServerName() { - return getGame().getPlatform().getImplementation().getDescription().orElse("null"); + return getGame().getPlatform().getContainer(Platform.Component.IMPLEMENTATION).getName(); } @Override public String getServerVersion() { - return getGame().getPlatform().getApi().getVersion().orElse("null") + " - " + getGame().getPlatform().getImplementation().getVersion().orElse("null"); + return getGame().getPlatform().getContainer(Platform.Component.API).getName() + ": " + + getGame().getPlatform().getContainer(Platform.Component.API).getVersion().orElse("null") + " - " + + getGame().getPlatform().getContainer(Platform.Component.IMPLEMENTATION).getName() + ": " + + getGame().getPlatform().getContainer(Platform.Component.IMPLEMENTATION).getVersion().orElse("null"); } @Override