Clean ups around the codebase.

This commit is contained in:
Andrew Steinborn
2018-08-27 00:24:58 -04:00
parent c7469ec13c
commit b5ebb4541f
3 changed files with 5 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}