diff --git a/proxy/build.gradle b/proxy/build.gradle index de26f9648..0eb109cfe 100644 --- a/proxy/build.gradle +++ b/proxy/build.gradle @@ -18,7 +18,9 @@ jar { def version = "${project.version} (git-${project.ext.getCurrentShortRevision()}-b${buildNumber})" attributes 'Main-Class': 'com.velocitypowered.proxy.Velocity' + attributes 'Implementation-Title': "Velocity" attributes 'Implementation-Version': version + attributes 'Implementation-Vendor': "Velocity Contributors" } } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommand.java index d3cc55df4..54837598d 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommand.java @@ -1,5 +1,6 @@ package com.velocitypowered.proxy.command; +import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.velocitypowered.api.command.Command; @@ -80,30 +81,34 @@ public class VelocityCommand implements Command { @Override public void execute(@NonNull CommandSource source, @NonNull String[] args) { - String implVersion = VelocityServer.class.getPackage().getImplementationVersion(); - TextComponent velocity = TextComponent.builder("Velocity ") + String implName = MoreObjects.firstNonNull(VelocityServer.class.getPackage().getImplementationTitle(), "Velocity"); + String implVersion = MoreObjects.firstNonNull(VelocityServer.class.getPackage().getImplementationVersion(), ""); + String implVendor = MoreObjects.firstNonNull(VelocityServer.class.getPackage().getImplementationVendor(), "Velocity Contributors"); + TextComponent velocity = TextComponent.builder(implName + " ") .decoration(TextDecoration.BOLD, true) .color(TextColor.DARK_AQUA) .append(TextComponent.of(implVersion == null ? "" : implVersion).decoration(TextDecoration.BOLD, false)) .build(); - TextComponent copyright = TextComponent.of("Copyright 2018 Velocity Contributors. Velocity is freely licensed under the terms of the " + + TextComponent copyright = TextComponent.of("Copyright 2018 " + implVendor + ". " + implName + " is freely licensed under the terms of the " + "MIT License."); - TextComponent velocityWebsite = TextComponent.builder() - .content("Visit the ") - .append(TextComponent.builder("Velocity website") - .color(TextColor.GREEN) - .clickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.velocitypowered.com")) - .build()) - .append(TextComponent.of(" or the ").resetStyle()) - .append(TextComponent.builder("Velocity GitHub") - .color(TextColor.GREEN) - .clickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/VelocityPowered/Velocity")) - .build()) - .build(); - source.sendMessage(velocity); source.sendMessage(copyright); - source.sendMessage(velocityWebsite); + + if (implName.equals("Velocity")) { + TextComponent velocityWebsite = TextComponent.builder() + .content("Visit the ") + .append(TextComponent.builder("Velocity website") + .color(TextColor.GREEN) + .clickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.velocitypowered.com")) + .build()) + .append(TextComponent.of(" or the ").resetStyle()) + .append(TextComponent.builder("Velocity GitHub") + .color(TextColor.GREEN) + .clickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/VelocityPowered/Velocity")) + .build()) + .build(); + source.sendMessage(velocityWebsite); + } } @Override