├── README.md ├── SeedFinder.java └── out.txt /README.md: -------------------------------------------------------------------------------- 1 | # minecraft-diagonal-seed-finder 2 | Finds Minecraft 1.15 seeds which make the decorations in nearby chunks repeat. 3 | You can find more information [on Matthew's youtube channel](https://www.youtube.com/watch?v=UtNXUMrSIxQ). 4 | 5 | ## Building and Running 6 | As this code is just a single `.java` file, you should be able to build with this line. 7 | ```sh 8 | $ javac SeedFinder.java 9 | ``` 10 | You can run it with this line. 11 | ```sh 12 | $ java SeedFinder > out.txt 13 | ``` 14 | This should produce the output in a file called `out.txt`. 15 | 16 | The output file is also already precomputed and included in the repository, in case you just want the seeds without running the code. 17 | 18 | ## Output Format 19 | Each line of the output has a seed, then the direction that the seed's decorator repeats. Due to the way the code searches for seeds, the only directions produced will be `-1 1` and `1 1`. 20 | 21 | Because of the way minecraft seeds the game, all seeds that have the same least significant 48 bits have the same decorator behavior. This code only outputs seeds from 0 <= x < 2^48, so if you need more seeds with the same decorator properties, you can use other 64 bit numbers that have the same least significant 64 bits as any of the seeds in `out.txt`. 22 | -------------------------------------------------------------------------------- /SeedFinder.java: -------------------------------------------------------------------------------- 1 | import java.util.Random; 2 | public class SeedFinder { 3 | public static void main (String[] args) { 4 | long mask = (1L <<31)-1; 5 | for (long i = 0; i < 2*65536; i++) { 6 | long b = ((205749139540585L*i + 277363943098L) >> 17) & mask; 7 | // case where 8u = 201793413 * -b 8 | if ((b & 7) == 0) { 9 | long u = ((201793413 * -b) & mask) >> 3; 10 | for (long j = 0; j < 8; j++) { 11 | convertToSeed(i, u + (j << 28)); 12 | } 13 | } 14 | // case where 2u = 606856477 * (-b -1) 15 | else if ((b & 1) == 1) { 16 | long u = ((606856477 * (-b -1)) & mask) >> 1; 17 | convertToSeed(i, u); 18 | convertToSeed(i, u + (1 << 30)); 19 | } 20 | }//50780870847 11622054337284 21 | } 22 | public static void convertToSeed(long i, long u) { 23 | int blocks = 16; 24 | long seed = (u << 17) + i; 25 | seed = 254681119335897L * seed + 120305458776662L; 26 | seed ^= 0x5deece66dL; 27 | seed &= ((1L << 48)-1); 28 | Random r = new Random(seed); 29 | long a = r.nextLong() | 1; 30 | long b = r.nextLong() | 1; 31 | if (((blocks*a+blocks*b) & ((1L << 48)-1))==0) { 32 | System.out.println(seed + " 1 1"); 33 | } else if (((blocks*a-blocks*b) & ((1L << 48)-1))==0) { 34 | System.out.println(seed + " -1 1"); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /out.txt: -------------------------------------------------------------------------------- 1 | 102496288339226 1 1 2 | 243233776694554 1 1 3 | 25503018638468 1 1 4 | 166240506993796 1 1 5 | 194863804823673 1 1 6 | 54126316468345 1 1 7 | 180285425070967 1 1 8 | 39547936715639 1 1 9 | 229379390903807 1 1 10 | 88641902548479 1 1 11 | 11631417851241 1 1 12 | 152368906206569 1 1 13 | 278457215087719 1 1 14 | 137719726732391 1 1 15 | 74811678275130 -1 1 16 | 109996050363962 -1 1 17 | 145180422452794 -1 1 18 | 180364794541626 -1 1 19 | 215549166630458 -1 1 20 | 250733538719290 -1 1 21 | 4442934097466 -1 1 22 | 39627306186298 -1 1 23 | 60743603216145 1 1 24 | 201481091571473 1 1 25 | 74753121498560 1 1 26 | 215490609853888 1 1 27 | 225951381575532 -1 1 28 | 261135753664364 -1 1 29 | 14845149042540 -1 1 30 | 50029521131372 -1 1 31 | 85213893220204 -1 1 32 | 120398265309036 -1 1 33 | 155582637397868 -1 1 34 | 190767009486700 -1 1 35 | 123866381128776 1 1 36 | 264603869484104 1 1 37 | 187592346697722 1 1 38 | 46854858342394 1 1 39 | 172961353594608 1 1 40 | 32223865239280 1 1 41 | 60829983200677 1 1 42 | 201567471556005 1 1 43 | 236703458319970 1 1 44 | 95965969964642 1 1 45 | 43099331928968 -1 1 46 | 78283704017800 -1 1 47 | 113468076106632 -1 1 48 | 148652448195464 -1 1 49 | 183836820284296 -1 1 50 | 219021192373128 -1 1 51 | 254205564461960 -1 1 52 | 7914959840136 -1 1 53 | 194239033000162 -1 1 54 | 229423405088994 -1 1 55 | 264607777177826 -1 1 56 | 18317172556002 -1 1 57 | 53501544644834 -1 1 58 | 88685916733666 -1 1 59 | 123870288822498 -1 1 60 | 159054660911330 -1 1 61 | 159072574510805 1 1 62 | 18335086155477 1 1 63 | 82025653894727 1 1 64 | 222763142250055 1 1 --------------------------------------------------------------------------------