diff --git a/src/main/java/net/minestom/server/network/packet/client/ClientPacket.java b/src/main/java/net/minestom/server/network/packet/client/ClientPacket.java index b7b81d02e..62564b4f4 100644 --- a/src/main/java/net/minestom/server/network/packet/client/ClientPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/ClientPacket.java @@ -1,9 +1,10 @@ package net.minestom.server.network.packet.client; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public interface ClientPacket { - void read(BinaryReader reader); + void read(@NotNull BinaryReader reader); } diff --git a/src/main/java/net/minestom/server/network/packet/client/handshake/HandshakePacket.java b/src/main/java/net/minestom/server/network/packet/client/handshake/HandshakePacket.java index 7f9ceb15c..9b240405d 100644 --- a/src/main/java/net/minestom/server/network/packet/client/handshake/HandshakePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/handshake/HandshakePacket.java @@ -24,7 +24,7 @@ public class HandshakePacket implements ClientPreplayPacket { private int nextState; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.protocolVersion = reader.readVarInt(); this.serverAddress = reader.readSizedString(); this.serverPort = reader.readUnsignedShort(); diff --git a/src/main/java/net/minestom/server/network/packet/client/login/EncryptionResponsePacket.java b/src/main/java/net/minestom/server/network/packet/client/login/EncryptionResponsePacket.java index b64e9d71a..084dbdf51 100644 --- a/src/main/java/net/minestom/server/network/packet/client/login/EncryptionResponsePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/login/EncryptionResponsePacket.java @@ -76,7 +76,7 @@ public class EncryptionResponsePacket implements ClientPreplayPacket { } @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { sharedSecret = ByteArrayData.decodeByteArray(reader); verifyToken = ByteArrayData.decodeByteArray(reader); } diff --git a/src/main/java/net/minestom/server/network/packet/client/login/LoginStartPacket.java b/src/main/java/net/minestom/server/network/packet/client/login/LoginStartPacket.java index 317f60813..733815319 100644 --- a/src/main/java/net/minestom/server/network/packet/client/login/LoginStartPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/login/LoginStartPacket.java @@ -54,7 +54,7 @@ public class LoginStartPacket implements ClientPreplayPacket { } @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.username = reader.readSizedString(); } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientAdvancementTabPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientAdvancementTabPacket.java index 8fe71a9cf..578e6d1e0 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientAdvancementTabPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientAdvancementTabPacket.java @@ -3,6 +3,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.advancements.AdvancementAction; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientAdvancementTabPacket extends ClientPlayPacket { @@ -10,7 +11,7 @@ public class ClientAdvancementTabPacket extends ClientPlayPacket { public String tabIdentifier; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.action = AdvancementAction.values()[reader.readVarInt()]; if (action == AdvancementAction.OPENED_TAB) { diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientAnimationPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientAnimationPacket.java index 4647f7e1a..9623f8d1c 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientAnimationPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientAnimationPacket.java @@ -3,13 +3,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.entity.Player; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientAnimationPacket extends ClientPlayPacket { public Player.Hand hand; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.hand = Player.Hand.values()[reader.readVarInt()]; } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientChatMessagePacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientChatMessagePacket.java index af407b8bd..f46edaa67 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientChatMessagePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientChatMessagePacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientChatMessagePacket extends ClientPlayPacket { public String message; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.message = reader.readSizedString(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientClickWindowButtonPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientClickWindowButtonPacket.java index e681e2aa6..ccfa19821 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientClickWindowButtonPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientClickWindowButtonPacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientClickWindowButtonPacket extends ClientPlayPacket { @@ -9,7 +10,7 @@ public class ClientClickWindowButtonPacket extends ClientPlayPacket { public byte buttonId; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.windowId = reader.readByte(); this.buttonId = reader.readByte(); } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientClickWindowPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientClickWindowPacket.java index 0ee976971..877efcaba 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientClickWindowPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientClickWindowPacket.java @@ -3,6 +3,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.item.ItemStack; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientClickWindowPacket extends ClientPlayPacket { @@ -14,7 +15,7 @@ public class ClientClickWindowPacket extends ClientPlayPacket { public ItemStack item; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.windowId = reader.readByte(); this.slot = reader.readShort(); this.button = reader.readByte(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientCloseWindow.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientCloseWindow.java index 14b5c9caf..99031529e 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientCloseWindow.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientCloseWindow.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientCloseWindow extends ClientPlayPacket { public int windowId; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.windowId = reader.readVarInt(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientCraftRecipeRequest.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientCraftRecipeRequest.java index 2d238c952..2fbb7d45e 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientCraftRecipeRequest.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientCraftRecipeRequest.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientCraftRecipeRequest extends ClientPlayPacket { @@ -10,7 +11,7 @@ public class ClientCraftRecipeRequest extends ClientPlayPacket { public boolean makeAll; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.windowId = reader.readByte(); this.recipe = reader.readSizedString(); this.makeAll = reader.readBoolean(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientCreativeInventoryActionPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientCreativeInventoryActionPacket.java index 59da51cf6..5a3924c55 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientCreativeInventoryActionPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientCreativeInventoryActionPacket.java @@ -3,6 +3,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.item.ItemStack; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientCreativeInventoryActionPacket extends ClientPlayPacket { @@ -10,7 +11,7 @@ public class ClientCreativeInventoryActionPacket extends ClientPlayPacket { public ItemStack item; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.slot = reader.readShort(); this.item = reader.readSlot(); } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientEntityActionPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientEntityActionPacket.java index 247358f74..99c7690a9 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientEntityActionPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientEntityActionPacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientEntityActionPacket extends ClientPlayPacket { @@ -10,7 +11,7 @@ public class ClientEntityActionPacket extends ClientPlayPacket { public int horseJumpBoost; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.playerId = reader.readVarInt(); this.action = Action.values()[reader.readVarInt()]; this.horseJumpBoost = reader.readVarInt(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientHeldItemChangePacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientHeldItemChangePacket.java index cb2368e9d..42566ef2b 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientHeldItemChangePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientHeldItemChangePacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientHeldItemChangePacket extends ClientPlayPacket { public short slot; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.slot = reader.readShort(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientInteractEntityPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientInteractEntityPacket.java index 23e84079a..62a88b374 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientInteractEntityPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientInteractEntityPacket.java @@ -3,6 +3,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.entity.Player; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientInteractEntityPacket extends ClientPlayPacket { @@ -15,7 +16,7 @@ public class ClientInteractEntityPacket extends ClientPlayPacket { public boolean sneaking; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.targetId = reader.readVarInt(); this.type = Type.values()[reader.readVarInt()]; diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientKeepAlivePacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientKeepAlivePacket.java index 24fbc4a47..658cfda3c 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientKeepAlivePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientKeepAlivePacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientKeepAlivePacket extends ClientPlayPacket { public long id; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.id = reader.readLong(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientNameItemPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientNameItemPacket.java index abd27da24..e94fc69cd 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientNameItemPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientNameItemPacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientNameItemPacket extends ClientPlayPacket { public String itemName; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.itemName = reader.readSizedString(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientPickItemPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientPickItemPacket.java index 6dc0661ee..bf92faf6f 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientPickItemPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientPickItemPacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientPickItemPacket extends ClientPlayPacket { public int slotToUse; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.slotToUse = reader.readVarInt(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerAbilitiesPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerAbilitiesPacket.java index c59d4baa9..9d6f0dcd7 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerAbilitiesPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerAbilitiesPacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientPlayerAbilitiesPacket extends ClientPlayPacket { public byte flags; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.flags = reader.readByte(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerBlockPlacementPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerBlockPlacementPacket.java index d72b4340f..092e4aff3 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerBlockPlacementPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerBlockPlacementPacket.java @@ -5,6 +5,7 @@ import net.minestom.server.instance.block.BlockFace; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.BlockPosition; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientPlayerBlockPlacementPacket extends ClientPlayPacket { @@ -15,7 +16,7 @@ public class ClientPlayerBlockPlacementPacket extends ClientPlayPacket { public boolean insideBlock; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.hand = Player.Hand.values()[reader.readVarInt()]; this.blockPosition = reader.readBlockPosition(); this.blockFace = BlockFace.values()[reader.readVarInt()]; diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerDiggingPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerDiggingPacket.java index 702c4d35c..ff8a5b94c 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerDiggingPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerDiggingPacket.java @@ -4,6 +4,7 @@ import net.minestom.server.instance.block.BlockFace; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.BlockPosition; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientPlayerDiggingPacket extends ClientPlayPacket { @@ -12,7 +13,7 @@ public class ClientPlayerDiggingPacket extends ClientPlayPacket { public BlockFace blockFace; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.status = Status.values()[reader.readVarInt()]; this.blockPosition = reader.readBlockPosition(); this.blockFace = BlockFace.values()[reader.readByte()]; diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPacket.java index dd6c19ce4..d6005d892 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientPlayerPacket extends ClientPlayPacket { public boolean onGround; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.onGround = reader.readBoolean(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPositionAndRotationPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPositionAndRotationPacket.java index ccc238d06..2ca1619cd 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPositionAndRotationPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPositionAndRotationPacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientPlayerPositionAndRotationPacket extends ClientPlayPacket { @@ -10,7 +11,7 @@ public class ClientPlayerPositionAndRotationPacket extends ClientPlayPacket { public boolean onGround; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.x = reader.readDouble(); this.y = reader.readDouble(); this.z = reader.readDouble(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPositionPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPositionPacket.java index 456a02edf..473487d59 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPositionPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerPositionPacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientPlayerPositionPacket extends ClientPlayPacket { @@ -9,7 +10,7 @@ public class ClientPlayerPositionPacket extends ClientPlayPacket { public boolean onGround; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.x = reader.readDouble(); this.y = reader.readDouble(); this.z = reader.readDouble(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerRotationPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerRotationPacket.java index 54ad9a564..88511e1a3 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerRotationPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientPlayerRotationPacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientPlayerRotationPacket extends ClientPlayPacket { @@ -9,7 +10,7 @@ public class ClientPlayerRotationPacket extends ClientPlayPacket { public boolean onGround; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.yaw = reader.readFloat(); this.pitch = reader.readFloat(); this.onGround = reader.readBoolean(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientPluginMessagePacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientPluginMessagePacket.java index a136a858c..4226e4bda 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientPluginMessagePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientPluginMessagePacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientPluginMessagePacket extends ClientPlayPacket { @@ -9,7 +10,7 @@ public class ClientPluginMessagePacket extends ClientPlayPacket { public byte[] data; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.channel = reader.readSizedString(); this.data = reader.getRemainingBytes(); } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientRecipeBookData.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientRecipeBookData.java index f4ee00e37..1b5d0d515 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientRecipeBookData.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientRecipeBookData.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientRecipeBookData extends ClientPlayPacket { @@ -19,7 +20,7 @@ public class ClientRecipeBookData extends ClientPlayPacket { public boolean smokingRecipeFilterActive; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.type = reader.readVarInt(); switch (type) { diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientResourcePackStatusPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientResourcePackStatusPacket.java index 98be3ef53..24af3b126 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientResourcePackStatusPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientResourcePackStatusPacket.java @@ -3,13 +3,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.resourcepack.ResourcePackStatus; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientResourcePackStatusPacket extends ClientPlayPacket { public ResourcePackStatus result; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.result = ResourcePackStatus.values()[reader.readVarInt()]; } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientSelectTradePacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientSelectTradePacket.java index 351ab40ff..70816e642 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientSelectTradePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientSelectTradePacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientSelectTradePacket extends ClientPlayPacket { public int selectedSlot; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.selectedSlot = reader.readVarInt(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientSettingsPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientSettingsPacket.java index e521ea519..0261a9e3d 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientSettingsPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientSettingsPacket.java @@ -3,6 +3,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.entity.Player; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientSettingsPacket extends ClientPlayPacket { @@ -14,7 +15,7 @@ public class ClientSettingsPacket extends ClientPlayPacket { public Player.MainHand mainHand; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.locale = reader.readSizedString(); this.viewDistance = reader.readByte(); this.chatMode = Player.ChatMode.values()[reader.readVarInt()]; diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientSpectatePacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientSpectatePacket.java index d0b9dfe7e..816aa4d91 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientSpectatePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientSpectatePacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; import java.util.UUID; @@ -10,7 +11,7 @@ public class ClientSpectatePacket extends ClientPlayPacket { public UUID targetUuid; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { // TODO reader uuid } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientStatusPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientStatusPacket.java index 6c020cc7b..b60c5237f 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientStatusPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientStatusPacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientStatusPacket extends ClientPlayPacket { public Action action; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.action = Action.values()[reader.readVarInt()]; } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientSteerBoatPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientSteerBoatPacket.java index 4c49d3390..4a0e108ec 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientSteerBoatPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientSteerBoatPacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientSteerBoatPacket extends ClientPlayPacket { @@ -9,7 +10,7 @@ public class ClientSteerBoatPacket extends ClientPlayPacket { public boolean rightPaddleTurning; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.leftPaddleTurning = reader.readBoolean(); this.rightPaddleTurning = reader.readBoolean(); } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientSteerVehiclePacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientSteerVehiclePacket.java index 8332885ca..8e8800efa 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientSteerVehiclePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientSteerVehiclePacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientSteerVehiclePacket extends ClientPlayPacket { @@ -10,7 +11,7 @@ public class ClientSteerVehiclePacket extends ClientPlayPacket { public byte flags; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.sideways = reader.readFloat(); this.forward = reader.readFloat(); this.flags = reader.readByte(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientTabCompletePacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientTabCompletePacket.java index a76f9e7cb..63ed76e2d 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientTabCompletePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientTabCompletePacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientTabCompletePacket extends ClientPlayPacket { @@ -9,7 +10,7 @@ public class ClientTabCompletePacket extends ClientPlayPacket { public String text; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.transactionId = reader.readVarInt(); this.text = reader.readSizedString(); } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientTeleportConfirmPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientTeleportConfirmPacket.java index 30e348efa..ee2156e02 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientTeleportConfirmPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientTeleportConfirmPacket.java @@ -2,13 +2,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientTeleportConfirmPacket extends ClientPlayPacket { public int teleportId; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.teleportId = reader.readVarInt(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateCommandBlockMinecartPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateCommandBlockMinecartPacket.java index 0143e3980..bab3daaeb 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateCommandBlockMinecartPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateCommandBlockMinecartPacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientUpdateCommandBlockMinecartPacket extends ClientPlayPacket { @@ -10,7 +11,7 @@ public class ClientUpdateCommandBlockMinecartPacket extends ClientPlayPacket { public boolean trackOutput; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.entityId = reader.readVarInt(); this.command = reader.readSizedString(); this.trackOutput = reader.readBoolean(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateCommandBlockPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateCommandBlockPacket.java index 3eebc7a17..8ed900824 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateCommandBlockPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateCommandBlockPacket.java @@ -3,6 +3,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.BlockPosition; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientUpdateCommandBlockPacket extends ClientPlayPacket { @@ -12,7 +13,7 @@ public class ClientUpdateCommandBlockPacket extends ClientPlayPacket { public byte flags; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.blockPosition = reader.readBlockPosition(); this.command = reader.readSizedString(); this.mode = Mode.values()[reader.readVarInt()]; diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateSignPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateSignPacket.java index adf0b15b7..972b4d6b0 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateSignPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientUpdateSignPacket.java @@ -3,6 +3,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.BlockPosition; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientUpdateSignPacket extends ClientPlayPacket { @@ -13,7 +14,7 @@ public class ClientUpdateSignPacket extends ClientPlayPacket { public String line4; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.blockPosition = reader.readBlockPosition(); this.line1 = reader.readSizedString(); this.line2 = reader.readSizedString(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientUseItemPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientUseItemPacket.java index 3e30c50d8..5d69915c7 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientUseItemPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientUseItemPacket.java @@ -3,13 +3,14 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.entity.Player; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientUseItemPacket extends ClientPlayPacket { public Player.Hand hand; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.hand = Player.Hand.values()[reader.readVarInt()]; } } diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientVehicleMovePacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientVehicleMovePacket.java index f130d6be8..aa14548a3 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientVehicleMovePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientVehicleMovePacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientVehicleMovePacket extends ClientPlayPacket { @@ -9,7 +10,7 @@ public class ClientVehicleMovePacket extends ClientPlayPacket { public float yaw, pitch; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.x = reader.readDouble(); this.y = reader.readDouble(); this.z = reader.readDouble(); diff --git a/src/main/java/net/minestom/server/network/packet/client/play/ClientWindowConfirmationPacket.java b/src/main/java/net/minestom/server/network/packet/client/play/ClientWindowConfirmationPacket.java index ac205b62e..6b1610593 100644 --- a/src/main/java/net/minestom/server/network/packet/client/play/ClientWindowConfirmationPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/play/ClientWindowConfirmationPacket.java @@ -2,6 +2,7 @@ package net.minestom.server.network.packet.client.play; import net.minestom.server.network.packet.client.ClientPlayPacket; import net.minestom.server.utils.binary.BinaryReader; +import org.jetbrains.annotations.NotNull; public class ClientWindowConfirmationPacket extends ClientPlayPacket { @@ -10,7 +11,7 @@ public class ClientWindowConfirmationPacket extends ClientPlayPacket { public boolean accepted; @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.windowId = reader.readByte(); this.actionNumber = reader.readShort(); this.accepted = reader.readBoolean(); diff --git a/src/main/java/net/minestom/server/network/packet/client/status/LegacyServerListPingPacket.java b/src/main/java/net/minestom/server/network/packet/client/status/LegacyServerListPingPacket.java index 4707e09c6..9093802a5 100644 --- a/src/main/java/net/minestom/server/network/packet/client/status/LegacyServerListPingPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/status/LegacyServerListPingPacket.java @@ -15,7 +15,7 @@ public class LegacyServerListPingPacket implements ClientPreplayPacket { } @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.payload = reader.readByte(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/status/PingPacket.java b/src/main/java/net/minestom/server/network/packet/client/status/PingPacket.java index 63bbf05de..de73d0d44 100644 --- a/src/main/java/net/minestom/server/network/packet/client/status/PingPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/status/PingPacket.java @@ -18,7 +18,7 @@ public class PingPacket implements ClientPreplayPacket { } @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { this.number = reader.readLong(); } } diff --git a/src/main/java/net/minestom/server/network/packet/client/status/StatusRequestPacket.java b/src/main/java/net/minestom/server/network/packet/client/status/StatusRequestPacket.java index b6862d48e..3c3f56494 100644 --- a/src/main/java/net/minestom/server/network/packet/client/status/StatusRequestPacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/status/StatusRequestPacket.java @@ -34,7 +34,7 @@ public class StatusRequestPacket implements ClientPreplayPacket { } @Override - public void read(BinaryReader reader) { + public void read(@NotNull BinaryReader reader) { // Empty } }