Add server version info to the startup banner

This commit is contained in:
Luck 2017-03-12 14:59:27 +00:00
parent d18ac2e6eb
commit f5007f94dc
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 8 additions and 3 deletions

View File

@ -454,7 +454,7 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
@Override @Override
public String getServerVersion() { public String getServerVersion() {
return getServer().getVersion(); return getServer().getVersion() + " - " + getServer().getBukkitVersion();
} }
@Override @Override

View File

@ -390,6 +390,7 @@ public interface LuckPermsPlugin {
sender.sendMessage(Util.color("&b |___ \\__/ \\__, | \\ &3| |___ | \\ | | .__/ ")); sender.sendMessage(Util.color("&b |___ \\__/ \\__, | \\ &3| |___ | \\ | | .__/ "));
sender.sendMessage(Util.color(" ")); 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("&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(" ")); sender.sendMessage(Util.color(" "));
} }

View File

@ -77,6 +77,7 @@ import me.lucko.luckperms.sponge.utils.VersionData;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.spongepowered.api.Game; import org.spongepowered.api.Game;
import org.spongepowered.api.Platform;
import org.spongepowered.api.Sponge; import org.spongepowered.api.Sponge;
import org.spongepowered.api.command.CommandManager; import org.spongepowered.api.command.CommandManager;
import org.spongepowered.api.config.ConfigDir; import org.spongepowered.api.config.ConfigDir;
@ -406,12 +407,15 @@ public class LPSpongePlugin implements LuckPermsPlugin {
@Override @Override
public String getServerName() { public String getServerName() {
return getGame().getPlatform().getImplementation().getDescription().orElse("null"); return getGame().getPlatform().getContainer(Platform.Component.IMPLEMENTATION).getName();
} }
@Override @Override
public String getServerVersion() { 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 @Override