diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginMessage.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginMessage.java index 395efe5ea..1b9e61037 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginMessage.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginMessage.java @@ -49,7 +49,7 @@ public class LoginPluginMessage implements MinecraftPacket { this.id = ProtocolUtils.readVarInt(buf); this.channel = ProtocolUtils.readString(buf); if (buf.isReadable()) { - this.data = buf.readRetainedSlice(buf.readableBytes()); + this.data = buf.readSlice(buf.readableBytes()); } else { this.data = Unpooled.EMPTY_BUFFER; } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginResponse.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginResponse.java index ce532cbd1..6ff252cfe 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginResponse.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginResponse.java @@ -49,7 +49,7 @@ public class LoginPluginResponse implements MinecraftPacket { this.id = ProtocolUtils.readVarInt(buf); this.success = buf.readBoolean(); if (buf.isReadable()) { - this.data = buf.readRetainedSlice(buf.readableBytes()); + this.data = buf.readSlice(buf.readableBytes()); } else { this.data = Unpooled.EMPTY_BUFFER; } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteResponse.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteResponse.java index df80fb626..f5464360c 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteResponse.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteResponse.java @@ -5,8 +5,8 @@ import com.velocitypowered.proxy.protocol.ProtocolConstants; import com.velocitypowered.proxy.protocol.ProtocolUtils; import io.netty.buffer.ByteBuf; import net.kyori.text.Component; -import net.kyori.text.TextComponent; import net.kyori.text.serializer.ComponentSerializers; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.List; @@ -104,7 +104,7 @@ public class TabCompleteResponse implements MinecraftPacket { private final String entry; private final Component tooltip; - public Offer(String entry, Component tooltip) { + public Offer(String entry, @Nullable Component tooltip) { this.entry = entry; this.tooltip = tooltip; } @@ -113,7 +113,7 @@ public class TabCompleteResponse implements MinecraftPacket { return entry; } - public Component getTooltip() { + public @Nullable Component getTooltip() { return tooltip; }