Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Update /velocity version so implementation stuff can be changed.
Dieser Commit ist enthalten in:
Ursprung
c977ddec61
Commit
3f612fb5c2
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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,14 +81,20 @@ 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(), "<unknown>");
|
||||
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 ? "<unknown>" : 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.");
|
||||
source.sendMessage(velocity);
|
||||
source.sendMessage(copyright);
|
||||
|
||||
if (implName.equals("Velocity")) {
|
||||
TextComponent velocityWebsite = TextComponent.builder()
|
||||
.content("Visit the ")
|
||||
.append(TextComponent.builder("Velocity website")
|
||||
@ -100,11 +107,9 @@ public class VelocityCommand implements Command {
|
||||
.clickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/VelocityPowered/Velocity"))
|
||||
.build())
|
||||
.build();
|
||||
|
||||
source.sendMessage(velocity);
|
||||
source.sendMessage(copyright);
|
||||
source.sendMessage(velocityWebsite);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(@NonNull CommandSource source, @NonNull String[] args) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren