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})"
|
def version = "${project.version} (git-${project.ext.getCurrentShortRevision()}-b${buildNumber})"
|
||||||
|
|
||||||
attributes 'Main-Class': 'com.velocitypowered.proxy.Velocity'
|
attributes 'Main-Class': 'com.velocitypowered.proxy.Velocity'
|
||||||
|
attributes 'Implementation-Title': "Velocity"
|
||||||
attributes 'Implementation-Version': version
|
attributes 'Implementation-Version': version
|
||||||
|
attributes 'Implementation-Vendor': "Velocity Contributors"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.velocitypowered.proxy.command;
|
package com.velocitypowered.proxy.command;
|
||||||
|
|
||||||
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.velocitypowered.api.command.Command;
|
import com.velocitypowered.api.command.Command;
|
||||||
@ -80,30 +81,34 @@ public class VelocityCommand implements Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(@NonNull CommandSource source, @NonNull String[] args) {
|
public void execute(@NonNull CommandSource source, @NonNull String[] args) {
|
||||||
String implVersion = VelocityServer.class.getPackage().getImplementationVersion();
|
String implName = MoreObjects.firstNonNull(VelocityServer.class.getPackage().getImplementationTitle(), "Velocity");
|
||||||
TextComponent velocity = TextComponent.builder("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)
|
.decoration(TextDecoration.BOLD, true)
|
||||||
.color(TextColor.DARK_AQUA)
|
.color(TextColor.DARK_AQUA)
|
||||||
.append(TextComponent.of(implVersion == null ? "<unknown>" : implVersion).decoration(TextDecoration.BOLD, false))
|
.append(TextComponent.of(implVersion == null ? "<unknown>" : implVersion).decoration(TextDecoration.BOLD, false))
|
||||||
.build();
|
.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.");
|
"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(velocity);
|
||||||
source.sendMessage(copyright);
|
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
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren