PageRenderTime 67ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/BiomeTerrain/src/BiomeTerrain.java

http://biometerrainmod.googlecode.com/
Java | 1485 lines | 1324 code | 161 blank | 0 comment | 398 complexity | 458db25a58c0af669742500e89c5d26e 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 da world;
  30. public static gb currentBiome;
  31. public static gb[] 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(da _world, long randSeed)
  116. {
  117. world = _world;
  118. rand = new Random();
  119. rand.setSeed(randSeed);
  120. String worldname = world.s.j;
  121. File minecraftFolderF = new File(BiomeTerrain.class.getProtectionDomain().getCodeSource().getLocation().getPath());
  122. minecraftFolderF = new File(minecraftFolderF.getParentFile().toString().replace("%20", " "));
  123. minecraftFolder = new File(minecraftFolderF.toString().replace("%20", " "));
  124. worldSaveFolder = new File(minecraftFolderF.toString().replace("%20", " ") + "/" + 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(da _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. System.out.println("PhoenixTerrainMod SMP Release 1 (Bugfix 9) Loaded!");
  394. if (getCustomObjects())
  395. {
  396. try
  397. {
  398. File BOBFolder = new File(minecraftFolder, "BOBPlugins");
  399. if (!BOBFolder.exists())
  400. {
  401. BOBFolder.mkdir();
  402. System.out.println("BOB Plugin folder created!");
  403. }
  404. String[] BOBFolderArray = BOBFolder.list();
  405. int i = 0;
  406. while (i < BOBFolderArray.length)
  407. {
  408. File BOBFile = new File(BOBFolder, BOBFolderArray[i]);
  409. for (int sizer = 0; sizer < mods.size(); sizer++)
  410. ((BiomeTerrainBaseMod)mods.get(sizer)).RegisterPlugins(BOBFile);
  411. i++;
  412. }
  413. }
  414. catch (Exception e)
  415. {
  416. System.out.println("BOB Plugin system encountered an error, aborting!");
  417. }
  418. }
  419. BufferedReader br = null;
  420. BufferedWriter bw = null;
  421. String[] globalMapOrder = new String[1024];
  422. String[] worldMapOrder = new String[1024];
  423. HashMap globalSettings = new HashMap();
  424. try
  425. {
  426. try {
  427. br = new BufferedReader(
  428. new FileReader(
  429. new File(worldSaveFolder,
  430. BiomeTerrainValues.biomeTerrainSettingsName.stringValue())));
  431. }
  432. catch (FileNotFoundException e1)
  433. {
  434. try {
  435. File f = new File(minecraftFolder, BiomeTerrainValues.biomeTerrainSettingsName.stringValue());
  436. if (!f.exists())
  437. {
  438. f.createNewFile();
  439. }
  440. br = new BufferedReader(
  441. new FileReader(f));
  442. }
  443. catch (FileNotFoundException localFileNotFoundException1)
  444. {
  445. }
  446. }
  447. int i = 0;
  448. String thisLine;
  449. while ((thisLine = br.readLine()) != null)
  450. {
  451. if (thisLine.contains(":")) {
  452. globalMapOrder[(i++)] = thisLine.split(":")[0];
  453. globalSettings.put(thisLine.split(":")[0],
  454. thisLine.split(":")[1]);
  455. } else {
  456. globalMapOrder[(i++)] = thisLine;
  457. globalSettings.put(thisLine, "");
  458. }
  459. }
  460. br.close();
  461. settings = new HashMap();
  462. try
  463. {
  464. br = new BufferedReader(
  465. new FileReader(
  466. new File(worldSaveFolder,
  467. BiomeTerrainValues.biomeTerrainSettingsName.stringValue())));
  468. }
  469. catch (FileNotFoundException e1)
  470. {
  471. try {
  472. System.out.println("Failed to find a save-specific settings file, using globals!");
  473. br = new BufferedReader(
  474. new FileReader(
  475. new File(minecraftFolder,
  476. BiomeTerrainValues.biomeTerrainSettingsName.stringValue())));
  477. }
  478. catch (FileNotFoundException e2) {
  479. System.out.println("Failed to find a global settings file, using defaults!");
  480. }
  481. }
  482. i = 0;
  483. while ((thisLine = br.readLine()) != null) {
  484. if (thisLine.contains(":")) {
  485. worldMapOrder[(i++)] = thisLine.split(":")[0];
  486. settings.put(thisLine.split(":")[0], thisLine.split(":")[1]);
  487. } else {
  488. worldMapOrder[(i++)] = thisLine;
  489. settings.put(thisLine, "");
  490. }
  491. }
  492. br.close();
  493. bw = new BufferedWriter(
  494. new FileWriter(
  495. new File(worldSaveFolder,
  496. BiomeTerrainValues.biomeTerrainSettingsName.stringValue()),
  497. false));
  498. for (i = 0; i < worldMapOrder.length; i++) {
  499. String key = worldMapOrder[i];
  500. if (key == null)
  501. break;
  502. if (globalSettings.containsKey(key)) {
  503. if (globalSettings.get(key) != "")
  504. bw.write(key + ":" + (String)globalSettings.get(key));
  505. else
  506. bw.write(key);
  507. }
  508. else if (settings.get(key) != "")
  509. bw.write(key + ":" + (String)settings.get(key));
  510. else {
  511. bw.write(key);
  512. }
  513. bw.newLine();
  514. bw.flush();
  515. }
  516. } catch (IOException e) {
  517. e.printStackTrace();
  518. if (br != null)
  519. try {
  520. br.close();
  521. } catch (IOException localIOException1) {
  522. }
  523. if (bw != null) {
  524. try {
  525. bw.close();
  526. }
  527. catch (IOException localIOException2)
  528. {
  529. }
  530. }
  531. if (br != null)
  532. try {
  533. br.close();
  534. } catch (IOException localIOException3) {
  535. }
  536. if (bw != null) {
  537. try {
  538. bw.close();
  539. }
  540. catch (IOException localIOException4)
  541. {
  542. }
  543. }
  544. if (br != null)
  545. try {
  546. br.close();
  547. } catch (IOException localIOException5) {
  548. }
  549. if (bw != null)
  550. try {
  551. bw.close();
  552. }
  553. catch (IOException localIOException6)
  554. {
  555. }
  556. }
  557. finally
  558. {
  559. if (br != null)
  560. try {
  561. br.close();
  562. } catch (IOException localIOException7) {
  563. }
  564. if (bw != null)
  565. try {
  566. bw.close();
  567. }
  568. catch (IOException localIOException8)
  569. {
  570. }
  571. }
  572. }
  573. public static void processDepositMaterial(int _x, int _z, int rarity, int frequency, int minAltitude, int maxAltitude, int size, int type, boolean evenDistribution)
  574. {
  575. int xyPosMod = (type == BiomeTerrainValues.flower.byteValue().byteValue()) ||
  576. (type == BiomeTerrainValues.rose.byteValue().byteValue()) ||
  577. (type == BiomeTerrainValues.brownmushroom.byteValue().byteValue()) ||
  578. (type == BiomeTerrainValues.redmushroom.byteValue().byteValue()) ||
  579. (type == BiomeTerrainValues.water.byteValue().byteValue()) ||
  580. (type == BiomeTerrainValues.lava.byteValue().byteValue()) ||
  581. (type == BiomeTerrainValues.fire.byteValue().byteValue()) ||
  582. (type == BiomeTerrainValues.cactus.byteValue().byteValue()) ||
  583. (type == BiomeTerrainValues.mobspawner.byteValue().byteValue()) ||
  584. (type == BiomeTerrainValues.reeds.byteValue().byteValue()) ||
  585. (type == BiomeTerrainValues.pumpkin.byteValue().byteValue()) ||
  586. (type == BiomeTerrainValues.lightstone
  587. .byteValue().byteValue()) ?
  588. 8 : 0;
  589. if ((type == BiomeTerrainValues.fire.byteValue().byteValue()) && (!evenDistribution))
  590. frequency = rand.nextInt(rand.nextInt(frequency) + 1) + 1;
  591. else if ((type == BiomeTerrainValues.lightstone.byteValue().byteValue()) && (size == -1) &&
  592. (!evenDistribution)) {
  593. frequency = rand.nextInt(rand.nextInt(frequency) + 1);
  594. }
  595. for (int i = 0; i < frequency; i++)
  596. if (rand.nextInt(100) < rarity) {
  597. int x = _x + rand.nextInt(16) + xyPosMod;
  598. int z = _z + rand.nextInt(16) + xyPosMod;
  599. int y = rand.nextInt(maxAltitude - minAltitude) + minAltitude;
  600. if (currentBiome == BiomeTerrainValues.Hell.biomeValue()) {
  601. if (type == BiomeTerrainValues.lava.byteValue().byteValue()) {
  602. new jb(type).a(world, rand, x, y, z);
  603. } else if (type == BiomeTerrainValues.fire.byteValue().byteValue()) {
  604. new nz().a(world, rand, x, y, z);
  605. } else if ((type == BiomeTerrainValues.lightstone.byteValue().byteValue()) &&
  606. (size == -1)) {
  607. new kl().a(world, rand, x, y, z);
  608. } else if ((type == BiomeTerrainValues.lightstone.byteValue().byteValue()) &&
  609. (size == -2)) {
  610. new dt().a(world, rand, x, y, z); } else {
  611. if ((type != BiomeTerrainValues.brownmushroom
  612. .byteValue().byteValue()) &&
  613. (type != BiomeTerrainValues.redmushroom
  614. .byteValue().byteValue())) continue;
  615. new ah(type).a(world, rand, x, y, z);
  616. }
  617. } else {
  618. if ((type == BiomeTerrainValues.water.byteValue().byteValue()) &&
  619. (!evenDistribution))
  620. y = rand.nextInt(rand
  621. .nextInt(maxAltitude - minAltitude) +
  622. minAltitude);
  623. else if ((type == BiomeTerrainValues.lava.byteValue().byteValue()) &&
  624. (!evenDistribution))
  625. y = rand.nextInt(rand.nextInt(rand.nextInt(maxAltitude -
  626. minAltitude * 2) +
  627. minAltitude) +
  628. minAltitude);
  629. if ((type == BiomeTerrainValues.flower.byteValue().byteValue()) ||
  630. (type == BiomeTerrainValues.rose.byteValue().byteValue()) ||
  631. (type == BiomeTerrainValues.brownmushroom
  632. .byteValue().byteValue()) ||
  633. (type == BiomeTerrainValues.redmushroom
  634. .byteValue().byteValue()))
  635. new ah(type).a(world, rand, x, y, z);
  636. else if (type == BiomeTerrainValues.cactus.byteValue().byteValue())
  637. new dq().a(world, rand, x, y, z);
  638. else if (type == BiomeTerrainValues.reeds.byteValue().byteValue())
  639. new ff().a(world, rand, x, y, z);
  640. else if (type == BiomeTerrainValues.pumpkin.byteValue().byteValue())
  641. new nm().a(world, rand, x, y, z);
  642. else if (type == BiomeTerrainValues.clay.byteValue().byteValue())
  643. new hk(size).a(world, rand, x, y, z);
  644. else if ((type == BiomeTerrainValues.water.byteValue().byteValue()) ||
  645. (type == BiomeTerrainValues.lava.byteValue().byteValue()))
  646. new ny(type).a(world, rand, x, y, z);
  647. else if (type == BiomeTerrainValues.mobspawner.byteValue().byteValue())
  648. new cr().a(world, rand, x, y, z);
  649. else
  650. new di(type, size).a(world, rand, x, y, z);
  651. }
  652. }
  653. }
  654. public static void setBlock(int x, int y, int z, int block)
  655. {
  656. world.a(x, y, z, block);
  657. }
  658. public static int getBlock(int x, int y, int z) {
  659. return world.a(x, y, z);
  660. }
  661. public static int getBlockElevation(int x, int z) {
  662. return world.d(x, z);
  663. }
  664. public static gb getBiomeType(int x, int z) {
  665. return world.a().a(x + 16, z + 16);
  666. }
  667. public static float sin(float n) {
  668. return fd.a(n);
  669. }
  670. public static float cos(float n) {
  671. return fd.b(n);
  672. }
  673. private static void processOriginalUndergroundDeposits(int x, int z)
  674. {
  675. if (dungeonDefault)
  676. for (int i = 0; i < 8; i++) {
  677. int xD = x + rand.nextInt(16) + 8;
  678. int yD = rand.nextInt(128);
  679. int zD = z + rand.nextInt(16) + 8;
  680. new cr().a(world, rand, xD, yD, zD);
  681. }
  682. if (clayDefault)
  683. for (int i = 0; i < 10; i++) {
  684. int xD = x + rand.nextInt(16);
  685. int yD = rand.nextInt(128);
  686. int zD = z + rand.nextInt(16);
  687. new hk(32).a(world, rand, xD, yD, zD);
  688. }
  689. if (dirtDefault)
  690. for (int i = 0; i < 20; i++) {
  691. int xD = x + rand.nextInt(16);
  692. int yD = rand.nextInt(128);
  693. int zD = z + rand.nextInt(16);
  694. new di(BiomeTerrainValues.dirt.byteValue().byteValue(), 32).a(world, rand, xD, yD, zD);
  695. }
  696. if (gravelDefault)
  697. for (int i = 0; i < 10; i++) {
  698. int xD = x + rand.nextInt(16);
  699. int yD = rand.nextInt(128);
  700. int zD = z + rand.nextInt(16);
  701. new di(BiomeTerrainValues.gravel.byteValue().byteValue(), 32).a(
  702. world, rand, xD, yD, zD);
  703. }
  704. if (coalDefault)
  705. for (int i = 0; i < 20; i++) {
  706. int xD = x + rand.nextInt(16);
  707. int yD = rand.nextInt(128);
  708. int zD = z + rand.nextInt(16);
  709. new di(BiomeTerrainValues.coalore.byteValue().byteValue(), 16).a(
  710. world, rand, xD, yD, zD);
  711. }
  712. if (ironDefault)
  713. for (int i = 0; i < 20; i++) {
  714. int xD = x + rand.nextInt(16);
  715. int yD = rand.nextInt(64);
  716. int zD = z + rand.nextInt(16);
  717. new di(BiomeTerrainValues.ironore.byteValue().byteValue(), 8).a(
  718. world, rand, xD, yD, zD);
  719. }
  720. if (goldDefault)
  721. for (int i = 0; i < 2; i++) {
  722. int xD = x + rand.nextInt(16);
  723. int yD = rand.nextInt(32);
  724. int zD = z + rand.nextInt(16);
  725. new di(BiomeTerrainValues.goldore.byteValue().byteValue(), 8).a(
  726. world, rand, xD, yD, zD);
  727. }
  728. if (redstoneDefault)
  729. for (int i = 0; i < 8; i++) {
  730. int xD = x + rand.nextInt(16);
  731. int yD = rand.nextInt(16);
  732. int zD = z + rand.nextInt(16);
  733. new di(BiomeTerrainValues.redstoneore.byteValue().byteValue(), 7).a(
  734. world, rand, xD, yD, zD);
  735. }
  736. if (diamondDefault)
  737. for (int i = 0; i < 1; i++) {
  738. int xD = x + rand.nextInt(16);
  739. int yD = rand.nextInt(16);
  740. int zD = z + rand.nextInt(16);
  741. new di(BiomeTerrainValues.diamondore.byteValue().byteValue(), 7).a(
  742. world, rand, xD, yD, zD);
  743. }
  744. if (lapislazuliDefault)
  745. for (int i = 0; i < 1; i++) {
  746. int xD = x + rand.nextInt(16);
  747. int yD = rand.nextInt(16);
  748. int zD = z + rand.nextInt(16);
  749. new di(BiomeTerrainValues.lapislazuliore.byteValue().byteValue(), 7).a(
  750. world, rand, xD, yD, zD);
  751. }
  752. }
  753. private static void processOriginalAboveGroundMaterials(int x, int z) {
  754. if (flowerDefault)
  755. for (int i = 0; i < 2; i++) {
  756. int xD = x + rand.nextInt(16) + 8;
  757. int yD = rand.nextInt(128);
  758. int zD = z + rand.nextInt(16) + 8;
  759. new ah(BiomeTerrainValues.flower.byteValue().byteValue()).a(
  760. world, rand, xD, yD, zD);
  761. }
  762. if ((roseDefault) && (rand.nextInt(2) == 0)) {
  763. int xD = x + rand.nextInt(16) + 8;
  764. int yD = rand.nextInt(128);
  765. int zD = z + rand.nextInt(16) + 8;
  766. new ah(BiomeTerrainValues.rose.byteValue().byteValue()).a(world,
  767. rand, xD, yD, zD);
  768. }
  769. if ((brownMushroomDefault) &&
  770. (rand.nextInt(4) == 0)) {
  771. int xD = x + rand.nextInt(16) + 8;
  772. int yD = rand.nextInt(128);
  773. int zD = z + rand.nextInt(16) + 8;
  774. new ah(BiomeTerrainValues.brownmushroom.byteValue().byteValue()).a(
  775. world, rand, xD, yD, zD);
  776. }
  777. if ((redMushroomDefault) &&
  778. (rand.nextInt(8) == 0)) {
  779. int xD = x + rand.nextInt(16) + 8;
  780. int yD = rand.nextInt(128);
  781. int zD = z + rand.nextInt(16) + 8;
  782. new ah(BiomeTerrainValues.redmushroom.byteValue().byteValue()).a(
  783. world, rand, xD, yD, zD);
  784. }
  785. if (reedDefault)
  786. for (int i = 0; i < 10; i++) {
  787. int xD = x + rand.nextInt(16) + 8;
  788. int yD = rand.nextInt(128);
  789. int zD = z + rand.nextInt(16) + 8;
  790. new ff().a(world, rand, xD, yD, zD);
  791. }
  792. if ((pumpkinDefault) && (rand.nextInt(32) == 0)) {
  793. int xD = x + rand.nextInt(16) + 8;
  794. int yD = rand.nextInt(128);
  795. int zD = z + rand.nextInt(16) + 8;
  796. new nm().a(world, rand, xD, yD, zD);
  797. }
  798. int d = 0;
  799. if ((cactusDefault) &&
  800. (currentBiome == BiomeTerrainValues.Desert.biomeValue()))
  801. d += 10;
  802. for (int i = 0; i < d; i++) {
  803. int xD = x + rand.nextInt(16) + 8;
  804. int yD = rand.nextInt(128);
  805. int zD = z + rand.nextInt(16) + 8;
  806. new dq().a(world, rand, xD, yD, zD);
  807. }
  808. if (waterSourceDefault)
  809. for (int i = 0; i < 50; i++) {
  810. int xD = x + rand.nextInt(16) + 8;
  811. int yD = rand.nextInt(rand
  812. .nextInt(120) + 8);
  813. int zD = z + rand.nextInt(16) + 8;
  814. new ny(BiomeTerrainValues.water.byteValue().byteValue()).a(
  815. world, rand, xD, yD, zD);
  816. }
  817. if (lavaSourceDefault)
  818. for (int i = 0; i < 20; i++) {
  819. int xD = x + rand.nextInt(16) + 8;
  820. int yD = rand.nextInt(rand
  821. .nextInt(rand.nextInt(112) + 8) + 8);
  822. int zD = z + rand.nextInt(16) + 8;
  823. new ny(BiomeTerrainValues.lava.byteValue().byteValue()).a(
  824. world, rand, xD, yD, zD);
  825. }
  826. }
  827. private static void processOriginalHellMaterials(int x, int z) {
  828. if (lavaSourceHellDefault) {
  829. for (int i = 0; i < 8; i++) {
  830. int xD = x + rand.nextInt(16) + 8;
  831. int yD = rand.nextInt(120) + 4;
  832. int zD = z + rand.nextInt(16) + 8;
  833. new jb(BiomeTerrainValues.stationarylava.byteValue().byteValue()).a(
  834. world, rand, xD, yD, zD);
  835. }
  836. }
  837. int d = rand.nextInt(rand.nextInt(10) + 1) + 1;
  838. if (fireHellDefault) {
  839. for (int i = 0; i < d; i++) {
  840. int xD = x + rand.nextInt(16) + 8;
  841. int yD = rand.nextInt(120) + 4;
  842. int zD = z + rand.nextInt(16) + 8;
  843. new nz().a(world, rand, xD, yD, zD);
  844. }
  845. }
  846. d = rand.nextInt(rand.nextInt(10) + 1);
  847. if (lightstoneHellDefault1)
  848. for (int i = 0; i < d; i++) {
  849. int xD = x + rand.nextInt(16) + 8;
  850. int yD = rand.nextInt(120) + 4;
  851. int zD = z + rand.nextInt(16) + 8;
  852. new kl().a(world, rand, xD, yD, zD);
  853. }
  854. if (lightstoneHellDefault2) {
  855. for (int i = 0; i < 10; i++) {
  856. int xD = x + rand.nextInt(16) + 8;
  857. int yD = rand.nextInt(128);
  858. int zD = z + rand.nextInt(16) + 8;
  859. new dt().a(world, rand, xD, yD, zD);
  860. }
  861. }
  862. if ((brownMushroomHellDefault) && (rand.nextInt(1) == 0)) {
  863. int xD = x + rand.nextInt(16) + 8;
  864. int yD = rand.nextInt(128);
  865. int zD = z + rand.nextInt(16) + 8;
  866. new ah(BiomeTerrainValues.brownmushroom.byteValue().byteValue()).a(
  867. world, rand, xD, yD, zD);
  868. }
  869. if ((redMushroomHellDefault) && (rand.nextInt(1) == 0)) {
  870. int xD = x + rand.nextInt(16) + 8;
  871. int yD = rand.nextInt(128);
  872. int zD = z + rand.nextInt(16) + 8;
  873. new ah(BiomeTerrainValues.redmushroom.byteValue().byteValue()).a(
  874. world, rand, xD, yD, zD);
  875. }
  876. }
  877. private static int processOriginalTrees(int treeDensity, int treeDensityVariation)
  878. {
  879. if ((rainforestDefault) &&
  880. (currentBiome == BiomeTerrainValues.Rainforest
  881. .biomeValue()))
  882. treeDensity += treeDensityVariation + 5;
  883. if ((seasonalforestDefault) &&
  884. (currentBiome == BiomeTerrainValues.SeasonalForest
  885. .biomeValue()))
  886. treeDensity += treeDensityVariation + 2;
  887. if ((forestDefault) &&
  888. (currentBiome == BiomeTerrainValues.Forest
  889. .biomeValue()))
  890. treeDensity += treeDensityVariation + 5;
  891. if ((taigaDefault) &&
  892. (currentBiome == BiomeTerrainValues.Taiga
  893. .biomeValue()))
  894. treeDensity += treeDensityVariation + 5;
  895. if ((desertDefault) &&
  896. (currentBiome == BiomeTerrainValues.Desert
  897. .biomeValue()))
  898. treeDensity -= 20;
  899. if ((plainsDefault) &&
  900. (currentBiome == BiomeTerrainValues.Plains
  901. .biomeValue()))
  902. treeDensity -= 20;
  903. if ((tundraDefault) &&
  904. (currentBiome == BiomeTerrainValues.Tundra
  905. .biomeValue()))
  906. treeDensity -= 20;
  907. return treeDensity;
  908. }
  909. private static void readSettings()
  910. {
  911. for (int i = 0; i < mods.size(); i++)
  912. ((BiomeTerrainBaseMod)mods.get(i)).readSettings();
  913. }
  914. private static void fixSettingsValues() {
  915. for (int i = 0; i < mods.size(); i++)
  916. ((BiomeTerrainBaseMod)mods.get(i)).fixSettingsValues();
  917. }
  918. private static void writeSettings() {
  919. for (int i = 0; i < mods.size(); i++)
  920. ((BiomeTerrainBaseMod)mods.get(i)).writeSettings();
  921. }
  922. public static void processChunkBlocks(byte[] blocks, gb[] biomes)
  923. {
  924. biomeList = biomes;
  925. for (int i = 0; i < mods.size(); i++)
  926. ((BiomeTerrainBaseMod)mods.get(i)).processChunkBlocks(blocks);
  927. }
  928. public static void processUndergroundDeposits(int x, int z)
  929. {
  930. dungeonDefault = BiomeTerrain.clayDefault = BiomeTerrain.dirtDefault = BiomeTerrain.gravelDefault = BiomeTerrain.coalDefault = BiomeTerrain.ironDefault = BiomeTerrain.goldDefault = BiomeTerrain.redstoneDefault = BiomeTerrain.diamondDefault = true;
  931. for (int i = 0; i < mods.size(); i++)
  932. ((BiomeTerrainBaseMod)mods.get(i))
  933. .processUndergroundDeposits(x, z);
  934. processOriginalUndergroundDeposits(x, z);
  935. }
  936. public static void processAboveGroundMaterials(int x, int z) {
  937. flowerDefault = BiomeTerrain.roseDefault = BiomeTerrain.brownMushroomDefault = BiomeTerrain.redMushroomDefault = BiomeTerrain.reedDefault = BiomeTerrain.pumpkinDefault = BiomeTerrain.cactusDefault = BiomeTerrain.waterSourceDefault = BiomeTerrain.lavaSourceDefault = true;
  938. currentBiome = world.a().a(x + 16, z + 16);
  939. for (int i = 0; i < mods.size(); i++)
  940. ((BiomeTerrainBaseMod)mods.get(i)).processAboveGroundMaterials(x,
  941. z);
  942. processOriginalAboveGroundMaterials(x, z);
  943. }
  944. public static void processHellDeposits(int x, int z) {
  945. lavaSourceHellDefault = BiomeTerrain.fireHellDefault = BiomeTerrain.lightstoneHellDefault1 = BiomeTerrain.lightstoneHellDefault2 = BiomeTerrain.brownMushroomHellDefault = BiomeTerrain.redMushroomHellDefault = true;
  946. currentBiome = BiomeTerrainValues.Hell.biomeValue();
  947. for (int i = 0; i < mods.size(); i++)
  948. ((BiomeTerrainBaseMod)mods.get(i)).processHellMaterials(x, z);
  949. processOriginalHellMaterials(x, z);
  950. }
  951. public static boolean getOldGen()
  952. {
  953. boolean result = BiomeTerrainValues.oldGen.booleanValue();
  954. for (int i = 0; (i < mods.size()) &&
  955. (result == BiomeTerrainValues.oldGen.booleanValue()); )
  956. {
  957. result = ((BiomeTerrainBaseMod)mods.get(i)).getOldGen();
  958. i++;
  959. }
  960. return result;
  961. }
  962. public static double getBiomeSize()
  963. {
  964. double result = BiomeTerrainValues.biomeSize.doubleValue();
  965. for (int i = 0; (i < mods.size()) &&
  966. (result == BiomeTerrainValues.biomeSize.doubleValue()); )
  967. {
  968. result = ((BiomeTerrainBaseMod)mods.get(i)).getBiomeSize();
  969. i++;
  970. }
  971. return result;
  972. }
  973. public static double getMinimumTemperature() {
  974. double result = BiomeTerrainValues.minTemperature.doubleValue();
  975. for (int i = 0; (i < mods.size()) &&
  976. (result == BiomeTerrainValues.minTemperature.doubleValue()); )
  977. {
  978. result = ((BiomeTerrainBaseMod)mods.get(i))
  979. .getMinimumTemperature();
  980. i++;
  981. }
  982. return result;
  983. }
  984. public static double getMaximumTemperature() {
  985. double result = BiomeTerrainValues.maxTemperature.doubleValue();
  986. for (int i = 0; (i < mods.size()) &&
  987. (result == BiomeTerrainValues.maxTemperature.doubleValue()); )
  988. {
  989. result = ((BiomeTerrainBaseMod)mods.get(i))
  990. .getMaximumTemperature();
  991. i++;
  992. }
  993. return result;
  994. }
  995. public static double getMinimumMoisture() {
  996. double result = BiomeTerrainValues.minMoisture.doubleValue();
  997. for (int i = 0; (i < mods.size()) &&
  998. (result == BiomeTerrainValues.minMoisture.doubleValue()); )
  999. {
  1000. result = ((BiomeTerrainBaseMod)mods.get(i)).getMinimumMoisture();
  1001. i++;
  1002. }
  1003. return result;
  1004. }
  1005. public static double getMaximumMoisture() {
  1006. double result = BiomeTerrainValues.maxMoisture.doubleValue();
  1007. for (int i = 0; (i < mods.size()) &&
  1008. (result == BiomeTerrainValues.maxMoisture.doubleValue()); )
  1009. {
  1010. result = ((BiomeTerrainBaseMod)mods.get(i)).getMaximumMoisture();
  1011. i++;
  1012. }
  1013. return result;
  1014. }
  1015. public static double getSnowThreshold() {
  1016. double result = BiomeTerrainValues.snowThreshold.doubleValue();
  1017. for (int i = 0; (i < mods.size()) &&
  1018. (result == BiomeTerrainValues.snowThreshold.doubleValue()); )
  1019. {
  1020. result = ((BiomeTerrainBaseMod)mods.get(i)).getSnowThreshold();
  1021. i++;
  1022. }
  1023. return result;
  1024. }
  1025. public static double getIceThreshold() {
  1026. double result = BiomeTerrainValues.iceThreshold.doubleValue();
  1027. for (int i = 0; (i < mods.size()) &&
  1028. (result == BiomeTerrainValues.iceThreshold.doubleValue()); )
  1029. {
  1030. result = ((BiomeTerrainBaseMod)mods.get(i)).getIceThreshold();
  1031. i++;
  1032. }
  1033. return result;
  1034. }
  1035. public static int getWaterLevel()
  1036. {
  1037. int result = BiomeTerrainValues.waterLevel.intValue();
  1038. for (int i = 0; (i < mods.size()) &&
  1039. (result == BiomeTerrainValues.waterLevel.intValue()); )
  1040. {
  1041. result = ((BiomeTerrainBaseMod)mods.get(i)).getWaterLevel();
  1042. i++;
  1043. }
  1044. return result;
  1045. }
  1046. public static double getMaxAverageHeight() {
  1047. double result = BiomeTerrainValues.maxAverageHeight.doubleValue();
  1048. for (int i = 0; (i < mods.size()) &&
  1049. (result == BiomeTerrainValues.maxAverageHeight.doubleValue()); )
  1050. {
  1051. result = ((BiomeTerrainBaseMod)mods.get(i)).getMaxAverageHeight();
  1052. i++;
  1053. }
  1054. return result;
  1055. }
  1056. public static double getMaxAverageDepth() {
  1057. double result = BiomeTerrainValues.maxAverageDepth.doubleValue();
  1058. for (int i = 0; (i < mods.size()) &&
  1059. (result == BiomeTerrainValues.maxAverageDepth.doubleValue()); )
  1060. {
  1061. result = ((BiomeTerrainBaseMod)mods.get(i)).getMaxAverageDepth();
  1062. i++;
  1063. }
  1064. return result;
  1065. }
  1066. public static double getFractureHorizontal() {
  1067. double result = BiomeTerrainValues.fractureHorizontal.doubleValue() + 1.0D;
  1068. for (int i = 0; (i < mods.size()) &&
  1069. (result == BiomeTerrainValues.fractureHorizontal
  1070. .doubleValue() + 1.0D); )
  1071. {
  1072. result = ((BiomeTerrainBaseMod)mods.get(i))
  1073. .getFractureHorizontal();
  1074. i++;
  1075. }
  1076. return result;
  1077. }
  1078. public static double getFractureVertical() {
  1079. double result = BiomeTerrainValues.fractureVertical.doubleValue() + 1.0D;
  1080. for (int i = 0; (i < mods.size()) &&
  1081. (result == BiomeTerrainValues.fractureVertical.doubleValue() + 1.0D); )
  1082. {
  1083. result = ((BiomeTerrainBaseMod)mods.get(i)).getFractureVertical();
  1084. i++;
  1085. }
  1086. return result;
  1087. }
  1088. public static double getVolatility1() {
  1089. double result = BiomeTerrainValues.volatility1.doubleValue() + 1.0D;
  1090. for (int i = 0; (i < mods.size()) &&
  1091. (result == BiomeTerrainValues.volatility1.doubleValue() + 1.0D); )
  1092. {
  1093. result = ((BiomeTerrainBaseMod)mods.get(i)).getVolatility1();
  1094. i++;
  1095. }
  1096. return result;
  1097. }
  1098. public static double getVolatility2() {
  1099. double result = BiomeTerrainValues.volatility2.doubleValue() + 1.0D;
  1100. for (int i = 0; (i < mods.size()) &&
  1101. (result == BiomeTerrainValues.volatility2.doubleValue() + 1.0D); )
  1102. {
  1103. result = ((BiomeTerrainBaseMod)mods.get(i)).getVolatility2();
  1104. i++;
  1105. }
  1106. return result;
  1107. }
  1108. public static double getVolatilityWeight1() {
  1109. double result = (BiomeTerrainValues.volatilityWeight1.doubleValue() - 0.5D) * 24.0D;
  1110. for (int i = 0; (i < mods.size()) &&
  1111. (result ==
  1112. (BiomeTerrainValues.volatilityWeight1
  1113. .doubleValue() - 0.5D) * 24.0D); )
  1114. {
  1115. result = ((BiomeTerrainBaseMod)mods.get(i)).getVolatilityWeight1();
  1116. i++;
  1117. }
  1118. return result;
  1119. }
  1120. public static double getVolatilityWeight2() {
  1121. double result = (0.5D - BiomeTerrainValues.volatilityWeight2
  1122. .doubleValue()) * 24.0D;
  1123. for (int i = 0; (i < mods.size()) &&
  1124. (result ==
  1125. (0.5D - BiomeTerrainValues.volatilityWeight2
  1126. .doubleValue()) * 24.0D); )
  1127. {
  1128. result = ((BiomeTerrainBaseMod)mods.get(i)).getVolatilityWeight2();
  1129. i++;
  1130. }
  1131. return result;
  1132. }
  1133. public static boolean createadminium(int y) {
  1134. for (int i = 0; i < mods.size(); i++) {
  1135. boolean d = ((BiomeTerrainBaseMod)mods.get(i)).createadminium(y);
  1136. if (!d)
  1137. return d;
  1138. }
  1139. return true;
  1140. }
  1141. public static byte getadminium() {
  1142. byte result = BiomeTerrainValues.adminium.byteValue().byteValue();
  1143. for (int i = 0; (i < mods.size()) &&
  1144. (result == BiomeTerrainValues.adminium.byteValue().byteValue()); )
  1145. {
  1146. result = ((BiomeTerrainBaseMod)mods.get(i)).getadminium();
  1147. i++;
  1148. }
  1149. return result;
  1150. }
  1151. public static boolean getCustomObjects() {
  1152. for (int i = 0; i < mods.size(); i++) {
  1153. boolean d = ((BiomeTerrainBaseMod)mods.get(i)).getCustomObjects();
  1154. if (d)
  1155. return d;
  1156. }
  1157. return false;
  1158. }
  1159. public static boolean getNotchBiomeTrees() {
  1160. for (int i = 0; i < mods.size(); i++) {
  1161. boolean d = ((BiomeTerrainBaseMod)mods.get(i)).getNotchBiomeTrees();
  1162. if (d)
  1163. return d;
  1164. }
  1165. return false;
  1166. }
  1167. public static int getObjectSpawnRatio() {
  1168. for (int i = 0; i < mods.size(); i++) {
  1169. int d = ((BiomeTerrainBaseMod)mods.get(i)).getObjectSpawnRatio();
  1170. if (d != 1)
  1171. return d;
  1172. }
  1173. return 1;
  1174. }
  1175. public static boolean getDisableNotchPonds() {
  1176. for (int i = 0; i < mods.size(); i++) {
  1177. boolean d = ((BiomeTerrainBaseMod)mods.get(i)).getDisableNotchPonds();
  1178. if (d)
  1179. return d;
  1180. }
  1181. return false;
  1182. }
  1183. public static int processTrees(gb biome, int treeDensity, int treeDensityVariation)
  1184. {
  1185. rainforestDefault = BiomeTerrain.seasonalforestDefault = BiomeTerrain.forestDefault = BiomeTerrain.taigaDefault = BiomeTerrain.desertDefault = BiomeTerrain.plainsDefault = BiomeTerrain.tundraDefault = true;
  1186. int result = treeDensity;
  1187. currentBiome = biome;
  1188. for (int i = 0; (i < mods.size()) &&
  1189. (result == treeDensity); )
  1190. {
  1191. result = ((BiomeTerrainBaseMod)mods.get(i)).processTrees(
  1192. treeDensity, treeDensityVariation);
  1193. i++;
  1194. }
  1195. processOriginalTrees(treeDensity, treeDensityVariation);
  1196. return result;
  1197. }
  1198. public static int getCaveRarity()
  1199. {
  1200. int result = BiomeTerrainValues.caveRarity.intValue();
  1201. for (int i = 0; (i < mods.size()) &&
  1202. (result == BiomeTerrainValues.caveRarity.intValue()); )
  1203. {
  1204. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveRarity();
  1205. i++;
  1206. }
  1207. return result;
  1208. }
  1209. public static int getCaveFrequency() {
  1210. int result = BiomeTerrainValues.caveFrequency.intValue();
  1211. for (int i = 0; (i < mods.size()) &&
  1212. (result == BiomeTerrainValues.caveFrequency.intValue()); )
  1213. {
  1214. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveFrequency();
  1215. i++;
  1216. }
  1217. return result;
  1218. }
  1219. public static int getCaveMinAltitude() {
  1220. int result = BiomeTerrainValues.caveMinAltitude.intValue();
  1221. for (int i = 0; (i < mods.size()) &&
  1222. (result == BiomeTerrainValues.caveMinAltitude.intValue()); )
  1223. {
  1224. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveMinAltitude();
  1225. i++;
  1226. }
  1227. return result;
  1228. }
  1229. public static int getCaveMaxAltitude() {
  1230. int result = BiomeTerrainValues.caveMaxAltitude.intValue();
  1231. for (int i = 0; (i < mods.size()) &&
  1232. (result == BiomeTerrainValues.caveMaxAltitude.intValue()); )
  1233. {
  1234. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveMaxAltitude();
  1235. i++;
  1236. }
  1237. return result;
  1238. }
  1239. public static int getIndividualCaveRarity() {
  1240. int result = BiomeTerrainValues.individualCaveRarity.intValue();
  1241. for (int i = 0; (i < mods.size()) &&
  1242. (result == BiomeTerrainValues.individualCaveRarity.intValue()); )
  1243. {
  1244. result = ((BiomeTerrainBaseMod)mods.get(i)).getIndividualCaveRarity();
  1245. i++;
  1246. }
  1247. return result;
  1248. }
  1249. public static int getCaveSystemFrequency() {
  1250. int result = BiomeTerrainValues.caveSystemFrequency.intValue();
  1251. for (int i = 0; (i < mods.size()) &&
  1252. (result == BiomeTerrainValues.caveSystemFrequency.intValue()); )
  1253. {
  1254. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveSystemFrequency();
  1255. i++;
  1256. }
  1257. return result;
  1258. }
  1259. public static int getCaveSystemPocketChance() {
  1260. int result = BiomeTerrainValues.caveSystemPocketChance.intValue();
  1261. for (int i = 0; (i < mods.size()) &&
  1262. (result == BiomeTerrainValues.caveSystemPocketChance.intValue()); )
  1263. {
  1264. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveSystemPocketChance();
  1265. i++;
  1266. }
  1267. return result;
  1268. }
  1269. public static int getCaveSystemPocketMinSize() {
  1270. int result = BiomeTerrainValues.caveSystemPocketMinSize.intValue();
  1271. for (int i = 0; (i < mods.size()) &&
  1272. (result == BiomeTerrainValues.caveSystemPocketMinSize.intValue()); )
  1273. {
  1274. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveSystemPocketMinSize();
  1275. i++;
  1276. }
  1277. return result;
  1278. }
  1279. public static int getCaveSystemPocketMaxSize() {
  1280. int result = BiomeTerrainValues.caveSystemPocketMaxSize.intValue();
  1281. for (int i = 0; (i < mods.size()) &&
  1282. (result == BiomeTerrainValues.caveSystemPocketMaxSize.intValue()); )
  1283. {
  1284. result = ((BiomeTerrainBaseMod)mods.get(i)).getCaveSystemPocketMaxSize();
  1285. i++;
  1286. }
  1287. return result;
  1288. }
  1289. public static boolean getEvenCaveDistribution() {
  1290. boolean result = BiomeTerrainValues.evenCaveDistribution.booleanValue().booleanValue();
  1291. for (int i = 0; (i < mods.size()) &&
  1292. (result == BiomeTerrainValues.evenCaveDistribution.booleanValue().booleanValue()); )
  1293. {
  1294. result = ((BiomeTerrainBaseMod)mods.get(i)).getEvenCaveDistribution();
  1295. i++;
  1296. }
  1297. return result;
  1298. }
  1299. public static int getLavaLevelMin() {
  1300. int result = BiomeTerrainValues.lavaLevelMin.intValue();
  1301. for (int i = 0; (i < mods.size()) &&
  1302. (result == BiomeTerrainValues.lavaLevelMin.intValue()); )
  1303. {
  1304. result = ((BiomeTerrainBaseMod)mods.get(i)).getLavaLevelMin();
  1305. i++;
  1306. }
  1307. return result;
  1308. }
  1309. public static int getLavaLevelMax() {
  1310. int result = BiomeTerrainValues.lavaLevelMax.intValue();
  1311. for (int i = 0; (i < mods.size()) &&
  1312. (result == BiomeTerrainValues.lavaLevelMax.intValue()); )
  1313. {
  1314. result = ((BiomeTerrainBaseMod)mods.get(i)).getLavaLevelMax();
  1315. i++;
  1316. }
  1317. return result;
  1318. }
  1319. public static void processUndergroundLakes(int x, int z)
  1320. {
  1321. for (int i = 0; i < mods.size(); i++)
  1322. ((BiomeTerrainBaseMod)mods.get(i)).processUndergroundLakes(x, z);
  1323. }
  1324. }