Skip to content

Commit

Permalink
Moved exception throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nan1t committed Jan 28, 2022
1 parent 9670aee commit c914a49
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ public PacketSnapshot encodePacket() {
@Override
public void encode(ByteMessage msg, Version version) {
Version mapped = mappings.get(version);

if (mapped == null)
throw new IllegalArgumentException("No mapped version is for " + version);

byte[] message = versionMessages.get(mapped);

if (message != null)
msg.writeBytes(message);
else
throw new IllegalArgumentException("No mappings for version " + version);
}

@Override
Expand Down

0 comments on commit c914a49

Please sign in to comment.