Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
Add missing nullability annotation
Dieser Commit ist enthalten in:
Ursprung
0af9d9d77b
Commit
e65c4102a6
@ -42,7 +42,12 @@ public class ServerboundLoginPluginResponsePacket extends DefaultByteBufHolder i
|
||||
}
|
||||
return new ServerboundLoginPluginResponsePacket(id, success, data);
|
||||
};
|
||||
public static final PacketWriter<ServerboundLoginPluginResponsePacket> ENCODER = PacketWriter.deprecatedEncode();
|
||||
public static final PacketWriter<ServerboundLoginPluginResponsePacket> ENCODER =
|
||||
(out, packet, version) -> {
|
||||
ProtocolUtils.writeVarInt(out, packet.id);
|
||||
out.writeBoolean(packet.success);
|
||||
out.writeBytes(packet.content());
|
||||
};
|
||||
|
||||
private final int id;
|
||||
private final boolean success;
|
||||
@ -53,13 +58,6 @@ public class ServerboundLoginPluginResponsePacket extends DefaultByteBufHolder i
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encode(ByteBuf buf, ProtocolVersion version) {
|
||||
ProtocolUtils.writeVarInt(buf, id);
|
||||
buf.writeBoolean(success);
|
||||
buf.writeBytes(content());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(PacketHandler handler) {
|
||||
return handler.handle(this);
|
||||
|
@ -31,6 +31,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import io.netty.handler.codec.CorruptedFrameException;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public class MinecraftDecoder extends ChannelInboundHandlerAdapter {
|
||||
|
||||
@ -96,7 +97,7 @@ public class MinecraftDecoder extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
private Packet readPacket(int packetId, ByteBuf buf) throws Exception {
|
||||
private @Nullable Packet readPacket(int packetId, ByteBuf buf) throws Exception {
|
||||
PacketReader<? extends Packet> reader = this.registry.lookupReader(packetId, this.version);
|
||||
if (reader == null) {
|
||||
return null;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren