Convert version string to pack_format When making a Minecraft data/resource pack, you need to include a pack.mcmeta file, which specifies information about it. pack.mcmeta contains a description, but it also contains a pack_format number, which tells Minecraft which versions this pack is for.
Your task is to take a version string, and output what pack_format number matches the string.
Your input must be a string, and you can assume it's either 1.x or 1.x.y.
As of when this challenge was posted, the conversion goes like so:
1.6.1 - 1.8.9 -&gt; 1
1.9 - 1.10.2 -&gt; 2
1.11 - 1.12.2 -&gt; 3
1.13 - 1.14.4 -&gt; 4
1.15 - 1.16.1 -&gt; 5
1.16.2 - 1.16.5 -&gt; 6
1.17 -&gt; 7

These are all the possible inputs, and what they need to be mapped to:
1.6.1 -&gt; 1
1.6.2 -&gt; 1
1.6.4 -&gt; 1
1.7.2 -&gt; 1
1.7.4 -&gt; 1
1.7.5 -&gt; 1
1.7.6 -&gt; 1
1.7.7 -&gt; 1
1.7.8 -&gt; 1
1.7.9 -&gt; 1
1.7.10 -&gt; 1
1.8 -&gt; 1
1.8.1 -&gt; 1
1.8.2 -&gt; 1
1.8.3 -&gt; 1
1.8.4 -&gt; 1
1.8.5 -&gt; 1
1.8.6 -&gt; 1
1.8.7 -&gt; 1
1.8.8 -&gt; 1
1.8.9 -&gt; 1
1.9 -&gt; 2
1.9.1 -&gt; 2
1.9.2 -&gt; 2
1.9.3 -&gt; 2
1.9.4 -&gt; 2
1.10 -&gt; 2
1.10.1 -&gt; 2
1.10.2 -&gt; 2
1.11 -&gt; 3
1.11.1 -&gt; 3
1.11.2 -&gt; 3
1.12 -&gt; 3
1.12.1 -&gt; 3
1.12.2 -&gt; 3
1.13.1 -&gt; 4
1.13.2 -&gt; 4
1.14 -&gt; 4
1.14.1 -&gt; 4
1.14.2 -&gt; 4
1.14.3 -&gt; 4
1.14.4 -&gt; 4
1.15 -&gt; 5
1.15.1 -&gt; 5
1.15.2 -&gt; 5
1.16 -&gt; 5
1.16.1 -&gt; 5
1.16.2 -&gt; 6
1.16.3 -&gt; 6
1.16.4 -&gt; 6
1.16.5 -&gt; 6
1.17 -&gt; 7

This is code golf, so the shortest answer wins. Good luck!
JavaScript (ES6),  43  42 bytes

s=&gt;([,x,y]=s.split`.`,x*x+x*3+~~y)/51^x&gt;16

Try it online!
How?
Given an input string 1.x.y, we compute:
$$\left\lfloor\frac{x^2+3x+y}{51}\right\rfloor$$
Because we're using ~~y, we implicitly assume \$y=0\$ if the input string is just 1.x.
This gives the correct result for all versions except the last one, which gives \$6\$ instead of \$7\$. This is fixed by XOR'ing with \$1\$ if \$x&gt;16\$.