Fix annotations

This commit is contained in:
AlexProgrammerDE 2023-12-31 10:53:57 +01:00
parent c8a023c4f0
commit 3e307e5311
2 changed files with 3 additions and 2 deletions
src/main/java/com/github/steveice10/mc/protocol

View file

@ -242,7 +242,7 @@ public class MinecraftCodecHelper extends BasePacketCodecHelper {
return new ItemStack(item, buf.readByte(), this.readAnyTag(buf));
}
public void writeItemStack(ByteBuf buf, ItemStack item) throws IOException {
public void writeItemStack(ByteBuf buf, @Nullable ItemStack item) throws IOException {
buf.writeBoolean(item != null);
if (item != null) {
this.writeVarInt(buf, item.getId());

View file

@ -8,6 +8,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import lombok.With;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.io.IOException;
@ -16,7 +17,7 @@ import java.io.IOException;
@AllArgsConstructor
public class ServerboundSetCreativeModeSlotPacket implements MinecraftPacket {
private final int slot;
private final ItemStack clickedItem;
private final @Nullable ItemStack clickedItem;
public ServerboundSetCreativeModeSlotPacket(ByteBuf in, MinecraftCodecHelper helper) throws IOException {
this.slot = in.readShort();