Guest User

Untitled

a guest
Jul 31st, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.82 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3) braces deadcode
  4.  
  5. package net.minecraft.src;
  6.  
  7. import java.util.Random;
  8.  
  9. // Referenced classes of package net.minecraft.src:
  10. // IChunkProvider, MapGenCaves, NoiseGeneratorOctaves, Block,
  11. // BiomeGenBase, Chunk, World, WorldChunkManager,
  12. // MapGenBase, BlockSand, WorldGenLakes, WorldGenDungeons,
  13. // WorldGenClay, WorldGenMinable, WorldGenerator, WorldGenFlowers,
  14. // BlockFlower, WorldGenTallGrass, BlockTallGrass, WorldGenDeadBush,
  15. // BlockDeadBush, WorldGenReed, WorldGenPumpkin, WorldGenCactus,
  16. // WorldGenLiquids, Material, IProgressUpdate
  17.  
  18. public class ChunkProviderGenerate
  19. implements IChunkProvider
  20. {
  21.  
  22. public ChunkProviderGenerate(World world, long l)
  23. {
  24. sandNoise = new double[256];
  25. gravelNoise = new double[256];
  26. stoneNoise = new double[256];
  27. caveGenerator = new MapGenCaves();
  28. unusedIntArray32x32 = new int[32][32];
  29. worldObj = world;
  30. rand = new Random(l);
  31. field_912_k = new NoiseGeneratorOctaves(rand, 16);
  32. field_911_l = new NoiseGeneratorOctaves(rand, 16);
  33. field_910_m = new NoiseGeneratorOctaves(rand, 8);
  34. field_909_n = new NoiseGeneratorOctaves(rand, 4);
  35. field_908_o = new NoiseGeneratorOctaves(rand, 4);
  36. field_922_a = new NoiseGeneratorOctaves(rand, 10);
  37. field_921_b = new NoiseGeneratorOctaves(rand, 16);
  38. mobSpawnerNoise = new NoiseGeneratorOctaves(rand, 8);
  39. }
  40.  
  41. public void generateTerrain(int i, int j, byte abyte0[], BiomeGenBase abiomegenbase[], double ad[])
  42. {
  43. byte byte0 = 4;
  44. byte byte1 = 64;
  45. int k = byte0 + 1;
  46. byte byte2 = 17;
  47. int l = byte0 + 1;
  48. field_4180_q = func_4061_a(field_4180_q, i * byte0, 0, j * byte0, k, byte2, l);
  49. for(int i1 = 0; i1 < byte0; i1++)
  50. {
  51. for(int j1 = 0; j1 < byte0; j1++)
  52. {
  53. for(int k1 = 0; k1 < 16; k1++)
  54. {
  55. double d = 0.125D;
  56. double d1 = field_4180_q[((i1 + 0) * l + (j1 + 0)) * byte2 + (k1 + 0)];
  57. double d2 = field_4180_q[((i1 + 0) * l + (j1 + 1)) * byte2 + (k1 + 0)];
  58. double d3 = field_4180_q[((i1 + 1) * l + (j1 + 0)) * byte2 + (k1 + 0)];
  59. double d4 = field_4180_q[((i1 + 1) * l + (j1 + 1)) * byte2 + (k1 + 0)];
  60. double d5 = (field_4180_q[((i1 + 0) * l + (j1 + 0)) * byte2 + (k1 + 1)] - d1) * d;
  61. double d6 = (field_4180_q[((i1 + 0) * l + (j1 + 1)) * byte2 + (k1 + 1)] - d2) * d;
  62. double d7 = (field_4180_q[((i1 + 1) * l + (j1 + 0)) * byte2 + (k1 + 1)] - d3) * d;
  63. double d8 = (field_4180_q[((i1 + 1) * l + (j1 + 1)) * byte2 + (k1 + 1)] - d4) * d;
  64. for(int l1 = 0; l1 < 8; l1++)
  65. {
  66. double d9 = 0.25D;
  67. double d10 = d1;
  68. double d11 = d2;
  69. double d12 = (d3 - d1) * d9;
  70. double d13 = (d4 - d2) * d9;
  71. for(int i2 = 0; i2 < 4; i2++)
  72. {
  73. int j2 = i2 + i1 * 4 << 11 | 0 + j1 * 4 << 7 | k1 * 8 + l1;
  74. char c = '\200';
  75. double d14 = 0.25D;
  76. double d15 = d10;
  77. double d16 = (d11 - d10) * d14;
  78. for(int k2 = 0; k2 < 4; k2++)
  79. {
  80. double d17 = ad[(i1 * 4 + i2) * 16 + (j1 * 4 + k2)];
  81. int l2 = 0;
  82. if(k1 * 8 + l1 < byte1)
  83. {
  84. if(d17 < 0.5D && k1 * 8 + l1 >= byte1 - 1)
  85. {
  86. l2 = Block.ice.blockID;
  87. } else
  88. {
  89. l2 = Block.waterStill.blockID;
  90. }
  91. }
  92. if(d15 > 0.0D)
  93. {
  94. l2 = Block.stone.blockID;
  95. }
  96. abyte0[j2] = (byte)l2;
  97. j2 += c;
  98. d15 += d16;
  99. }
  100.  
  101. d10 += d12;
  102. d11 += d13;
  103. }
  104.  
  105. d1 += d5;
  106. d2 += d6;
  107. d3 += d7;
  108. d4 += d8;
  109. }
  110.  
  111. }
  112.  
  113. }
  114.  
  115. }
  116.  
  117. }
  118.  
  119. public void replaceBlocksForBiome(int i, int j, byte abyte0[], BiomeGenBase abiomegenbase[])
  120. {
  121. byte byte0 = 64;
  122. double d = 0.03125D;
  123. sandNoise = field_909_n.generateNoiseOctaves(sandNoise, i * 16, j * 16, 0.0D, 16, 16, 1, d, d, 1.0D);
  124. gravelNoise = field_909_n.generateNoiseOctaves(gravelNoise, i * 16, 109.0134D, j * 16, 16, 1, 16, d, 1.0D, d);
  125. stoneNoise = field_908_o.generateNoiseOctaves(stoneNoise, i * 16, j * 16, 0.0D, 16, 16, 1, d * 2D, d * 2D, d * 2D);
  126. for(int k = 0; k < 16; k++)
  127. {
  128. for(int l = 0; l < 16; l++)
  129. {
  130. BiomeGenBase biomegenbase = abiomegenbase[k + l * 16];
  131. boolean flag = sandNoise[k + l * 16] + rand.nextDouble() * 0.20000000000000001D > 0.0D;
  132. boolean flag1 = gravelNoise[k + l * 16] + rand.nextDouble() * 0.20000000000000001D > 3D;
  133. int i1 = (int)(stoneNoise[k + l * 16] / 3D + 3D + rand.nextDouble() * 0.25D);
  134. int j1 = -1;
  135. byte byte1 = biomegenbase.topBlock;
  136. byte byte2 = biomegenbase.fillerBlock;
  137. for(int k1 = 127; k1 >= 0; k1--)
  138. {
  139. int l1 = (l * 16 + k) * 128 + k1;
  140. if(k1 <= 0 + rand.nextInt(5))
  141. {
  142. abyte0[l1] = (byte)Block.bedrock.blockID;
  143. continue;
  144. }
  145. byte byte3 = abyte0[l1];
  146. if(byte3 == 0)
  147. {
  148. j1 = -1;
  149. continue;
  150. }
  151. if(byte3 != Block.stone.blockID)
  152. {
  153. continue;
  154. }
  155. if(j1 == -1)
  156. {
  157. if(i1 <= 0)
  158. {
  159. byte1 = 0;
  160. byte2 = (byte)Block.stone.blockID;
  161. } else
  162. if(k1 >= byte0 - 4 && k1 <= byte0 + 1)
  163. {
  164. byte1 = biomegenbase.topBlock;
  165. byte2 = biomegenbase.fillerBlock;
  166. if(flag1)
  167. {
  168. byte1 = 0;
  169. }
  170. if(flag1)
  171. {
  172. byte2 = (byte)Block.gravel.blockID;
  173. }
  174. if(flag)
  175. {
  176. byte1 = (byte)Block.sand.blockID;
  177. }
  178. if(flag)
  179. {
  180. byte2 = (byte)Block.sand.blockID;
  181. }
  182. }
  183. if(k1 < byte0 && byte1 == 0)
  184. {
  185. byte1 = (byte)Block.waterStill.blockID;
  186. }
  187. j1 = i1;
  188. if(k1 >= byte0 - 1)
  189. {
  190. abyte0[l1] = byte1;
  191. } else
  192. {
  193. abyte0[l1] = byte2;
  194. }
  195. continue;
  196. }
  197. if(j1 <= 0)
  198. {
  199. continue;
  200. }
  201. j1--;
  202. abyte0[l1] = byte2;
  203. if(j1 == 0 && byte2 == Block.sand.blockID)
  204. {
  205. j1 = rand.nextInt(4);
  206. byte2 = (byte)Block.sandStone.blockID;
  207. }
  208. }
  209.  
  210. }
  211.  
  212. }
  213.  
  214. }
  215.  
  216. public Chunk prepareChunk(int i, int j)
  217. {
  218. return provideChunk(i, j);
  219. }
  220.  
  221. public Chunk provideChunk(int i, int j)
  222. {
  223. rand.setSeed((long)i * 0x4f9939f508L + (long)j * 0x1ef1565bd5L);
  224. byte abyte0[] = new byte[32768];
  225. Chunk chunk = new Chunk(worldObj, abyte0, i, j);
  226. biomesForGeneration = worldObj.getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, i * 16, j * 16, 16, 16);
  227. double ad[] = worldObj.getWorldChunkManager().temperature;
  228. generateTerrain(i, j, abyte0, biomesForGeneration, ad);
  229. replaceBlocksForBiome(i, j, abyte0, biomesForGeneration);
  230. caveGenerator.func_867_a(this, worldObj, i, j, abyte0);
  231. chunk.func_1024_c();
  232. return chunk;
  233. }
  234.  
  235. private double[] func_4061_a(double ad[], int i, int j, int k, int l, int i1, int j1)
  236. {
  237. if(ad == null)
  238. {
  239. ad = new double[l * i1 * j1];
  240. }
  241. double d = 684.41200000000003D;
  242. double d1 = 684.41200000000003D;
  243. double ad1[] = worldObj.getWorldChunkManager().temperature;
  244. double ad2[] = worldObj.getWorldChunkManager().humidity;
  245. field_4182_g = field_922_a.func_4109_a(field_4182_g, i, k, l, j1, 1.121D, 1.121D, 0.5D);
  246. field_4181_h = field_921_b.func_4109_a(field_4181_h, i, k, l, j1, 200D, 200D, 0.5D);
  247. field_4185_d = field_910_m.generateNoiseOctaves(field_4185_d, i, j, k, l, i1, j1, d / 80D, d1 / 160D, d / 80D);
  248. field_4184_e = field_912_k.generateNoiseOctaves(field_4184_e, i, j, k, l, i1, j1, d, d1, d);
  249. field_4183_f = field_911_l.generateNoiseOctaves(field_4183_f, i, j, k, l, i1, j1, d, d1, d);
  250. int k1 = 0;
  251. int l1 = 0;
  252. int i2 = 16 / l;
  253. for(int j2 = 0; j2 < l; j2++)
  254. {
  255. int k2 = j2 * i2 + i2 / 2;
  256. for(int l2 = 0; l2 < j1; l2++)
  257. {
  258. int i3 = l2 * i2 + i2 / 2;
  259. double d2 = ad1[k2 * 16 + i3];
  260. double d3 = ad2[k2 * 16 + i3] * d2;
  261. double d4 = 1.0D - d3;
  262. d4 *= d4;
  263. d4 *= d4;
  264. d4 = 1.0D - d4;
  265. double d5 = (field_4182_g[l1] + 256D) / 512D;
  266. d5 *= d4;
  267. if(d5 > 1.0D)
  268. {
  269. d5 = 1.0D;
  270. }
  271. double d6 = field_4181_h[l1] / 8000D;
  272. if(d6 < 0.0D)
  273. {
  274. d6 = -d6 * 0.29999999999999999D;
  275. }
  276. d6 = d6 * 3D - 2D;
  277. if(d6 < 0.0D)
  278. {
  279. d6 /= 2D;
  280. if(d6 < -1D)
  281. {
  282. d6 = -1D;
  283. }
  284. d6 /= 1.3999999999999999D;
  285. d6 /= 2D;
  286. d5 = 0.0D;
  287. } else
  288. {
  289. if(d6 > 1.0D)
  290. {
  291. d6 = 1.0D;
  292. }
  293. d6 /= 8D;
  294. }
  295. if(d5 < 0.0D)
  296. {
  297. d5 = 0.0D;
  298. }
  299. d5 += 0.5D;
  300. d6 = (d6 * (double)i1) / 16D;
  301. double d7 = (double)i1 / 2D + d6 * 4D;
  302. l1++;
  303. for(int j3 = 0; j3 < i1; j3++)
  304. {
  305. double d8 = 0.0D;
  306. double d9 = (((double)j3 - d7) * 12D) / d5;
  307. if(d9 < 0.0D)
  308. {
  309. d9 *= 4D;
  310. }
  311. double d10 = field_4184_e[k1] / 512D;
  312. double d11 = field_4183_f[k1] / 512D;
  313. double d12 = (field_4185_d[k1] / 10D + 1.0D) / 2D;
  314. if(d12 < 0.0D)
  315. {
  316. d8 = d10;
  317. } else
  318. if(d12 > 1.0D)
  319. {
  320. d8 = d11;
  321. } else
  322. {
  323. d8 = d10 + (d11 - d10) * d12;
  324. }
  325. d8 -= d9;
  326. if(j3 > i1 - 4)
  327. {
  328. double d13 = (float)(j3 - (i1 - 4)) / 3F;
  329. d8 = d8 * (1.0D - d13) + -10D * d13;
  330. }
  331. ad[k1] = d8;
  332. k1++;
  333. }
  334.  
  335. }
  336.  
  337. }
  338.  
  339. return ad;
  340. }
  341.  
  342. public boolean chunkExists(int i, int j)
  343. {
  344. return true;
  345. }
  346.  
  347. public void populate(IChunkProvider ichunkprovider, int i, int j)
  348. {
  349. BlockSand.fallInstantly = true;
  350. int k = i * 16;
  351. int l = j * 16;
  352. BiomeGenBase biomegenbase = worldObj.getWorldChunkManager().getBiomeGenAt(k + 16, l + 16);
  353. rand.setSeed(worldObj.getRandomSeed());
  354. long l1 = (rand.nextLong() / 2L) * 2L + 1L;
  355. long l2 = (rand.nextLong() / 2L) * 2L + 1L;
  356. rand.setSeed((long)i * l1 + (long)j * l2 ^ worldObj.getRandomSeed());
  357. double d = 0.25D;
  358. if(rand.nextInt(4) == 0)
  359. {
  360. int i1 = k + rand.nextInt(16) + 8;
  361. int l4 = rand.nextInt(128);
  362. int i8 = l + rand.nextInt(16) + 8;
  363. (new WorldGenLakes(Block.waterStill.blockID)).generate(worldObj, rand, i1, l4, i8);
  364. }
  365. if(rand.nextInt(8) == 0)
  366. {
  367. int j1 = k + rand.nextInt(16) + 8;
  368. int i5 = rand.nextInt(rand.nextInt(120) + 8);
  369. int j8 = l + rand.nextInt(16) + 8;
  370. if(i5 < 64 || rand.nextInt(10) == 0)
  371. {
  372. (new WorldGenLakes(Block.lavaStill.blockID)).generate(worldObj, rand, j1, i5, j8);
  373. }
  374. }
  375. for(int k1 = 0; k1 < 8; k1++)
  376. {
  377. int j5 = k + rand.nextInt(16) + 8;
  378. int k8 = rand.nextInt(128);
  379. int j11 = l + rand.nextInt(16) + 8;
  380. (new WorldGenDungeons()).generate(worldObj, rand, j5, k8, j11);
  381. }
  382.  
  383. for(int i2 = 0; i2 < 10; i2++)
  384. {
  385. int k5 = k + rand.nextInt(16);
  386. int l8 = rand.nextInt(128);
  387. int k11 = l + rand.nextInt(16);
  388. (new WorldGenClay(32)).generate(worldObj, rand, k5, l8, k11);
  389. }
  390.  
  391. for(int j2 = 0; j2 < 20; j2++)
  392. {
  393. int l5 = k + rand.nextInt(16);
  394. int i9 = rand.nextInt(128);
  395. int l11 = l + rand.nextInt(16);
  396. (new WorldGenMinable(Block.dirt.blockID, 32)).generate(worldObj, rand, l5, i9, l11);
  397. }
  398.  
  399. for(int k2 = 0; k2 < 10; k2++)
  400. {
  401. int i6 = k + rand.nextInt(16);
  402. int j9 = rand.nextInt(128);
  403. int i12 = l + rand.nextInt(16);
  404. (new WorldGenMinable(Block.gravel.blockID, 32)).generate(worldObj, rand, i6, j9, i12);
  405. }
  406.  
  407. for(int oreFrequency = 0; oreFrequency < 12; oreFrequency++)
  408. {
  409. int xCoord = k + rand.nextInt(16);
  410. int yCoord = rand.nextInt(128);
  411. int zCoord = l + rand.nextInt(16);
  412. (new WorldGenMinable(Block.oreTutorial.blockID, 10)).generate(worldObj, rand, xCoord, yCoord, zCoord);
  413. }
  414.  
  415. for(int i3 = 0; i3 < 20; i3++)
  416. {
  417. int j6 = k + rand.nextInt(16);
  418. int k9 = rand.nextInt(128);
  419. int j12 = l + rand.nextInt(16);
  420. (new WorldGenMinable(Block.oreCoal.blockID, 16)).generate(worldObj, rand, j6, k9, j12);
  421. }
  422.  
  423. for(int j3 = 0; j3 < 20; j3++)
  424. {
  425. int k6 = k + rand.nextInt(16);
  426. int l9 = rand.nextInt(64);
  427. int k12 = l + rand.nextInt(16);
  428. (new WorldGenMinable(Block.oreIron.blockID, 8)).generate(worldObj, rand, k6, l9, k12);
  429. }
  430.  
  431. for(int k3 = 0; k3 < 2; k3++)
  432. {
  433. int l6 = k + rand.nextInt(16);
  434. int i10 = rand.nextInt(32);
  435. int l12 = l + rand.nextInt(16);
  436. (new WorldGenMinable(Block.oreGold.blockID, 8)).generate(worldObj, rand, l6, i10, l12);
  437. }
  438.  
  439. for(int l3 = 0; l3 < 8; l3++)
  440. {
  441. int i7 = k + rand.nextInt(16);
  442. int j10 = rand.nextInt(16);
  443. int i13 = l + rand.nextInt(16);
  444. (new WorldGenMinable(Block.oreRedstone.blockID, 7)).generate(worldObj, rand, i7, j10, i13);
  445. }
  446.  
  447. for(int i4 = 0; i4 < 1; i4++)
  448. {
  449. int j7 = k + rand.nextInt(16);
  450. int k10 = rand.nextInt(16);
  451. int j13 = l + rand.nextInt(16);
  452. (new WorldGenMinable(Block.oreDiamond.blockID, 7)).generate(worldObj, rand, j7, k10, j13);
  453. }
  454.  
  455. for(int j4 = 0; j4 < 1; j4++)
  456. {
  457. int k7 = k + rand.nextInt(16);
  458. int l10 = rand.nextInt(16) + rand.nextInt(16);
  459. int k13 = l + rand.nextInt(16);
  460. (new WorldGenMinable(Block.oreLapis.blockID, 6)).generate(worldObj, rand, k7, l10, k13);
  461. }
  462.  
  463. d = 0.5D;
  464. int k4 = (int)((mobSpawnerNoise.func_806_a((double)k * d, (double)l * d) / 8D + rand.nextDouble() * 4D + 4D) / 3D);
  465. int l7 = 0;
  466. if(rand.nextInt(10) == 0)
  467. {
  468. l7++;
  469. }
  470. if(biomegenbase == BiomeGenBase.forest)
  471. {
  472. l7 += k4 + 5;
  473. }
  474. if(biomegenbase == BiomeGenBase.rainforest)
  475. {
  476. l7 += k4 + 5;
  477. }
  478. if(biomegenbase == BiomeGenBase.seasonalForest)
  479. {
  480. l7 += k4 + 2;
  481. }
  482. if(biomegenbase == BiomeGenBase.taiga)
  483. {
  484. l7 += k4 + 5;
  485. }
  486. if(biomegenbase == BiomeGenBase.desert)
  487. {
  488. l7 -= 20;
  489. }
  490. if(biomegenbase == BiomeGenBase.tundra)
  491. {
  492. l7 -= 20;
  493. }
  494. if(biomegenbase == BiomeGenBase.plains)
  495. {
  496. l7 -= 20;
  497. }
  498. for(int i11 = 0; i11 < l7; i11++)
  499. {
  500. int l13 = k + rand.nextInt(16) + 8;
  501. int j14 = l + rand.nextInt(16) + 8;
  502. WorldGenerator worldgenerator = biomegenbase.getRandomWorldGenForTrees(rand);
  503. worldgenerator.func_517_a(1.0D, 1.0D, 1.0D);
  504. worldgenerator.generate(worldObj, rand, l13, worldObj.getHeightValue(l13, j14), j14);
  505. }
  506.  
  507. byte byte0 = 0;
  508. if(biomegenbase == BiomeGenBase.forest)
  509. {
  510. byte0 = 2;
  511. }
  512. if(biomegenbase == BiomeGenBase.seasonalForest)
  513. {
  514. byte0 = 4;
  515. }
  516. if(biomegenbase == BiomeGenBase.taiga)
  517. {
  518. byte0 = 2;
  519. }
  520. if(biomegenbase == BiomeGenBase.plains)
  521. {
  522. byte0 = 3;
  523. }
  524. for(int i14 = 0; i14 < byte0; i14++)
  525. {
  526. int k14 = k + rand.nextInt(16) + 8;
  527. int l16 = rand.nextInt(128);
  528. int k19 = l + rand.nextInt(16) + 8;
  529. (new WorldGenFlowers(Block.plantYellow.blockID)).generate(worldObj, rand, k14, l16, k19);
  530. }
  531.  
  532. byte byte1 = 0;
  533. if(biomegenbase == BiomeGenBase.forest)
  534. {
  535. byte1 = 2;
  536. }
  537. if(biomegenbase == BiomeGenBase.rainforest)
  538. {
  539. byte1 = 10;
  540. }
  541. if(biomegenbase == BiomeGenBase.seasonalForest)
  542. {
  543. byte1 = 2;
  544. }
  545. if(biomegenbase == BiomeGenBase.taiga)
  546. {
  547. byte1 = 1;
  548. }
  549. if(biomegenbase == BiomeGenBase.plains)
  550. {
  551. byte1 = 10;
  552. }
  553. for(int l14 = 0; l14 < byte1; l14++)
  554. {
  555. byte byte2 = 1;
  556. if(biomegenbase == BiomeGenBase.rainforest && rand.nextInt(3) != 0)
  557. {
  558. byte2 = 2;
  559. }
  560. int l19 = k + rand.nextInt(16) + 8;
  561. int k22 = rand.nextInt(128);
  562. int j24 = l + rand.nextInt(16) + 8;
  563. (new WorldGenTallGrass(Block.tallGrass.blockID, byte2)).generate(worldObj, rand, l19, k22, j24);
  564. }
  565.  
  566. byte1 = 0;
  567. if(biomegenbase == BiomeGenBase.desert)
  568. {
  569. byte1 = 2;
  570. }
  571. for(int i15 = 0; i15 < byte1; i15++)
  572. {
  573. int i17 = k + rand.nextInt(16) + 8;
  574. int i20 = rand.nextInt(128);
  575. int l22 = l + rand.nextInt(16) + 8;
  576. (new WorldGenDeadBush(Block.deadBush.blockID)).generate(worldObj, rand, i17, i20, l22);
  577. }
  578.  
  579. if(rand.nextInt(2) == 0)
  580. {
  581. int j15 = k + rand.nextInt(16) + 8;
  582. int j17 = rand.nextInt(128);
  583. int j20 = l + rand.nextInt(16) + 8;
  584. (new WorldGenFlowers(Block.plantRed.blockID)).generate(worldObj, rand, j15, j17, j20);
  585. }
  586. if(rand.nextInt(4) == 0)
  587. {
  588. int k15 = k + rand.nextInt(16) + 8;
  589. int k17 = rand.nextInt(128);
  590. int k20 = l + rand.nextInt(16) + 8;
  591. (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(worldObj, rand, k15, k17, k20);
  592. }
  593. if(rand.nextInt(8) == 0)
  594. {
  595. int l15 = k + rand.nextInt(16) + 8;
  596. int l17 = rand.nextInt(128);
  597. int l20 = l + rand.nextInt(16) + 8;
  598. (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(worldObj, rand, l15, l17, l20);
  599. }
  600. for(int i16 = 0; i16 < 10; i16++)
  601. {
  602. int i18 = k + rand.nextInt(16) + 8;
  603. int i21 = rand.nextInt(128);
  604. int i23 = l + rand.nextInt(16) + 8;
  605. (new WorldGenReed()).generate(worldObj, rand, i18, i21, i23);
  606. }
  607.  
  608. if(rand.nextInt(32) == 0)
  609. {
  610. int j16 = k + rand.nextInt(16) + 8;
  611. int j18 = rand.nextInt(128);
  612. int j21 = l + rand.nextInt(16) + 8;
  613. (new WorldGenPumpkin()).generate(worldObj, rand, j16, j18, j21);
  614. }
  615. int k16 = 0;
  616. if(biomegenbase == BiomeGenBase.desert)
  617. {
  618. k16 += 10;
  619. }
  620. for(int k18 = 0; k18 < k16; k18++)
  621. {
  622. int k21 = k + rand.nextInt(16) + 8;
  623. int j23 = rand.nextInt(128);
  624. int k24 = l + rand.nextInt(16) + 8;
  625. (new WorldGenCactus()).generate(worldObj, rand, k21, j23, k24);
  626. }
  627.  
  628. for(int l18 = 0; l18 < 50; l18++)
  629. {
  630. int l21 = k + rand.nextInt(16) + 8;
  631. int k23 = rand.nextInt(rand.nextInt(120) + 8);
  632. int l24 = l + rand.nextInt(16) + 8;
  633. (new WorldGenLiquids(Block.waterMoving.blockID)).generate(worldObj, rand, l21, k23, l24);
  634. }
  635.  
  636. for(int i19 = 0; i19 < 20; i19++)
  637. {
  638. int i22 = k + rand.nextInt(16) + 8;
  639. int l23 = rand.nextInt(rand.nextInt(rand.nextInt(112) + 8) + 8);
  640. int i25 = l + rand.nextInt(16) + 8;
  641. (new WorldGenLiquids(Block.lavaMoving.blockID)).generate(worldObj, rand, i22, l23, i25);
  642. }
  643.  
  644. generatedTemperatures = worldObj.getWorldChunkManager().getTemperatures(generatedTemperatures, k + 8, l + 8, 16, 16);
  645. for(int j19 = k + 8; j19 < k + 8 + 16; j19++)
  646. {
  647. for(int j22 = l + 8; j22 < l + 8 + 16; j22++)
  648. {
  649. int i24 = j19 - (k + 8);
  650. int j25 = j22 - (l + 8);
  651. int k25 = worldObj.findTopSolidBlock(j19, j22);
  652. double d1 = generatedTemperatures[i24 * 16 + j25] - ((double)(k25 - 64) / 64D) * 0.29999999999999999D;
  653. if(d1 < 0.5D && k25 > 0 && k25 < 128 && worldObj.isAirBlock(j19, k25, j22) && worldObj.getBlockMaterial(j19, k25 - 1, j22).getIsSolid() && worldObj.getBlockMaterial(j19, k25 - 1, j22) != Material.ice)
  654. {
  655. worldObj.setBlockWithNotify(j19, k25, j22, Block.snow.blockID);
  656. }
  657. }
  658.  
  659. }
  660.  
  661. BlockSand.fallInstantly = false;
  662. }
  663.  
  664. public boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate)
  665. {
  666. return true;
  667. }
  668.  
  669. public boolean unload100OldestChunks()
  670. {
  671. return false;
  672. }
  673.  
  674. public boolean canSave()
  675. {
  676. return true;
  677. }
  678.  
  679. public String makeString()
  680. {
  681. return "RandomLevelSource";
  682. }
  683.  
  684. private Random rand;
  685. private NoiseGeneratorOctaves field_912_k;
  686. private NoiseGeneratorOctaves field_911_l;
  687. private NoiseGeneratorOctaves field_910_m;
  688. private NoiseGeneratorOctaves field_909_n;
  689. private NoiseGeneratorOctaves field_908_o;
  690. public NoiseGeneratorOctaves field_922_a;
  691. public NoiseGeneratorOctaves field_921_b;
  692. public NoiseGeneratorOctaves mobSpawnerNoise;
  693. private World worldObj;
  694. private double field_4180_q[];
  695. private double sandNoise[];
  696. private double gravelNoise[];
  697. private double stoneNoise[];
  698. private MapGenBase caveGenerator;
  699. private BiomeGenBase biomesForGeneration[];
  700. double field_4185_d[];
  701. double field_4184_e[];
  702. double field_4183_f[];
  703. double field_4182_g[];
  704. double field_4181_h[];
  705. int unusedIntArray32x32[][];
  706. private double generatedTemperatures[];
  707. }
Advertisement
Add Comment
Please, Sign In to add comment