Advertisement
Guest User

Untitled

a guest
Nov 11th, 2016
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. /*
  2. Written by ChromeCrusher for finding bases on 2b2t.org
  3.  
  4. This program requires you to know a top-level bedrock pattern.
  5. A chunk-aligned 16x16 pattern (a complete chunk) is preferable and is the fastest method, but it can find any smaller pattern too (it just takes longer)
  6. You could technically search for an area larger than 16x16 (up to 48x48), but it will be slower and the chances of finding two identical 16x16 bedrock patterns is basically zero.
  7. An 8x8 pattern is usually enough to uniquely identify a location with a fairly low chance of false positives.
  8.  
  9. You'll need to know which direction is north. This can be found by looking at the textures of some blocks (cobblestone for example, see http://gaming.stackexchange.com/a/23103)
  10. If you can't find which direction is north, you'll have to search for all 4 rotations of the pattern separately. I did not include a function to do it automatically because I haven't needed it.
  11.  
  12. This program assumes that the chunks being searched were generated in a fairly recent version of Minecraft (probably newer than 1.7)
  13. It will not find 1.3.2 or 1.6.4 chunks, but I don't know exactly when the algorithm changed (it had to do with the structure generation limit changing from y=127 to y=255).
  14.  
  15. It will work on any Minecraft world that uses normal terrain generation (with the version caveat mentioned above)
  16. It will also work regardless of the world seed, since bedrock patterns are the same in every world.
  17.  
  18. This program is standalone and doesn't depend on any Java or Minecraft code.
  19.  
  20. compile with:
  21. gcc bedrock.c -O3 -o bedrock
  22. run with one of the following for the demos:
  23. ./bedrock full
  24. ./bedrock sub
  25. ./bedrock any
  26.  
  27. To change the search pattern, edit one of the arrays below and recompile.
  28. */
  29.  
  30. #include <stdio.h>
  31. #include <stdbool.h>
  32. #include <stdlib.h>
  33. #include <stdint.h>
  34. #include <string.h>
  35. #include <time.h>
  36.  
  37. // the pattern at chunk 123, -456 (real: 1968x, -7296z)
  38. int full_pattern[16*16] = {1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,
  39. 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,
  40. 1,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,
  41. 1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,
  42. 0,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,
  43. 0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,
  44. 0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1,
  45. 0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,
  46. 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
  47. 0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,
  48. 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,
  49. 0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,
  50. 0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,
  51. 0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,
  52. 0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,
  53. 0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0};
  54.  
  55. // a sub pattern of chunk -98, 76 (real: -1568x, 1216x)
  56. int sub_pattern[8*8] = {0,0,1,0,0,0,1,0,
  57. 0,0,0,0,0,0,0,0,
  58. 0,0,1,1,0,0,0,0,
  59. 0,1,1,0,0,0,0,0,
  60. 0,0,0,1,0,0,0,0,
  61. 0,0,0,0,0,1,0,1,
  62. 1,0,0,0,1,0,0,0,
  63. 0,0,1,0,0,1,0,1};
  64.  
  65. // a pattern that is part of 4 different chunks (worse case scenario)
  66. // from chunk 34, -56 (real: 544x, -896z)
  67. int any_pattern[8*8] = {0,0,0,0,0,0,0,0,
  68. 0,0,0,1,0,0,0,0,
  69. 0,1,0,0,0,0,0,0,
  70. 0,0,0,1,0,0,0,0,
  71. 0,1,1,0,0,0,0,0,
  72. 0,0,0,1,1,0,0,0,
  73. 0,0,0,0,0,0,0,0,
  74. 1,0,1,0,0,1,0,0};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement