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()) {
|
for (Suggestion suggestion : suggestions.getList()) {
|
||||||
String offer = suggestion.getText();
|
String offer = suggestion.getText();
|
||||||
ComponentHolder tooltip = null;
|
ComponentHolder tooltip = null;
|
||||||
if (suggestion.getTooltip() != null
|
if (suggestion.getTooltip() != null) {
|
||||||
&& suggestion.getTooltip() instanceof VelocityBrigadierMessage) {
|
if (suggestion.getTooltip() instanceof VelocityBrigadierMessage velocityMessage) {
|
||||||
tooltip = new ComponentHolder(player.getProtocolVersion(),
|
tooltip = new ComponentHolder(player.getProtocolVersion(),
|
||||||
((VelocityBrigadierMessage) suggestion.getTooltip()).asComponent());
|
velocityMessage.asComponent());
|
||||||
|
} else {
|
||||||
|
tooltip = new ComponentHolder(player.getProtocolVersion(),
|
||||||
|
Component.text(suggestion.getTooltip().getString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
offers.add(new Offer(offer, tooltip));
|
offers.add(new Offer(offer, tooltip));
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren