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:
Ursprung
9d25d309d3
Commit
fcac93fd25
@ -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));
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren