geforkt von Mirrors/Velocity
Fix TabCompleteResponse not using Adventure to read tooltips.
Dieser Commit ist enthalten in:
Ursprung
911aba1b45
Commit
4ccbb2cde2
@ -10,8 +10,7 @@ import com.velocitypowered.proxy.protocol.ProtocolUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.kyori.text.Component;
|
||||
import net.kyori.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public class TabCompleteResponse implements MinecraftPacket {
|
||||
@ -68,8 +67,8 @@ public class TabCompleteResponse implements MinecraftPacket {
|
||||
int offersAvailable = ProtocolUtils.readVarInt(buf);
|
||||
for (int i = 0; i < offersAvailable; i++) {
|
||||
String offer = ProtocolUtils.readString(buf);
|
||||
Component tooltip = buf.readBoolean() ? GsonComponentSerializer.INSTANCE.deserialize(
|
||||
ProtocolUtils.readString(buf)) : null;
|
||||
Component tooltip = buf.readBoolean() ? ProtocolUtils.getJsonChatSerializer(version)
|
||||
.deserialize(ProtocolUtils.readString(buf)) : null;
|
||||
offers.add(new Offer(offer, tooltip));
|
||||
}
|
||||
} else {
|
||||
@ -91,7 +90,8 @@ public class TabCompleteResponse implements MinecraftPacket {
|
||||
ProtocolUtils.writeString(buf, offer.text);
|
||||
buf.writeBoolean(offer.tooltip != null);
|
||||
if (offer.tooltip != null) {
|
||||
ProtocolUtils.writeString(buf, GsonComponentSerializer.INSTANCE.serialize(offer.tooltip));
|
||||
ProtocolUtils.writeString(buf, ProtocolUtils.getJsonChatSerializer(version)
|
||||
.serialize(offer.tooltip));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren