pryingtuna85649

OzGenLayerBiome

May 12th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. package com.wizardofoz.basic.world.gen.layer;
  2.  
  3. import com.wizardofoz.basic.biome.OzBiome;
  4.  
  5. import net.minecraft.world.WorldType;
  6. import net.minecraft.world.biome.BiomeGenBase;
  7. import net.minecraft.world.gen.layer.GenLayer;
  8. import net.minecraft.world.gen.layer.IntCache;
  9.  
  10. public class OzGenLayerBiome extends GenLayer {
  11.  
  12. private BiomeGenBase[] field_151623_c;
  13. private BiomeGenBase[] field_151621_d;
  14. private BiomeGenBase[] field_151622_e;
  15. private BiomeGenBase[] field_151620_f;
  16. private static final String __OBFID = "CL_00000555";
  17.  
  18. public OzGenLayerBiome(long par1, GenLayer par3GenLayer, WorldType par4WorldType) {
  19. super(par1);
  20. this.field_151623_c = new BiomeGenBase[] {OzBiome.GillikinBiome, OzBiome.WinkiesBiomes, OzBiome.GillikinBiome, OzBiome.WinkiesBiomes, OzBiome.GillikinBiome, OzBiome.WinkiesBiomes};
  21. this.field_151621_d = new BiomeGenBase[] {OzBiome.GillikinBiome, OzBiome.WinkiesBiomes, OzBiome.GillikinBiome, OzBiome.WinkiesBiomes, OzBiome.GillikinBiome, OzBiome.WinkiesBiomes};
  22. this.field_151622_e = new BiomeGenBase[] {OzBiome.GillikinBiome, OzBiome.WinkiesBiomes, OzBiome.GillikinBiome, OzBiome.WinkiesBiomes, OzBiome.GillikinBiome, OzBiome.WinkiesBiomes};
  23. this.field_151620_f = new BiomeGenBase[] {OzBiome.GillikinBiome, OzBiome.WinkiesBiomes, OzBiome.GillikinBiome, OzBiome.WinkiesBiomes, OzBiome.GillikinBiome, OzBiome.WinkiesBiomes};
  24. this.parent = par3GenLayer;
  25.  
  26. if (par4WorldType == WorldType.DEFAULT_1_1) {
  27.  
  28. this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga};
  29. }
  30.  
  31. }
  32.  
  33. /**
  34. * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
  35. * amounts, or biomeList[] indices based on the particular GenLayer subclass.
  36. */
  37. public int[] getInts(int par1, int par2, int par3, int par4)
  38. {
  39. int[] aint = this.parent.getInts(par1, par2, par3, par4);
  40. int[] aint1 = IntCache.getIntCache(par3 * par4);
  41.  
  42. for (int i1 = 0; i1 < par4; ++i1)
  43. {
  44. for (int j1 = 0; j1 < par3; ++j1)
  45. {
  46. this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));
  47. int k1 = aint[j1 + i1 * par3];
  48. int l1 = (k1 & 3840) >> 8;
  49. k1 &= -3841;
  50.  
  51. if (isBiomeOceanic(k1))
  52. {
  53. aint1[j1 + i1 * par3] = k1;
  54. }
  55. else if (k1 == BiomeGenBase.mushroomIsland.biomeID)
  56. {
  57. aint1[j1 + i1 * par3] = k1;
  58. }
  59. else if (k1 == 1)
  60. {
  61. if (l1 > 0)
  62. {
  63. if (this.nextInt(3) == 0)
  64. {
  65. aint1[j1 + i1 * par3] = BiomeGenBase.mesaPlateau.biomeID;
  66. }
  67. else
  68. {
  69. aint1[j1 + i1 * par3] = BiomeGenBase.mesaPlateau_F.biomeID;
  70. }
  71. }
  72. else
  73. {
  74. aint1[j1 + i1 * par3] = this.field_151623_c[this.nextInt(this.field_151623_c.length)].biomeID;
  75. }
  76. }
  77. else if (k1 == 2)
  78. {
  79. if (l1 > 0)
  80. {
  81. aint1[j1 + i1 * par3] = BiomeGenBase.jungle.biomeID;
  82. }
  83. else
  84. {
  85. aint1[j1 + i1 * par3] = this.field_151621_d[this.nextInt(this.field_151621_d.length)].biomeID;
  86. }
  87. }
  88. else if (k1 == 3)
  89. {
  90. if (l1 > 0)
  91. {
  92. aint1[j1 + i1 * par3] = BiomeGenBase.megaTaiga.biomeID;
  93. }
  94. else
  95. {
  96. aint1[j1 + i1 * par3] = this.field_151622_e[this.nextInt(this.field_151622_e.length)].biomeID;
  97. }
  98. }
  99. else if (k1 == 4)
  100. {
  101. aint1[j1 + i1 * par3] = this.field_151620_f[this.nextInt(this.field_151620_f.length)].biomeID;
  102. }
  103. else
  104. {
  105. aint1[j1 + i1 * par3] = BiomeGenBase.mushroomIsland.biomeID;
  106. }
  107. }
  108. }
  109.  
  110. return aint1;
  111. }
  112. }
Advertisement
Add Comment
Please, Sign In to add comment