3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-16 21:10:30 +01:00

Refactor command suggestion tooltip handling to support non-Velocity messages

Dieser Commit ist enthalten in:
Timongcraft 2024-06-22 17:52:39 +02:00
Ursprung 9d25d309d3
Commit fcac93fd25
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 58C9C6C8E8E9E384

Datei anzeigen

@ -676,10 +676,14 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
for (Suggestion suggestion : suggestions.getList()) {
String offer = suggestion.getText();
ComponentHolder tooltip = null;
if (suggestion.getTooltip() != null
&& suggestion.getTooltip() instanceof VelocityBrigadierMessage) {
tooltip = new ComponentHolder(player.getProtocolVersion(),
((VelocityBrigadierMessage) suggestion.getTooltip()).asComponent());
if (suggestion.getTooltip() != null) {
if (suggestion.getTooltip() instanceof VelocityBrigadierMessage velocityMessage) {
tooltip = new ComponentHolder(player.getProtocolVersion(),
velocityMessage.asComponent());
} else {
tooltip = new ComponentHolder(player.getProtocolVersion(),
Component.text(suggestion.getTooltip().getString()));
}
}
offers.add(new Offer(offer, tooltip));
}