Moved exception throwing

This commit is contained in:
Nanit 2022-01-28 16:11:36 +02:00
parent 9670aeecbe
commit c914a494e8

View File

@ -70,14 +70,12 @@ public class PacketSnapshot implements PacketOut {
@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