Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.50 KB | None | 0 0
  1. package net.minecraft.server;
  2.  
  3. import java.util.Random;
  4.  
  5. public class BiomeDecorator {
  6.  
  7. protected World a;
  8. protected Random b;
  9. protected int c;
  10. protected int d;
  11. protected WorldGenerator e = new WorldGenClay(4);
  12. protected WorldGenerator f;
  13. protected WorldGenerator g;
  14. protected WorldGenerator h;
  15. protected WorldGenerator i;
  16. protected WorldGenerator j;
  17. protected WorldGenerator k;
  18. protected WorldGenerator l;
  19. protected WorldGenerator m;
  20. protected WorldGenerator n;
  21. protected WorldGenerator o;
  22. protected WorldGenFlowers p;
  23. protected WorldGenerator q;
  24. protected WorldGenerator r;
  25. protected WorldGenerator s;
  26. protected WorldGenerator t;
  27. protected WorldGenerator u;
  28. protected WorldGenerator v;
  29. protected WorldGenerator sylvanite;
  30. protected WorldGenerator fluorite;
  31. protected WorldGenerator axinite;
  32. protected WorldGenerator zentium;
  33. protected int w;
  34. protected int x;
  35. protected int y;
  36. protected int z;
  37. protected int A;
  38. protected int B;
  39. protected int C;
  40. protected int D;
  41. protected int E;
  42. protected int F;
  43. protected int G;
  44. protected int H;
  45. public boolean I;
  46.  
  47. public BiomeDecorator() {
  48. this.f = new WorldGenSand(Blocks.SAND, 7);
  49. this.g = new WorldGenSand(Blocks.GRAVEL, 6);
  50. this.h = new WorldGenMinable(Blocks.DIRT, 32);
  51. this.i = new WorldGenMinable(Blocks.GRAVEL, 32);
  52. this.j = new WorldGenMinable(Blocks.COAL_ORE, 16);
  53. this.k = new WorldGenMinable(Blocks.IRON_ORE, 8);
  54. this.l = new WorldGenMinable(Blocks.GOLD_ORE, 8);
  55. this.m = new WorldGenMinable(Blocks.REDSTONE_ORE, 7);
  56. this.n = new WorldGenMinable(Blocks.DIAMOND_ORE, 7);
  57. this.o = new WorldGenMinable(Blocks.LAPIS_ORE, 6);
  58. this.p = new WorldGenFlowers(Blocks.YELLOW_FLOWER);
  59. this.q = new WorldGenFlowers(Blocks.BROWN_MUSHROOM);
  60. this.r = new WorldGenFlowers(Blocks.RED_MUSHROOM);
  61. this.s = new WorldGenHugeMushroom();
  62. this.t = new WorldGenReed();
  63. this.u = new WorldGenCactus();
  64. this.v = new WorldGenWaterLily();
  65. this.sylvanite = new WorldGenMinable(Blocks.SYLVANITE_ORE, 3);
  66. this.fluorite = new WorldGenMinable(Blocks.FLUORITE_ORE, 3);
  67. this.axinite = new WorldGenMinable(Blocks.AXINITE_ORE, 3);
  68. this.zentium = new WorldGenMinable(Blocks.ZENTIUM_ORE, 3);
  69. this.y = 2;
  70. this.z = 1;
  71. this.E = 1;
  72. this.F = 3;
  73. this.G = 1;
  74. this.I = true;
  75. }
  76.  
  77. public void a(World world, Random random, BiomeBase biomebase, int i, int j) {
  78. if (this.a != null) {
  79. throw new RuntimeException("Already decorating!!");
  80. } else {
  81. this.a = world;
  82. this.b = random;
  83. this.c = i;
  84. this.d = j;
  85. this.a(biomebase);
  86. this.a = null;
  87. this.b = null;
  88. }
  89. }
  90.  
  91. protected void a(BiomeBase biomebase) {
  92. this.a();
  93.  
  94. int i;
  95. int j;
  96. int k;
  97.  
  98. for (i = 0; i < this.F; ++i) {
  99. j = this.c + this.b.nextInt(16) + 8;
  100. k = this.d + this.b.nextInt(16) + 8;
  101. this.f.generate(this.a, this.b, j, this.a.i(j, k), k);
  102. }
  103.  
  104. for (i = 0; i < this.G; ++i) {
  105. j = this.c + this.b.nextInt(16) + 8;
  106. k = this.d + this.b.nextInt(16) + 8;
  107. this.e.generate(this.a, this.b, j, this.a.i(j, k), k);
  108. }
  109.  
  110. for (i = 0; i < this.E; ++i) {
  111. j = this.c + this.b.nextInt(16) + 8;
  112. k = this.d + this.b.nextInt(16) + 8;
  113. this.g.generate(this.a, this.b, j, this.a.i(j, k), k);
  114. }
  115.  
  116. i = this.x;
  117. if (this.b.nextInt(10) == 0) {
  118. ++i;
  119. }
  120.  
  121. int l;
  122. int i1;
  123.  
  124. for (j = 0; j < i; ++j) {
  125. k = this.c + this.b.nextInt(16) + 8;
  126. l = this.d + this.b.nextInt(16) + 8;
  127. i1 = this.a.getHighestBlockYAt(k, l);
  128. WorldGenTreeAbstract worldgentreeabstract = biomebase.a(this.b);
  129.  
  130. worldgentreeabstract.a(1.0D, 1.0D, 1.0D);
  131. if (worldgentreeabstract.generate(this.a, this.b, k, i1, l)) {
  132. worldgentreeabstract.b(this.a, this.b, k, i1, l);
  133. }
  134. }
  135.  
  136. for (j = 0; j < this.H; ++j) {
  137. k = this.c + this.b.nextInt(16) + 8;
  138. l = this.d + this.b.nextInt(16) + 8;
  139. this.s.generate(this.a, this.b, k, this.a.getHighestBlockYAt(k, l), l);
  140. }
  141.  
  142. for (j = 0; j < this.y; ++j) {
  143. k = this.c + this.b.nextInt(16) + 8;
  144. l = this.d + this.b.nextInt(16) + 8;
  145. i1 = this.b.nextInt(this.a.getHighestBlockYAt(k, l) + 32);
  146. String s = biomebase.a(this.b, k, i1, l);
  147. BlockFlowers blockflowers = BlockFlowers.e(s);
  148.  
  149. if (blockflowers.getMaterial() != Material.AIR) {
  150. this.p.a(blockflowers, BlockFlowers.f(s));
  151. this.p.generate(this.a, this.b, k, i1, l);
  152. }
  153. }
  154.  
  155. for (j = 0; j < this.z; ++j) {
  156. k = this.c + this.b.nextInt(16) + 8;
  157. l = this.d + this.b.nextInt(16) + 8;
  158. i1 = this.b.nextInt(this.getHighestBlockYAt(k, l) * 2); // Spigot
  159. WorldGenerator worldgenerator = biomebase.b(this.b);
  160.  
  161. worldgenerator.generate(this.a, this.b, k, i1, l);
  162. }
  163.  
  164. for (j = 0; j < this.A; ++j) {
  165. k = this.c + this.b.nextInt(16) + 8;
  166. l = this.d + this.b.nextInt(16) + 8;
  167. i1 = this.b.nextInt(this.getHighestBlockYAt(k, l) * 2); // Spigot
  168. (new WorldGenDeadBush(Blocks.DEAD_BUSH)).generate(this.a, this.b, k, i1, l);
  169. }
  170.  
  171. for (j = 0; j < this.w; ++j) {
  172. k = this.c + this.b.nextInt(16) + 8;
  173. l = this.d + this.b.nextInt(16) + 8;
  174.  
  175. for (i1 = this.b.nextInt(this.getHighestBlockYAt(k, l) * 2); i1 > 0 && this.a.isEmpty(k, i1 - 1, l); --i1) { // Spigot
  176. ;
  177. }
  178.  
  179. this.v.generate(this.a, this.b, k, i1, l);
  180. }
  181.  
  182. for (j = 0; j < this.B; ++j) {
  183. if (this.b.nextInt(4) == 0) {
  184. k = this.c + this.b.nextInt(16) + 8;
  185. l = this.d + this.b.nextInt(16) + 8;
  186. i1 = this.a.getHighestBlockYAt(k, l);
  187. this.q.generate(this.a, this.b, k, i1, l);
  188. }
  189.  
  190. if (this.b.nextInt(8) == 0) {
  191. k = this.c + this.b.nextInt(16) + 8;
  192. l = this.d + this.b.nextInt(16) + 8;
  193. i1 = this.b.nextInt(this.getHighestBlockYAt(k, l) * 2); // Spigot
  194. this.r.generate(this.a, this.b, k, i1, l);
  195. }
  196. }
  197.  
  198. if (this.b.nextInt(4) == 0) {
  199. j = this.c + this.b.nextInt(16) + 8;
  200. k = this.d + this.b.nextInt(16) + 8;
  201. l = this.b.nextInt(this.getHighestBlockYAt(j, k) * 2); // Spigot
  202. this.q.generate(this.a, this.b, j, l, k);
  203. }
  204.  
  205. if (this.b.nextInt(8) == 0) {
  206. j = this.c + this.b.nextInt(16) + 8;
  207. k = this.d + this.b.nextInt(16) + 8;
  208. l = this.b.nextInt(this.getHighestBlockYAt(j, k) * 2); // Spigot
  209. this.r.generate(this.a, this.b, j, l, k);
  210. }
  211.  
  212. for (j = 0; j < this.C; ++j) {
  213. k = this.c + this.b.nextInt(16) + 8;
  214. l = this.d + this.b.nextInt(16) + 8;
  215. i1 = this.b.nextInt(this.getHighestBlockYAt(k, l) * 2); // Spigot
  216. this.t.generate(this.a, this.b, k, i1, l);
  217. }
  218.  
  219. for (j = 0; j < 10; ++j) {
  220. k = this.c + this.b.nextInt(16) + 8;
  221. l = this.d + this.b.nextInt(16) + 8;
  222. i1 = this.b.nextInt(this.getHighestBlockYAt(k, l) * 2); // Spigot
  223. this.t.generate(this.a, this.b, k, i1, l);
  224. }
  225.  
  226. if (this.b.nextInt(32) == 0) {
  227. j = this.c + this.b.nextInt(16) + 8;
  228. k = this.d + this.b.nextInt(16) + 8;
  229. l = this.b.nextInt(this.getHighestBlockYAt(j, k) * 2); // Spigot
  230. (new WorldGenPumpkin()).generate(this.a, this.b, j, l, k);
  231. }
  232.  
  233. for (j = 0; j < this.D; ++j) {
  234. k = this.c + this.b.nextInt(16) + 8;
  235. l = this.d + this.b.nextInt(16) + 8;
  236. i1 = this.b.nextInt(this.getHighestBlockYAt(k, l) * 2); // Spigot
  237. this.u.generate(this.a, this.b, k, i1, l);
  238. }
  239.  
  240. if (this.I) {
  241. for (j = 0; j < 50; ++j) {
  242. k = this.c + this.b.nextInt(16) + 8;
  243. l = this.b.nextInt(this.b.nextInt(248) + 8);
  244. i1 = this.d + this.b.nextInt(16) + 8;
  245. (new WorldGenLiquids(Blocks.WATER)).generate(this.a, this.b, k, l, i1);
  246. }
  247.  
  248. for (j = 0; j < 20; ++j) {
  249. k = this.c + this.b.nextInt(16) + 8;
  250. l = this.b.nextInt(this.b.nextInt(this.b.nextInt(240) + 8) + 8);
  251. i1 = this.d + this.b.nextInt(16) + 8;
  252. (new WorldGenLiquids(Blocks.LAVA)).generate(this.a, this.b, k, l, i1);
  253. }
  254. }
  255. }
  256.  
  257. protected void a(int i, WorldGenerator worldgenerator, int j, int k) {
  258. for (int l = 0; l < i; ++l) {
  259. int i1 = this.c + this.b.nextInt(16);
  260. int j1 = this.b.nextInt(k - j) + j;
  261. int k1 = this.d + this.b.nextInt(16);
  262.  
  263. worldgenerator.generate(this.a, this.b, i1, j1, k1);
  264. }
  265. }
  266.  
  267. protected void b(int i, WorldGenerator worldgenerator, int j, int k) {
  268. for (int l = 0; l < i; ++l) {
  269. int i1 = this.c + this.b.nextInt(16);
  270. int j1 = this.b.nextInt(k) + this.b.nextInt(k) + (j - k);
  271. int k1 = this.d + this.b.nextInt(16);
  272.  
  273. worldgenerator.generate(this.a, this.b, i1, j1, k1);
  274. }
  275. }
  276.  
  277. protected void a() {
  278. this.a(20, this.h, 0, 256);
  279. this.a(10, this.i, 0, 256);
  280. this.a(20, this.j, 0, 128);
  281. this.a(20, this.k, 0, 64);
  282. this.a(2, this.l, 0, 32);
  283. this.a(10, this.m, 0, 16);
  284. this.a(1, this.n, 0, 24);
  285. this.a(2, this.sylvanite, 0, 16);
  286. this.a(1, this.fluorite, 0, 12);
  287. this.a(1, this.axinite, 0, 12);
  288. this.a(1, this.zentium, 0, 12);
  289. this.b(1, this.o, 16, 16);
  290. }
  291.  
  292. // Spigot Start
  293. private int getHighestBlockYAt(int x, int z)
  294. {
  295. return Math.max( 1, this.a.getHighestBlockYAt( x, z ) );
  296. }
  297. // Spigot End
  298. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement