mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2025-03-14 07:00:03 -04:00
Fix ClientboundSetTitleTextPacket serialization (#781)
This commit is contained in:
parent
eaac051d1f
commit
4b3e86a0b1
1 changed files with 3 additions and 4 deletions
|
@ -2,13 +2,12 @@ package com.github.steveice10.mc.protocol.packet.ingame.clientbound.title;
|
|||
|
||||
import com.github.steveice10.mc.protocol.codec.MinecraftCodecHelper;
|
||||
import com.github.steveice10.mc.protocol.codec.MinecraftPacket;
|
||||
import com.github.steveice10.mc.protocol.data.DefaultComponentSerializer;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.With;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -16,7 +15,7 @@ import java.io.IOException;
|
|||
@With
|
||||
@AllArgsConstructor
|
||||
public class ClientboundSetTitleTextPacket implements MinecraftPacket {
|
||||
private final @Nullable Component text;
|
||||
private final @NonNull Component text;
|
||||
|
||||
public ClientboundSetTitleTextPacket(ByteBuf in, MinecraftCodecHelper helper) throws IOException {
|
||||
this.text = helper.readComponent(in);
|
||||
|
@ -24,6 +23,6 @@ public class ClientboundSetTitleTextPacket implements MinecraftPacket {
|
|||
|
||||
@Override
|
||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) throws IOException {
|
||||
helper.writeString(out, DefaultComponentSerializer.get().serializeOr(this.text, "null"));
|
||||
helper.writeComponent(out, this.text);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue