PageRenderTime 66ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/BiomeSSP/src/BiomeTerrain.java

http://biometerrainmod.googlecode.com/
Java | 1483 lines | 1322 code | 161 blank | 0 comment | 398 complexity | 195e85581cedae67dcf84796631e3f75 MD5 | raw file
  1. import java.io.BufferedReader;
  2. import java.io.BufferedWriter;
  3. import java.io.File;
  4. import java.io.FileInputStream;
  5. import java.io.FileNotFoundException;
  6. import java.io.FileReader;
  7. import java.io.FileWriter;
  8. import java.io.IOException;
  9. import java.io.PrintStream;
  10. import java.net.URL;
  11. import java.security.CodeSource;
  12. import java.security.ProtectionDomain;
  13. import java.util.ArrayList;
  14. import java.util.HashMap;
  15. import java.util.List;
  16. import java.util.Random;
  17. import java.util.jar.JarEntry;
  18. import java.util.jar.JarInputStream;
  19. public class BiomeTerrain
  20. {
  21. private static List<BiomeTerrainBaseMod> mods = new ArrayList();
  22. private static HashMap<String, String> settings = new HashMap();
  23. private static boolean createGlobalSettingsFiles;
  24. private static boolean createWorldSettingsFiles;
  25. private static boolean createNewGlobalSettings;
  26. public static File minecraftFolder;
  27. public static File worldSaveFolder;
  28. public static Random rand;
  29. public static et world;
  30. public static jj currentBiome;
  31. public static jj[] biomeList;
  32. public static boolean dungeonDefault;
  33. public static boolean clayDefault;
  34. public static boolean dirtDefault;
  35. public static boolean gravelDefault;
  36. public static boolean coalDefault;
  37. public static boolean ironDefault;
  38. public static boolean goldDefault;
  39. public static boolean redstoneDefault;
  40. public static boolean diamondDefault;
  41. public static boolean lapislazuliDefault;
  42. public static boolean flowerDefault;
  43. public static boolean roseDefault;
  44. public static boolean brownMushroomDefault;
  45. public static boolean redMushroomDefault;
  46. public static boolean reedDefault;
  47. public static boolean pumpkinDefault;
  48. public static boolean cactusDefault;
  49. public static boolean waterSourceDefault;
  50. public static boolean lavaSourceDefault;
  51. public static boolean rainforestDefault;
  52. public static boolean seasonalforestDefault;
  53. public static boolean forestDefault;
  54. public static boolean taigaDefault;
  55. public static boolean desertDefault;
  56. public static boolean plainsDefault;
  57. public static boolean tundraDefault;
  58. public static boolean lavaSourceHellDefault;
  59. public static boolean fireHellDefault;
  60. public static boolean lightstoneHellDefault1;
  61. public static boolean lightstoneHellDefault2;
  62. public static boolean brownMushroomHellDefault;
  63. public static boolean redMushroomHellDefault;
  64. public static String[] supportedModList = { "BiomeTerrain_" };
  65. static
  66. {
  67. try
  68. {
  69. File source = new File(BiomeTerrainBaseMod.class
  70. .getProtectionDomain().getCodeSource().getLocation()
  71. .toURI());
  72. JarInputStream jar = null;
  73. if ((source.isFile()) && (source.getName().endsWith(".jar"))) {
  74. jar = new JarInputStream(new FileInputStream(source));
  75. Object localObject = null;
  76. }while (true) {
  77. JarEntry entry = jar.getNextJarEntry();
  78. if (entry == null)
  79. break;
  80. String name = entry.getName();
  81. boolean supportedMod = false;
  82. for (int i = 0; (!supportedMod) &&
  83. (i < supportedModList.length); )
  84. {
  85. if (name.startsWith(supportedModList[i]))
  86. supportedMod = true;
  87. i++;
  88. }
  89. if ((entry.isDirectory()) || (!supportedMod) ||
  90. (!name.endsWith(".class"))) continue;
  91. addMod(name.substring(0, name.length() - 6));
  92. if (source.isDirectory()) {
  93. File[] files = source.listFiles();
  94. if (files == null) break;
  95. for (int i = 0; i < files.length; i++) {
  96. name = files[i].getName();
  97. supportedMod = false;
  98. for (int j = 0; (!supportedMod) &&
  99. (j < supportedModList.length); )
  100. {
  101. if (name.startsWith(supportedModList[j]))
  102. supportedMod = true;
  103. j++;
  104. }
  105. if ((!files[i].isFile()) || (!supportedMod) ||
  106. (!name.endsWith(".class"))) continue;
  107. addMod(name.substring(0, name.length() - 6));
  108. }
  109. }
  110. }
  111. } catch (Exception e) {
  112. e.printStackTrace();
  113. }
  114. }
  115. public static void initialize(et _world, long randSeed)
  116. {
  117. world = _world;
  118. rand = new Random();
  119. rand.setSeed(randSeed);
  120. String worldname = world.s.j();
  121. minecraftFolder = new File(BiomeTerrain.class.getProtectionDomain().getCodeSource().getLocation().getPath());
  122. minecraftFolder = minecraftFolder.getParentFile();
  123. minecraftFolder = new File(minecraftFolder.getParentFile().toString().replace("%20", " "));
  124. worldSaveFolder = new File(minecraftFolder.toString().replace("%20", " ") + "/saves/" + worldname);
  125. createNewGlobalSettings = false;
  126. readSettings();
  127. fixSettingsValues();
  128. writeSettings();
  129. globalSettingsCorrector();
  130. }
  131. private static void addMod(String name)
  132. {
  133. try
  134. {
  135. Class localClass = BiomeTerrainBaseMod.class.getClassLoader()
  136. .loadClass(name);
  137. if (localClass.getSuperclass() != BiomeTerrainBaseMod.class)
  138. return;
  139. if (mods.add((BiomeTerrainBaseMod)localClass.newInstance()))
  140. System.out.println("Loaded: " + name);
  141. } catch (Exception e) {
  142. e.printStackTrace();
  143. }
  144. }
  145. public static boolean isModLoaded(String mod) {
  146. try {
  147. for (int i = 0; i < mods.size(); i++)
  148. if (Class.forName(mod).isInstance(mods.get(i)))
  149. return true;
  150. } catch (ClassNotFoundException e) {
  151. return false;
  152. }
  153. return false;
  154. }
  155. public static void updateRandom(Random r)
  156. {
  157. rand = r;
  158. }
  159. public static void updateWorld(et _world) {
  160. world = _world;
  161. }
  162. public static String readSettings(String settingsFile, String settingsName, String defaultValue)
  163. {
  164. BufferedReader br = null;
  165. createWorldSettingsFiles = BiomeTerrain.createGlobalSettingsFiles = true;
  166. try {
  167. File f = new File(worldSaveFolder, settingsFile);
  168. if (!f.exists())
  169. f = new File(minecraftFolder, settingsFile);
  170. if (!f.exists())
  171. {
  172. f.createNewFile();
  173. }
  174. br = new BufferedReader(new FileReader(f));
  175. String thisLine;
  176. while ((thisLine = br.readLine()) != null)
  177. {
  178. if ((thisLine.toLowerCase().contains(settingsName.toLowerCase())) && (!thisLine.toLowerCase().contains("withlava"))) {
  179. settings.put(thisLine.split(":")[0].trim(),
  180. thisLine.split(":")[1].trim());
  181. return thisLine.split(":")[1].trim();
  182. }
  183. }
  184. } catch (FileNotFoundException e) {
  185. createNewGlobalSettings = true;
  186. if (br != null) {
  187. try {
  188. br.close();
  189. }
  190. catch (IOException localIOException2)
  191. {
  192. }
  193. }
  194. if (br != null) {
  195. try {
  196. br.close();
  197. }
  198. catch (IOException localIOException3)
  199. {
  200. }
  201. }
  202. if (br != null)
  203. try {
  204. br.close();
  205. }
  206. catch (IOException localIOException4)
  207. {
  208. }
  209. }
  210. catch (IOException e)
  211. {
  212. e.printStackTrace();
  213. if (br != null) {
  214. try {
  215. br.close();
  216. }
  217. catch (IOException localIOException5)
  218. {
  219. }
  220. }
  221. if (br != null) {
  222. try {
  223. br.close();
  224. }
  225. catch (IOException localIOException6)
  226. {
  227. }
  228. }
  229. if (br != null)
  230. try {
  231. br.close();
  232. }
  233. catch (IOException localIOException7)
  234. {
  235. }
  236. }
  237. finally
  238. {
  239. if (br != null)
  240. try {
  241. br.close();
  242. } catch (IOException localIOException8) {
  243. }
  244. }
  245. return defaultValue;
  246. }
  247. public static int readSettings(String settingsFile, String settingsName, int defaultValue)
  248. {
  249. return Integer.valueOf(readSettings(settingsFile, settingsName,
  250. Integer.toString(defaultValue))).intValue();
  251. }
  252. public static double readSettings(String settingsFile, String settingsName, double defaultValue)
  253. {
  254. return Double.valueOf(readSettings(settingsFile, settingsName,
  255. Double.toString(defaultValue))).doubleValue();
  256. }
  257. public static Boolean readSettings(String settingsFile, String settingsName, Boolean defaultValue)
  258. {
  259. return Boolean.valueOf(readSettings(settingsFile, settingsName,
  260. Boolean.toString(defaultValue.booleanValue())));
  261. }
  262. public static void writeSettingsTitle(String settingsFile, String titleName)
  263. {
  264. BufferedWriter bw = null;
  265. File[] f = { new File(minecraftFolder, settingsFile),
  266. new File(worldSaveFolder, settingsFile) };
  267. for (int i = 0; i < f.length; i++) {
  268. if (((i != 0) || (!createNewGlobalSettings)) && (i != 1)) continue;
  269. try {
  270. if ((i == 0) && (createGlobalSettingsFiles)) {
  271. createGlobalSettingsFiles = false;
  272. bw = new BufferedWriter(new FileWriter(f[i], false));
  273. } else if ((i == 1) && (createWorldSettingsFiles)) {
  274. createWorldSettingsFiles = false;
  275. bw = new BufferedWriter(new FileWriter(f[i], false));
  276. } else {
  277. bw = new BufferedWriter(new FileWriter(f[i], true));
  278. }if (f[i].length() > 0L)
  279. bw.newLine();
  280. bw.write("<" + titleName + ">");
  281. bw.newLine();
  282. bw.flush();
  283. } catch (IOException e) {
  284. e.printStackTrace();
  285. if (bw == null)
  286. {
  287. if (bw == null) continue;
  288. }
  289. else
  290. {
  291. try
  292. {
  293. bw.close();
  294. }
  295. catch (IOException localIOException2) {
  296. }
  297. try {
  298. bw.close();
  299. }
  300. catch (IOException localIOException3)
  301. {
  302. }
  303. try {
  304. bw.close();
  305. }
  306. catch (IOException localIOException4)
  307. {
  308. }
  309. }
  310. }
  311. finally
  312. {
  313. if (bw != null)
  314. try {
  315. bw.close();
  316. }
  317. catch (IOException localIOException5)
  318. {
  319. }
  320. }
  321. }
  322. }
  323. public static void writeSettings(String settingsFile, String settingsName, String settingsValue) {
  324. BufferedWriter bw = null;
  325. File[] f = { new File(minecraftFolder, settingsFile),
  326. new File(worldSaveFolder, settingsFile) };
  327. for (int i = 0; i < f.length; i++) {
  328. if (((i != 0) || (!createNewGlobalSettings)) && (i != 1)) continue;
  329. try {
  330. bw = new BufferedWriter(new FileWriter(f[i], true));
  331. if (settings.containsKey(settingsName))
  332. bw.write(settingsName + ":" +
  333. (String)settings.get(settingsName));
  334. else
  335. bw.write(settingsName + ":" + settingsValue);
  336. bw.newLine();
  337. bw.flush();
  338. } catch (IOException e) {
  339. e.printStackTrace();
  340. if (bw == null)
  341. {
  342. }
  343. else
  344. {
  345. try
  346. {
  347. bw.close();
  348. }
  349. catch (IOException localIOException2) {
  350. }
  351. try {
  352. bw.close();
  353. }
  354. catch (IOException localIOException3)
  355. {
  356. }
  357. try {
  358. bw.close();
  359. }
  360. catch (IOException localIOException4)
  361. {
  362. }
  363. }
  364. }
  365. finally
  366. {
  367. if (bw != null)
  368. try {
  369. bw.close();
  370. }
  371. catch (IOException localIOException5)
  372. {
  373. }
  374. }
  375. }
  376. }
  377. public static void writeSettings(String settingsFile, String settingsName, int settingsValue) {
  378. writeSettings(settingsFile, settingsName,
  379. Integer.toString(settingsValue));
  380. }
  381. public static void writeSettings(String settingsFile, String settingsName, double settingsValue)
  382. {
  383. writeSettings(settingsFile, settingsName,
  384. Double.toString(settingsValue));
  385. }
  386. public static void writeSettings(String settingsFile, String settingsName, Boolean settingsValue)
  387. {
  388. writeSettings(settingsFile, settingsName,
  389. Boolean.toString(settingsValue.booleanValue()));
  390. }
  391. private static void globalSettingsCorrector()
  392. {
  393. if (getCustomObjects())
  394. {
  395. try
  396. {
  397. File BOBFolder = new File(minecraftFolder, "BOBPlugins");
  398. if (!BOBFolder.exists())
  399. {
  400. BOBFolder.mkdir();
  401. }
  402. String[] BOBFolderArray = BOBFolder.list();
  403. int i = 0;
  404. while (i < BOBFolderArray.length)
  405. {
  406. File BOBFile = new File(BOBFolder, BOBFolderArray[i]);
  407. for (int sizer = 0; sizer < mods.size(); sizer++)
  408. ((BiomeTerrainBaseMod)mods.get(sizer)).RegisterPlugins(BOBFile);
  409. i++;
  410. }
  411. }
  412. catch (Exception e)
  413. {
  414. System.out.println("BOB Plugin system encountered an error, aborting!");
  415. }
  416. }
  417. BufferedReader br = null;
  418. BufferedWriter bw = null;
  419. String[] globalMapOrder = new String[1024];
  420. String[] worldMapOrder = new String[1024];
  421. HashMap globalSettings = new HashMap();
  422. try
  423. {
  424. try {
  425. br = new BufferedReader(
  426. new FileReader(
  427. new File(worldSaveFolder,
  428. BiomeTerrainValues.biomeTerrainSettingsName.stringValue())));
  429. }
  430. catch (FileNotFoundException e1)
  431. {
  432. try {
  433. File f = new File(minecraftFolder, BiomeTerrainValues.biomeTerrainSettingsName.stringValue());
  434. if (!f.exists())
  435. {
  436. f.createNewFile();
  437. }
  438. br = new BufferedReader(
  439. new FileReader(f));
  440. }
  441. catch (FileNotFoundException localFileNotFoundException1)
  442. {
  443. }
  444. }
  445. int i = 0;
  446. String thisLine;
  447. while ((thisLine = br.readLine()) != null)
  448. {
  449. if (thisLine.contains(":")) {
  450. globalMapOrder[(i++)] = thisLine.split(":")[0];
  451. globalSettings.put(thisLine.split(":")[0],
  452. thisLine.split(":")[1]);
  453. } else {
  454. globalMapOrder[(i++)] = thisLine;
  455. globalSettings.put(thisLine, "");
  456. }
  457. }
  458. br.close();
  459. settings = new HashMap();
  460. try
  461. {
  462. br = new BufferedReader(
  463. new FileReader(
  464. new File(worldSaveFolder,
  465. BiomeTerrainValues.biomeTerrainSettingsName.stringValue())));
  466. }
  467. catch (FileNotFoundException e1)
  468. {
  469. try {
  470. System.out.println("Failed to find a save-specific settings file, using globals!");
  471. br = new BufferedReader(
  472. new FileReader(
  473. new File(minecraftFolder,
  474. BiomeTerrainValues.biomeTerrainSettingsName.stringValue())));
  475. }
  476. catch (FileNotFoundException e2) {
  477. System.out.println("Failed to find a global settings file, using defaults!");
  478. }
  479. }
  480. i = 0;
  481. while ((thisLine = br.readLine()) != null) {
  482. if (thisLine.contains(":")) {
  483. worldMapOrder[(i++)] = thisLine.split(":")[0];
  484. settings.put(thisLine.split(":")[0], thisLine.split(":")[1]);
  485. } else {
  486. worldMapOrder[(i++)] = thisLine;
  487. settings.put(thisLine, "");
  488. }
  489. }
  490. br.close();
  491. bw = new BufferedWriter(
  492. new FileWriter(
  493. new File(worldSaveFolder,
  494. BiomeTerrainValues.biomeTerrainSettingsName.stringValue()),
  495. false));
  496. for (i = 0; i < worldMapOrder.length; i++) {
  497. String key = worldMapOrder[i];
  498. if (key == null)
  499. break;
  500. if (globalSettings.containsKey(key)) {
  501. if (globalSettings.get(key) != "")
  502. bw.write(key + ":" + (String)globalSettings.get(key));
  503. else
  504. bw.write(key);
  505. }
  506. else if (settings.get(key) != "")
  507. bw.write(key + ":" + (String)settings.get(key));
  508. else {
  509. bw.write(key);
  510. }
  511. bw.newLine();
  512. bw.flush();
  513. }
  514. } catch (IOException e) {
  515. e.printStackTrace();
  516. if (br != null)
  517. try {
  518. br.close();
  519. } catch (IOException localIOException1) {
  520. }
  521. if (bw != null) {
  522. try {
  523. bw.close();
  524. }
  525. catch (IOException localIOException2)
  526. {
  527. }
  528. }
  529. if (br != null)
  530. try {
  531. br.close();
  532. } catch (IOException localIOException3) {
  533. }
  534. if (bw != null) {
  535. try {
  536. bw.close();
  537. }
  538. catch (IOException localIOException4)
  539. {
  540. }
  541. }
  542. if (br != null)
  543. try {
  544. br.close();
  545. } catch (IOException localIOException5) {
  546. }
  547. if (bw != null)
  548. try {
  549. bw.close();
  550. }
  551. catch (IOException localIOException6)
  552. {
  553. }
  554. }
  555. finally
  556. {
  557. if (br != null)
  558. try {
  559. br.close();
  560. } catch (IOException localIOException7) {
  561. }
  562. if (bw != null)
  563. try {
  564. bw.close();
  565. }
  566. catch (IOException localIOException8)
  567. {
  568. }
  569. }
  570. }
  571. public static void processDepositMaterial(int _x, int _z, int rarity, int frequency, int minAltitude, int maxAltitude, int size, int type, boolean evenDistribution)
  572. {
  573. int xyPosMod = (type == BiomeTerrainValues.flower.byteValue().byteValue()) ||
  574. (type == BiomeTerrainValues.rose.byteValue().byteValue()) ||
  575. (type == BiomeTerrainValues.brownmushroom.byteValue().byteValue()) ||
  576. (type == BiomeTerrainValues.redmushroom.byteValue().byteValue()) ||
  577. (type == BiomeTerrainValues.water.byteValue().byteValue()) ||
  578. (type == BiomeTerrainValues.lava.byteValue().byteValue()) ||
  579. (type == BiomeTerrainValues.fire.byteValue().byteValue()) ||
  580. (type == BiomeTerrainValues.cactus.byteValue().byteValue()) ||
  581. (type == BiomeTerrainValues.mobspawner.byteValue().byteValue()) ||
  582. (type == BiomeTerrainValues.reeds.byteValue().byteValue()) ||
  583. (type == BiomeTerrainValues.pumpkin.byteValue().byteValue()) ||
  584. (type == BiomeTerrainValues.lightstone
  585. .byteValue().byteValue()) ?
  586. 8 : 0;
  587. if ((type == BiomeTerrainValues.fire.byteValue().byteValue()) && (!evenDistribution))
  588. frequency = rand.nextInt(rand.nextInt(frequency) + 1) + 1;
  589. else if ((type == BiomeTerrainValues.lightstone.byteValue().byteValue()) && (size == -1) &&
  590. (!evenDistribution)) {
  591. frequency = rand.nextInt(rand.nextInt(frequency) + 1);
  592. }
  593. for (int i = 0; i < frequency; i++)
  594. if (rand.nextInt(100) < rarity) {
  595. int x = _x + rand.nextInt(16) + xyPosMod;
  596. int z = _z + rand.nextInt(16) + xyPosMod;
  597. int y = rand.nextInt(maxAltitude - minAltitude) + minAltitude;
  598. if (currentBiome == BiomeTerrainValues.Hell.biomeValue()) {
  599. if (type == BiomeTerrainValues.lava.byteValue().byteValue()) {
  600. new pd(type).a(world, rand, x, y, z);
  601. } else if (type == BiomeTerrainValues.fire.byteValue().byteValue()) {
  602. new wi().a(world, rand, x, y, z);
  603. } else if ((type == BiomeTerrainValues.lightstone.byteValue().byteValue()) &&
  604. (size == -1)) {
  605. new rc().a(world, rand, x, y, z);
  606. } else if ((type == BiomeTerrainValues.lightstone.byteValue().byteValue()) &&
  607. (size == -2)) {
  608. new fs().a(world, rand, x, y, z); } else {
  609. if ((type != BiomeTerrainValues.brownmushroom
  610. .byteValue().byteValue()) &&
  611. (type != BiomeTerrainValues.redmushroom
  612. .byteValue().byteValue())) continue;
  613. new ay(type).a(world, rand, x, y, z);
  614. }
  615. } else {
  616. if ((type == BiomeTerrainValues.water.byteValue().byteValue()) &&
  617. (!evenDistribution))
  618. y = rand.nextInt(rand
  619. .nextInt(maxAltitude - minAltitude) +
  620. minAltitude);
  621. else if ((type == BiomeTerrainValues.lava.byteValue().byteValue()) &&
  622. (!evenDistribution))
  623. y = rand.nextInt(rand.nextInt(rand.nextInt(maxAltitude -
  624. minAltitude * 2) +
  625. minAltitude) +
  626. minAltitude);
  627. if ((type == BiomeTerrainValues.flower.byteValue().byteValue()) ||
  628. (type == BiomeTerrainValues.rose.byteValue().byteValue()) ||
  629. (type == BiomeTerrainValues.brownmushroom
  630. .byteValue().byteValue()) ||
  631. (type == BiomeTerrainValues.redmushroom
  632. .byteValue().byteValue()))
  633. new ay(type).a(world, rand, x, y, z);
  634. else if (type == BiomeTerrainValues.cactus.byteValue().byteValue())
  635. new fm().a(world, rand, x, y, z);
  636. else if (type == BiomeTerrainValues.reeds.byteValue().byteValue())
  637. new ic().a(world, rand, x, y, z);
  638. else if (type == BiomeTerrainValues.pumpkin.byteValue().byteValue())
  639. new vo().a(world, rand, x, y, z);
  640. else if (type == BiomeTerrainValues.clay.byteValue().byteValue())
  641. new lv(size).a(world, rand, x, y, z);
  642. else if ((type == BiomeTerrainValues.water.byteValue().byteValue()) ||
  643. (type == BiomeTerrainValues.lava.byteValue().byteValue()))
  644. new we(type).a(world, rand, x, y, z);
  645. else if (type == BiomeTerrainValues.mobspawner.byteValue().byteValue())
  646. new eh().a(world, rand, x, y, z);
  647. else
  648. new fb(type, size).a(world, rand, x, y, z);
  649. }
  650. }
  651. }
  652. public static void setBlock(int x, int y, int z, int block)
  653. {
  654. world.a(x, y, z, block);
  655. }
  656. public static int getBlock(int x, int y, int z) {
  657. return world.a(x, y, z);
  658. }
  659. public static int getBlockElevation(int x, int z) {
  660. return world.d(x, z);
  661. }
  662. public static jj getBiomeType(int x, int z) {
  663. return world.a().a(x + 16, z + 16);
  664. }
  665. public static float sin(float n) {
  666. return hy.a(n);
  667. }
  668. public static float cos(float n) {
  669. return hy.b(n);
  670. }
  671. private static void processOriginalUndergroundDeposits(int x, int z)
  672. {
  673. if (dungeonDefault)
  674. for (int i = 0; i < 8; i++) {
  675. int xD = x + rand.nextInt(16) + 8;
  676. int yD = rand.nextInt(128);
  677. int zD = z + rand.nextInt(16) + 8;
  678. new eh().a(world, rand, xD, yD, zD);
  679. }
  680. if (clayDefault)
  681. for (int i = 0; i < 10; i++) {
  682. int xD = x + rand.nextInt(16);
  683. int yD = rand.nextInt(128);
  684. int zD = z + rand.nextInt(16);
  685. new lv(32).a(world, rand, xD, yD, zD);
  686. }
  687. if (dirtDefault)
  688. for (int i = 0; i < 20; i++) {
  689. int xD = x + rand.nextInt(16);
  690. int yD = rand.nextInt(128);
  691. int zD = z + rand.nextInt(16);
  692. new fb(BiomeTerrainValues.dirt.byteValue().byteValue(), 32).a(world, rand, xD, yD, zD);
  693. }
  694. if (gravelDefault)
  695. for (int i = 0; i < 10; i++) {
  696. int xD = x + rand.nextInt(16);
  697. int yD = rand.nextInt(128);
  698. int zD = z + rand.nextInt(16);
  699. new fb(BiomeTerrainValues.gravel.byteValue().byteValue(), 32).a(
  700. world, rand, xD, yD, zD);
  701. }
  702. if (coalDefault)
  703. for (int i = 0; i < 20; i++) {
  704. int xD = x + rand.nextInt(16);
  705. int yD = rand.nextInt(128);
  706. int zD = z + rand.nextInt(16);
  707. new fb(BiomeTerrainValues.coalore.byteValue().byteValue(), 16).a(
  708. world, rand, xD, yD, zD);
  709. }
  710. if (ironDefault)
  711. for (int i = 0; i < 20; i++) {
  712. int xD = x + rand.nextInt(16);
  713. int yD = rand.nextInt(64);
  714. int zD = z + rand.nextInt(16);
  715. new fb(BiomeTerrainValues.ironore.byteValue().byteValue(), 8).a(
  716. world, rand, xD, yD, zD);
  717. }
  718. if (goldDefault)
  719. for (int i = 0; i < 2; i++) {
  720. int xD = x + rand.nextInt(16);
  721. int yD = rand.nextInt(32);
  722. int zD = z + rand.nextInt(16);
  723. new fb(BiomeTerrainValues.goldore.byteValue().byteValue(), 8).a(
  724. world, rand, xD, yD, zD);
  725. }
  726. if (redstoneDefault)
  727. for (int i = 0; i < 8; i++) {
  728. int xD = x + rand.nextInt(16);
  729. int yD = rand.nextInt(16);
  730. int zD = z + rand.nextInt(16);
  731. new fb(BiomeTerrainValues.redstoneore.byteValue().byteValue(), 7).a(
  732. world, rand, xD, yD, zD);
  733. }
  734. if (diamondDefault)
  735. for (int i = 0; i < 1; i++) {
  736. int xD = x + rand.nextInt(16);
  737. int yD = rand.nextInt(16);
  738. int zD = z + rand.nextInt(16);
  739. new fb(BiomeTerrainValues.diamondore.byteValue().byteValue(), 7).a(
  740. world, rand, xD, yD, zD);
  741. }
  742. if (lapislazuliDefault)
  743. for (int i = 0; i < 1; i++) {
  744. int xD = x + rand.nextInt(16);
  745. int yD = rand.nextInt(16);
  746. int zD = z + rand.nextInt(16);
  747. new fb(BiomeTerrainValues.lapislazuliore.byteValue().byteValue(), 7).a(
  748. world, rand, xD, yD, zD);
  749. }
  750. }
  751. private static void processOriginalAboveGroundMaterials(int x, int z) {
  752. if (flowerDefault)
  753. for (int i = 0; i < 2; i++) {
  754. int xD = x + rand.nextInt(16) + 8;
  755. int yD = rand.nextInt(128);
  756. int zD = z + rand.nextInt(16) + 8;
  757. new ay(BiomeTerrainValues.flower.byteValue().byteValue()).a(
  758. world, rand, xD, yD, zD);
  759. }
  760. if ((roseDefault) && (rand.nextInt(2) == 0)) {
  761. int xD = x + rand.nextInt(16) + 8;
  762. int yD = rand.nextInt(128);
  763. int zD = z + rand.nextInt(16) + 8;
  764. new ay(BiomeTerrainValues.rose.byteValue().byteValue()).a(world,
  765. rand, xD, yD, zD);
  766. }
  767. if ((brownMushroomDefault) &&
  768. (rand.nextInt(4) == 0)) {
  769. int xD = x + rand.nextInt(16) + 8;
  770. int yD = rand.nextInt(128);
  771. int zD = z + rand.nextInt(16) + 8;
  772. new ay(BiomeTerrainValues.brownmushroom.byteValue().byteValue()).a(
  773. world, rand, xD, yD, zD);
  774. }
  775. if ((redMushroomDefault) &&
  776. (rand.nextInt(8) == 0)) {
  777. int xD = x + rand.nextInt(16) + 8;
  778. int yD = rand.nextInt(128);
  779. int zD = z + rand.nextInt(16) + 8;
  780. new ay(BiomeTerrainValues.redmushroom.byteValue().byteValue()).a(
  781. world, rand, xD, yD, zD);
  782. }
  783. if (reedDefault)
  784. for (int i = 0; i < 10; i++) {
  785. int xD = x + rand.nextInt(16) + 8;
  786. int yD = rand.nextInt(128);
  787. int zD = z + rand.nextInt(16) + 8;
  788. new ic().a(world, rand, xD, yD, zD);
  789. }
  790. if ((pumpkinDefault) && (rand.nextInt(32) == 0)) {
  791. int xD = x + rand.nextInt(16) + 8;
  792. int yD = rand.nextInt(128);
  793. int zD = z + rand.nextInt(16) + 8;
  794. new vo().a(world, rand, xD, yD, zD);
  795. }
  796. int d = 0;
  797. if ((cactusDefault) &&
  798. (currentBiome == BiomeTerrainValues.Desert.biomeValue()))
  799. d += 10;
  800. for (int i = 0; i < d; i++) {
  801. int xD = x + rand.nextInt(16) + 8;
  802. int yD = rand.nextInt(128);
  803. int zD = z + rand.nextInt(16) + 8;
  804. new fm().a(world, rand, xD, yD, zD);
  805. }
  806. if (waterSourceDefault)
  807. for (int i = 0; i < 50; i++) {
  808. int xD = x + rand.nextInt(16) + 8;
  809. int yD = rand.nextInt(rand
  810. .nextInt(120) + 8);
  811. int zD = z + rand.nextInt(16) + 8;
  812. new we(BiomeTerrainValues.water.byteValue().byteValue()).a(
  813. world, rand, xD, yD, zD);
  814. }
  815. if (lavaSourceDefault)
  816. for (int i = 0; i < 20; i++) {
  817. int xD = x + rand.nextInt(16) + 8;
  818. int yD = rand.nextInt(rand
  819. .nextInt(rand.nextInt(112) + 8) + 8);
  820. int zD = z + rand.nextInt(16) + 8;
  821. new we(BiomeTerrainValues.lava.byteValue().byteValue()).a(
  822. world, rand, xD, yD, zD);
  823. }
  824. }
  825. private static void processOriginalHellMaterials(int x, int z) {
  826. if (lavaSourceHellDefault) {
  827. for (int i = 0; i < 8; i++) {
  828. int xD = x + rand.nextInt(16) + 8;
  829. int yD = rand.nextInt(120) + 4;
  830. int zD = z + rand.nextInt(16) + 8;
  831. new pd(BiomeTerrainValues.stationarylava.byteValue().byteValue()).a(
  832. world, rand, xD, yD, zD);
  833. }
  834. }
  835. int d = rand.nextInt(rand.nextInt(10) + 1) + 1;
  836. if (fireHellDefault) {
  837. for (int i = 0; i < d; i++) {
  838. int xD = x + rand.nextInt(16) + 8;
  839. int yD = rand.nextInt(120) + 4;
  840. int zD = z + rand.nextInt(16) + 8;
  841. new wi().a(world, rand, xD, yD, zD);
  842. }
  843. }
  844. d = rand.nextInt(rand.nextInt(10) + 1);
  845. if (lightstoneHellDefault1)
  846. for (int i = 0; i < d; i++) {
  847. int xD = x + rand.nextInt(16) + 8;
  848. int yD = rand.nextInt(120) + 4;
  849. int zD = z + rand.nextInt(16) + 8;
  850. new rc().a(world, rand, xD, yD, zD);
  851. }
  852. if (lightstoneHellDefault2) {
  853. for (int i = 0; i < 10; i++) {
  854. int xD = x + rand.nextInt(16) + 8;
  855. int yD = rand.nextInt(128);
  856. int zD = z + rand.nextInt(16) + 8;
  857. new fs().a(world, rand, xD, yD, zD);
  858. }
  859. }
  860. if ((brownMushroomHellDefault) && (rand.nextInt(1) == 0)) {
  861. int xD = x + rand.nextInt(16) + 8;
  862. int yD = rand.nextInt(128);
  863. int zD = z + rand.nextInt(16) + 8;
  864. new ay(BiomeTerrainValues.brownmushroom.byteValue().byteValue()).a(
  865. world, rand, xD, yD, zD);
  866. }
  867. if ((redMushroomHellDefault) && (rand.nextInt(1) == 0)) {
  868. int xD = x + rand.nextInt(16) + 8;
  869. int yD = rand.nextInt(128);
  870. int zD = z + rand.nextInt(16) + 8;
  871. new ay(BiomeTerrainValues.redmushroom.byteValue().byteValue()).a(
  872. world, rand, xD, yD, zD);
  873. }
  874. }
  875. private static int processOriginalTrees(int treeDensity, int treeDensityVariation)
  876. {
  877. if ((rainforestDefault) &&
  878. (currentBiome == BiomeTerrainValues.Rainforest
  879. .biomeValue()))
  880. treeDensity += treeDensityVariation + 5;
  881. if ((seasonalforestDefault) &&
  882. (currentBiome == BiomeTerrainValues.SeasonalForest
  883. .biomeValue()))
  884. treeDensity += treeDensityVariation + 2;
  885. if ((forestDefault) &&
  886. (currentBiome == BiomeTerrainValues.Forest
  887. .biomeValue()))
  888. treeDensity += treeDensityVariation + 5;
  889. if ((taigaDefault) &&
  890. (currentBiome == BiomeTerrainValues.Taiga
  891. .biomeValue()))
  892. treeDensity += treeDensityVariation + 5;
  893. if ((desertDefault) &&
  894. (currentBiome == BiomeTerrainValues.Desert
  895. .biomeValue()))
  896. treeDensity -= 20;
  897. if ((plainsDefault) &&
  898. (currentBiome == BiomeTerrainValues.Plains
  899. .biomeValue()))
  900. treeDensity -= 20;
  901. if ((tundraDefault) &&
  902. (currentBiome == BiomeTerrainValues.Tundra
  903. .biomeValue()))
  904. treeDensity -= 20;
  905. return treeDensity;
  906. }
  907. private static void readSettings()
  908. {
  909. for (int i = 0; i < mods.size(); i++)
  910. ((BiomeTerrainBaseMod)mods.get(i)).readSettings();
  911. }
  912. private static void fixSettingsValues() {
  913. for (int i = 0; i < mods.size(); i++)
  914. ((BiomeTerrainBaseMod)mods.get(i)).fixSettingsValues();
  915. }
  916. private static void writeSettings() {
  917. for (int i = 0; i < mods.size(); i++)
  918. ((BiomeTerrainBaseMod)mods.get(i)).writeSettings();
  919. }
  920. public static void processChunkBlocks(byte[] blocks, jj[] biomes)
  921. {
  922. biomeList = biomes;
  923. for (int i = 0; i < mods.size(); i++)
  924. ((BiomeTerrainBaseMod)mods.get(i)).processChunkBlocks(blocks);
  925. }
  926. public static void processUndergroundDeposits(int x, int z)
  927. {
  928. dungeonDefault = BiomeTerrain.clayDefault = BiomeTerrain.dirtDefault = BiomeTerrain.gravelDefault = BiomeTerrain.coalDefault = BiomeTerrain.ironDefault = BiomeTerrain.goldDefault = BiomeTerrain.redstoneDefault = BiomeTerrain.diamondDefault = true;
  929. for (int i = 0; i < mods.size(); i++)
  930. ((BiomeTerrainBaseMod)mods.get(i))
  931. .processUndergroundDeposits(x, z);
  932. processOriginalUndergroundDeposits(x, z);
  933. }
  934. public static void processAboveGroundMaterials(int x, int z) {
  935. flowerDefault = BiomeTerrain.roseDefault = BiomeTerrain.brownMushroomDefault = BiomeTerrain.redMushroomDefault = BiomeTerrain.reedDefault = BiomeTerrain.pumpkinDefault = BiomeTerrain.cactusDefault = BiomeTerrain.waterSourceDefault = BiomeTerrain.lavaSourceDefault = true;
  936. currentBiome = world.a().a(x + 16, z + 16);
  937. for (int i = 0; i < mods.size(); i++)
  938. ((BiomeTerrainBaseMod)mods.get(i)).processAboveGroundMaterials(x,
  939. z);
  940. processOriginalAboveGroundMaterials(x, z);
  941. }
  942. public static void processHellDeposits(int x, int z) {
  943. lavaSourceHellDefault = BiomeTerrain.fireHellDefault = BiomeTerrain.lightstoneHellDefault1 = BiomeTerrain.lightstoneHellDefault2 = BiomeTerrain.brownMushroomHellDefault = BiomeTerrain.redMushroomHellDefault = true;
  944. currentBiome = BiomeTerrainValues.Hell.biomeValue();
  945. for (int i = 0; i < mods.size(); i++)
  946. ((BiomeTerrainBaseMod)mods.get(i)).processHellMaterials(x, z);
  947. processOriginalHellMaterials(x, z);
  948. }
  949. public static boolean getOldGen()
  950. {
  951. boolean result = BiomeTerrainValues.oldGen.booleanValue();
  952. for (int i = 0; (i < mods.size()) &&
  953. (result == BiomeTerrainValues.oldGen.booleanValue()); )
  954. {
  955. result = ((BiomeTerrainBaseMod)mods.get(i)).getOldGen();
  956. i++;
  957. }
  958. return result;
  959. }
  960. public static double getBiomeSize()
  961. {
  962. double result = BiomeTerrainValues.biomeSize.doubleValue();
  963. for (int i = 0; (i < mods.size()) &&
  964. (result == BiomeTerrainValues.biomeSize.doubleValue()); )
  965. {
  966. result = ((BiomeTerrainBaseMod)mods.get(i)).getBiomeSize();
  967. i++;
  968. }
  969. return result;
  970. }
  971. public static double getMinimumTemperature() {
  972. double result = BiomeTerrainValues.minTemperature.doubleValue();
  973. for (int i = 0; (i < mods.size()) &&
  974. (result == BiomeTerrainValues.minTemperature.doubleValue()); )
  975. {
  976. result = ((BiomeTerrainBaseMod)mods.get(i))
  977. .getMinimumTemperature();
  978. i++;
  979. }
  980. return result;
  981. }
  982. public static double getMaximumTemperature() {
  983. double result = BiomeTerrainValues.maxTemperature.doubleValue();
  984. for (int i = 0; (i < mods.size()) &&
  985. (result == BiomeTerrainValues.maxTemperature.doubleValue()); )
  986. {
  987. result = ((BiomeTerrainBaseMod)mods.get(i))
  988. .getMaximumTemperature();
  989. i++;
  990. }
  991. return result;
  992. }
  993. public static double getMinimumMoisture() {
  994. double result = BiomeTerrainValues.minMoisture.doubleValue();
  995. for (int i = 0; (i < mods.size()) &&
  996. (result == BiomeTerrainValues.minMoisture.doubleValue()); )
  997. {
  998. result = ((BiomeTerrainBaseMod)mods.get(i)).getMinimumMoisture();
  999. i++;
  1000. }
  1001. return result;
  1002. }
  1003. public static double getMaximumMoisture() {
  1004. double result = BiomeTerrainValues.maxMoisture.doubleValue();
  1005. for (int i = 0; (i < mods.size()) &&
  1006. (result == BiomeTerrainValues.maxMoisture.doubleValue()); )
  1007. {
  1008. result = ((BiomeTerrainBaseMod)mods.get(i)).getMaximumMoisture();
  1009. i++;
  1010. }
  1011. return result;
  1012. }
  1013. public static double getSnowThreshold() {
  1014. double result = BiomeTerrainValues.snowThreshold.doubleValue();
  1015. for (int i = 0; (i < mods.size()) &&
  1016. (result == BiomeTerrainValues.snowThreshold.doubleValue()); )
  1017. {
  1018. result = ((BiomeTerrainBaseMod)mods.get(i)).getSnowThreshold();
  1019. i++;
  1020. }
  1021. return result;
  1022. }
  1023. public static double getIceThreshold() {
  1024. double result = BiomeTerrainValues.iceThreshold.doubleValue();
  1025. for (int i = 0; (i < mods.size()) &&
  1026. (result == BiomeTerrainValues.iceThreshold.doubleValue()); )
  1027. {
  1028. result = ((BiomeTerrainBaseMod)mods.get(i)).getIceThreshold();
  1029. i++;
  1030. }
  1031. return result;
  1032. }
  1033. public static int getWaterLevel()
  1034. {
  1035. int result = BiomeTerrainValues.waterLevel.intValue();
  1036. for (int i = 0; (i < mods.size()) &&
  1037. (result == BiomeTerrainValues.waterLevel.intValue()); )
  1038. {
  1039. result = ((BiomeTerrainBaseMod)mods.get(i)).getWaterLevel();
  1040. i++;
  1041. }
  1042. return result;
  1043. }
  1044. public static double getMaxAverageHeight() {
  1045. double result = BiomeTerrainValues.maxAverageHeight.doubleValue();
  1046. for (int i = 0; (i < mods.size()) &&
  1047. (result == BiomeTerrainValues.maxAverageHeight.doubleValue()); )
  1048. {
  1049. result = ((BiomeTerrainBaseMod)mods.get(i)).getMaxAverageHeight();
  1050. i++;
  1051. }
  1052. return result;
  1053. }
  1054. public static double getMaxAverageDepth() {
  1055. double result = BiomeTerrainValues.maxAverageDepth.doubleValue();
  1056. for (int i = 0; (i < mods.size()) &&
  1057. (result == BiomeTerrainValues.maxAverageDepth.doubleValue()); )
  1058. {
  1059. result = ((BiomeTerrainBaseMod)mods.get(i)).getMaxAverageDepth();
  1060. i++;
  1061. }
  1062. return result;
  1063. }
  1064. public static double getFractureHorizontal() {
  1065. double result = BiomeTerrainValues.fractureHorizontal.doubleValue() + 1.0D;
  1066. for (int i = 0; (i < mods.size()) &&
  1067. (result == BiomeTerrainValues.fractureHorizontal
  1068. .doubleValue() + 1.0D); )
  1069. {
  1070. result = ((BiomeTerrainBaseMod)mods.get(i))
  1071. .getFractureHorizontal();
  1072. i++;
  1073. }
  1074. return result;
  1075. }
  1076. public static double getFractureVertical() {
  1077. double result = BiomeTerrainValues.fractureVertical.doubleValue() + 1.0D;
  1078. for (int i = 0; (i < mods.size()) &&
  1079. (result == BiomeTerrainValues.fractureVertical.doubleValue() + 1.0D); )
  1080. {
  1081. result = ((BiomeTerrainBaseMod)mods.get(i)).getFractureVertical();
  1082. i++;
  1083. }
  1084. return result;
  1085. }
  1086. public static double getVolatility1() {
  1087. double result = BiomeTerrainValues.volatility1.doubleValue() + 1.0D;
  1088. for (int i = 0; (i < mods.size()) &&
  1089. (result == BiomeTerrainValues.volatility1.doubleValue() + 1.0D); )
  1090. {
  1091. result = ((BiomeTerrainBaseMod)mods.get(i)).getVolatility1();
  1092. i++;
  1093. }
  1094. return result;
  1095. }
  1096. public static double getVolatility2() {
  1097. double result = BiomeTerrainValues.volatility2.doubleValue() + 1.0D;
  1098. for (int i = 0; (i < mods.size()) &&
  1099. (result == BiomeTerrainValues.volatility2.doubleValue() + 1.0D); )
  1100. {
  1101. result = ((BiomeTerrainBaseMod)mods.get(i)).getVolatility2();
  1102. i++;
  1103. }
  1104. return result;
  1105. }
  1106. public static double getVolatilityWeight1() {
  1107. double result = (BiomeTerrainValues.volatilityWeight1.doubleValue() - 0.5D) * 24.0D;
  1108. for (int i = 0; (i < mods.size()) &&
  1109. (result ==
  1110. (BiomeTerrainValues.volatilityWeight1
  1111. .doubleValue() - 0.5D) * 24.0D); )
  1112. {
  1113. result = ((BiomeTerrainBaseMod)mods.get(i)).getVolatilityWeight1();
  1114. i++;
  1115. }
  1116. return result;
  1117. }
  1118. public static double getVolatilityWeight2() {
  1119. double result = (0.5D - BiomeTerrainValues.volatilityWeight2
  1120. .doubleValue()) * 24.0D;
  1121. for (int i = 0; (i < mods.size()) &&
  1122. (result ==
  1123. (0.5D - BiomeTerrainValues.volatilityWeight2
  1124. .doubleValue()) * 24.0D); )
  1125. {
  1126. result = ((BiomeTerrainBaseMod)mods.get(i)).getVolatilityWeight2();
  1127. i++;
  1128. }
  1129. return result;
  1130. }
  1131. public static boolean createadminium(int y) {
  1132. for (int i = 0; i < mods.size(); i++) {
  1133. boolean d = ((BiomeTerrainBaseMod)mods.get(i)).createadminium(y);
  1134. if (!d)
  1135. return d;
  1136. }
  1137. return true;
  1138. }
  1139. public static byte getadminium() {
  1140. byte result = BiomeTerrainValues.adminium.byteValue().byteValue();
  1141. for (int i = 0; (i < mods.size()) &&
  1142. (result == BiomeTerrainValues.adminium.byteValue().byteValue()); )
  1143. {
  1144. result = ((BiomeTerrainBaseMod)mods.get(i)).getadminium();
  1145. i++;
  1146. }
  1147. return result;
  1148. }
  1149. public static boolean getCustomObjects() {
  1150. for (int i = 0; i < mods.size(); i++) {
  1151. boolean d = ((BiomeTerrainBaseMod)mods.get(i)).getCustomObjects();
  1152. if (d)
  1153. return d;
  1154. }
  1155. return false;
  1156. }
  1157. public static boolean getNotchBiomeTrees() {
  1158. for (int i = 0; i < mods.size(); i++) {
  1159. boolean d = ((BiomeTerrainBaseMod)mods.get(i)).getNotchBiomeTrees();
  1160. if (d)
  1161. return d;
  1162. }
  1163. return false;
  1164. }
  1165. public static int getObjectSpawnRatio() {
  1166. for (int i = 0; i < mods.size(); i++) {
  1167. int d = ((BiomeTerrainBaseMod)mods.get(i)).getObjectSpawnRatio();
  1168. if (d != 1)
  1169. return d;
  1170. }
  1171. return 1;
  1172. }
  1173. public static boolean getDisableNotchPonds() {
  1174. for (int i = 0; i < mods.size(); i++) {
  1175. boolean d = ((BiomeTerrainBaseMod)mods.get(i)).getDisableNotchPonds();
  1176. if (d)
  1177. return d;
  1178. }
  1179. return false;
  1180. }
  1181. public static int processTrees(jj biome, int treeDensity, int treeDensityVariation)
  1182. {
  1183. rainforestDefault = BiomeTerrain.seasonalforestDefault = BiomeTerrain.forestDefault = BiomeTerrain.taigaDefault = BiomeTerrain.desertDefault = BiomeTerrain.plainsDefault = BiomeTerrain.tundraDefault = true;
  1184. int result = treeDensity;
  1185. currentBiome = biome;
  1186. for (int i = 0; (i < mods.size()) &&
  1187. (result == treeDensity); )
  1188. {
  1189. result = ((BiomeTerrainBaseMod)mods.get(i)).processTrees(
  1190. treeDensity, treeDensityVariation);
  1191. i++;
  1192. }
  1193. processOriginalTrees(treeDensity, treeDensityVariation);
  1194. return result;
  1195. }
  1196. public static int getCaveRarity()
  1197. {
  1198. int result = BiomeTerrainValues.caveRarity.intValue();
  1199. for (int i = 0; (i < mods.size()) &&
  1200. (result == BiomeTerrainValues.caveRarity.intValue()); )
  1201. {
  1202. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveRarity();
  1203. i++;
  1204. }
  1205. return result;
  1206. }
  1207. public static int getCaveFrequency() {
  1208. int result = BiomeTerrainValues.caveFrequency.intValue();
  1209. for (int i = 0; (i < mods.size()) &&
  1210. (result == BiomeTerrainValues.caveFrequency.intValue()); )
  1211. {
  1212. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveFrequency();
  1213. i++;
  1214. }
  1215. return result;
  1216. }
  1217. public static int getCaveMinAltitude() {
  1218. int result = BiomeTerrainValues.caveMinAltitude.intValue();
  1219. for (int i = 0; (i < mods.size()) &&
  1220. (result == BiomeTerrainValues.caveMinAltitude.intValue()); )
  1221. {
  1222. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveMinAltitude();
  1223. i++;
  1224. }
  1225. return result;
  1226. }
  1227. public static int getCaveMaxAltitude() {
  1228. int result = BiomeTerrainValues.caveMaxAltitude.intValue();
  1229. for (int i = 0; (i < mods.size()) &&
  1230. (result == BiomeTerrainValues.caveMaxAltitude.intValue()); )
  1231. {
  1232. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveMaxAltitude();
  1233. i++;
  1234. }
  1235. return result;
  1236. }
  1237. public static int getIndividualCaveRarity() {
  1238. int result = BiomeTerrainValues.individualCaveRarity.intValue();
  1239. for (int i = 0; (i < mods.size()) &&
  1240. (result == BiomeTerrainValues.individualCaveRarity.intValue()); )
  1241. {
  1242. result = ((BiomeTerrainBaseMod)mods.get(i)).getIndividualCaveRarity();
  1243. i++;
  1244. }
  1245. return result;
  1246. }
  1247. public static int getCaveSystemFrequency() {
  1248. int result = BiomeTerrainValues.caveSystemFrequency.intValue();
  1249. for (int i = 0; (i < mods.size()) &&
  1250. (result == BiomeTerrainValues.caveSystemFrequency.intValue()); )
  1251. {
  1252. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveSystemFrequency();
  1253. i++;
  1254. }
  1255. return result;
  1256. }
  1257. public static int getCaveSystemPocketChance() {
  1258. int result = BiomeTerrainValues.caveSystemPocketChance.intValue();
  1259. for (int i = 0; (i < mods.size()) &&
  1260. (result == BiomeTerrainValues.caveSystemPocketChance.intValue()); )
  1261. {
  1262. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveSystemPocketChance();
  1263. i++;
  1264. }
  1265. return result;
  1266. }
  1267. public static int getCaveSystemPocketMinSize() {
  1268. int result = BiomeTerrainValues.caveSystemPocketMinSize.intValue();
  1269. for (int i = 0; (i < mods.size()) &&
  1270. (result == BiomeTerrainValues.caveSystemPocketMinSize.intValue()); )
  1271. {
  1272. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveSystemPocketMinSize();
  1273. i++;
  1274. }
  1275. return result;
  1276. }
  1277. public static int getCaveSystemPocketMaxSize() {
  1278. int result = BiomeTerrainValues.caveSystemPocketMaxSize.intValue();
  1279. for (int i = 0; (i < mods.size()) &&
  1280. (result == BiomeTerrainValues.caveSystemPocketMaxSize.intValue()); )
  1281. {
  1282. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveSystemPocketMaxSize();
  1283. i++;
  1284. }
  1285. return result;
  1286. }
  1287. public static boolean getEvenCaveDistribution() {
  1288. boolean result = BiomeTerrainValues.evenCaveDistribution.booleanValue().booleanValue();
  1289. for (int i = 0; (i < mods.size()) &&
  1290. (result == BiomeTerrainValues.evenCaveDistribution.booleanValue().booleanValue()); )
  1291. {
  1292. result = ((BiomeTerrainBaseMod)mods.get(i)).getEvenCaveDistribution();
  1293. i++;
  1294. }
  1295. return result;
  1296. }
  1297. public static int getLavaLevelMin() {
  1298. int result = BiomeTerrainValues.lavaLevelMin.intValue();
  1299. for (int i = 0; (i < mods.size()) &&
  1300. (result == BiomeTerrainValues.lavaLevelMin.intValue()); )
  1301. {
  1302. result = ((BiomeTerrainBaseMod)mods.get(i)).getLavaLevelMin();
  1303. i++;
  1304. }
  1305. return result;
  1306. }
  1307. public static int getLavaLevelMax() {
  1308. int result = BiomeTerrainValues.lavaLevelMax.intValue();
  1309. for (int i = 0; (i < mods.size()) &&
  1310. (result == BiomeTerrainValues.lavaLevelMax.intValue()); )
  1311. {
  1312. result = ((BiomeTerrainBaseMod)mods.get(i)).getLavaLevelMax();
  1313. i++;
  1314. }
  1315. return result;
  1316. }
  1317. public static void processUndergroundLakes(int x, int z)
  1318. {
  1319. for (int i = 0; i < mods.size(); i++)
  1320. ((BiomeTerrainBaseMod)mods.get(i)).processUndergroundLakes(x, z);
  1321. }
  1322. }