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 io.netty.buffer.ByteBuf;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.kyori.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.text.serializer.gson.GsonComponentSerializer;
|
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
||||||
public class TabCompleteResponse implements MinecraftPacket {
|
public class TabCompleteResponse implements MinecraftPacket {
|
||||||
@ -68,8 +67,8 @@ public class TabCompleteResponse implements MinecraftPacket {
|
|||||||
int offersAvailable = ProtocolUtils.readVarInt(buf);
|
int offersAvailable = ProtocolUtils.readVarInt(buf);
|
||||||
for (int i = 0; i < offersAvailable; i++) {
|
for (int i = 0; i < offersAvailable; i++) {
|
||||||
String offer = ProtocolUtils.readString(buf);
|
String offer = ProtocolUtils.readString(buf);
|
||||||
Component tooltip = buf.readBoolean() ? GsonComponentSerializer.INSTANCE.deserialize(
|
Component tooltip = buf.readBoolean() ? ProtocolUtils.getJsonChatSerializer(version)
|
||||||
ProtocolUtils.readString(buf)) : null;
|
.deserialize(ProtocolUtils.readString(buf)) : null;
|
||||||
offers.add(new Offer(offer, tooltip));
|
offers.add(new Offer(offer, tooltip));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -91,7 +90,8 @@ public class TabCompleteResponse implements MinecraftPacket {
|
|||||||
ProtocolUtils.writeString(buf, offer.text);
|
ProtocolUtils.writeString(buf, offer.text);
|
||||||
buf.writeBoolean(offer.tooltip != null);
|
buf.writeBoolean(offer.tooltip != null);
|
||||||
if (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 {
|
} else {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren