geforkt von Mirrors/Velocity
Ursprung
a037aebfa0
Commit
0e0a14498f
@ -281,18 +281,20 @@ public class VelocityCommand implements SimpleCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
TranslatableComponent.Builder output = Component.translatable()
|
||||
.key("velocity.command.plugins-list")
|
||||
.color(NamedTextColor.YELLOW);
|
||||
TextComponent.Builder listBuilder = Component.text();
|
||||
for (int i = 0; i < pluginCount; i++) {
|
||||
PluginContainer plugin = plugins.get(i);
|
||||
output.append(componentForPlugin(plugin.getDescription()));
|
||||
listBuilder.append(componentForPlugin(plugin.getDescription()));
|
||||
if (i + 1 < pluginCount) {
|
||||
output.append(Component.text(", "));
|
||||
listBuilder.append(Component.text(", "));
|
||||
}
|
||||
}
|
||||
|
||||
source.sendMessage(Identity.nil(), output.build());
|
||||
TranslatableComponent.Builder output = Component.translatable()
|
||||
.key("velocity.command.plugins-list")
|
||||
.color(NamedTextColor.YELLOW)
|
||||
.args(listBuilder.build());
|
||||
source.sendMessage(Identity.nil(), output);
|
||||
}
|
||||
|
||||
private TextComponent componentForPlugin(PluginDescription description) {
|
||||
@ -361,8 +363,8 @@ public class VelocityCommand implements SimpleCommand {
|
||||
JsonArray connectOrder = new JsonArray();
|
||||
List<String> attemptedConnectionOrder = ImmutableList.copyOf(
|
||||
server.getConfiguration().getAttemptConnectionOrder());
|
||||
for (int i = 0; i < attemptedConnectionOrder.size(); i++) {
|
||||
connectOrder.add(attemptedConnectionOrder.get(i));
|
||||
for (String s : attemptedConnectionOrder) {
|
||||
connectOrder.add(s);
|
||||
}
|
||||
|
||||
JsonObject proxyConfig = InformationUtils.collectProxyConfig(server.getConfiguration());
|
||||
|
@ -614,7 +614,11 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
case CONNECTION_IN_PROGRESS:
|
||||
// Fatal case
|
||||
case CONNECTION_CANCELLED:
|
||||
disconnect(status.getReasonComponent().orElse(res.getMessageComponent()));
|
||||
Component fallbackMsg = res.getMessageComponent();
|
||||
if (fallbackMsg == null) {
|
||||
fallbackMsg = friendlyReason;
|
||||
}
|
||||
disconnect(status.getReasonComponent().orElse(fallbackMsg));
|
||||
break;
|
||||
case SERVER_DISCONNECTED:
|
||||
Component reason = status.getReasonComponent()
|
||||
@ -623,10 +627,14 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
getProtocolVersion()), ((Impl) status).isSafe());
|
||||
break;
|
||||
case SUCCESS:
|
||||
sendMessage(Component.translatable("velocity.error.moved-to-new-server",
|
||||
NamedTextColor.RED,
|
||||
Component.text(originalEvent.getServer().getServerInfo().getName()),
|
||||
friendlyReason));
|
||||
Component requestedMessage = res.getMessageComponent();
|
||||
if (requestedMessage == null) {
|
||||
requestedMessage = Component.translatable("velocity.error.moved-to-new-server",
|
||||
NamedTextColor.RED,
|
||||
Component.text(originalEvent.getServer().getServerInfo().getName()),
|
||||
friendlyReason);
|
||||
}
|
||||
sendMessage(requestedMessage);
|
||||
break;
|
||||
default:
|
||||
// The only remaining value is successful (no need to do anything!)
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren