| 1 | package net.minecraft.world.gen;
|
| 2 |
|
| 3 | import java.util.List;
|
| 4 | import java.util.Random;
|
| 5 | import net.minecraft.block.BlockFalling;
|
| 6 | import net.minecraft.block.material.Material;
|
| 7 | import net.minecraft.block.state.IBlockState;
|
| 8 | import net.minecraft.block.state.pattern.BlockHelper;
|
| 9 | import net.minecraft.entity.EnumCreatureType;
|
| 10 | import net.minecraft.init.Blocks;
|
| 11 | import net.minecraft.util.BlockPos;
|
| 12 | import net.minecraft.util.IProgressUpdate;
|
| 13 | import net.minecraft.util.MathHelper;
|
| 14 | import net.minecraft.world.ChunkCoordIntPair;
|
| 15 | import net.minecraft.world.World;
|
| 16 | import net.minecraft.world.biome.BiomeGenBase;
|
| 17 | import net.minecraft.world.chunk.Chunk;
|
| 18 | import net.minecraft.world.chunk.ChunkPrimer;
|
| 19 | import net.minecraft.world.chunk.IChunkProvider;
|
| 20 | import net.minecraft.world.gen.feature.WorldGenFire;
|
| 21 | import net.minecraft.world.gen.feature.WorldGenGlowStone1;
|
| 22 | import net.minecraft.world.gen.feature.WorldGenGlowStone2;
|
| 23 | import net.minecraft.world.gen.feature.WorldGenHellLava;
|
| 24 | import net.minecraft.world.gen.feature.WorldGenMinable;
|
| 25 | import net.minecraft.world.gen.feature.WorldGenerator;
|
| 26 | import net.minecraft.world.gen.structure.MapGenNetherBridge;
|
| 27 |
|
| 28 | public class ChunkProviderHell implements IChunkProvider
|
| 29 | {
|
| 30 | /** Is the world that the nether is getting generated. */
|
| 31 | private final World worldObj;
|
| 32 | private final boolean field_177466_i;
|
| 33 | private final Random hellRNG;
|
| 34 |
|
| 35 | /**
|
| 36 | * Holds the noise used to determine whether slowsand can be generated at a location
|
| 37 | */
|
| 38 | private double[] slowsandNoise = new double[256];
|
| 39 | private double[] gravelNoise = new double[256];
|
| 40 |
|
| 41 | /**
|
| 42 | * Holds the noise used to determine whether something other than netherrack can be generated at a location
|
| 43 | */
|
| 44 | private double[] netherrackExclusivityNoise = new double[256];
|
| 45 | private double[] noiseField;
|
| 46 |
|
| 47 | /** A NoiseGeneratorOctaves used in generating nether terrain */
|
| 48 | private final NoiseGeneratorOctaves netherNoiseGen1;
|
| 49 | private final NoiseGeneratorOctaves netherNoiseGen2;
|
| 50 | private final NoiseGeneratorOctaves netherNoiseGen3;
|
| 51 |
|
| 52 | /** Determines whether slowsand or gravel can be generated at a location */
|
| 53 | private final NoiseGeneratorOctaves slowsandGravelNoiseGen;
|
| 54 |
|
| 55 | /**
|
| 56 | * Determines whether something other than nettherack can be generated at a location
|
| 57 | */
|
| 58 | private final NoiseGeneratorOctaves netherrackExculsivityNoiseGen;
|
| 59 | public final NoiseGeneratorOctaves netherNoiseGen6;
|
| 60 | public final NoiseGeneratorOctaves netherNoiseGen7;
|
| 61 | private final WorldGenFire field_177470_t = new WorldGenFire();
|
| 62 | private final WorldGenGlowStone1 field_177469_u = new WorldGenGlowStone1();
|
| 63 | private final WorldGenGlowStone2 field_177468_v = new WorldGenGlowStone2();
|
| 64 | private final WorldGenerator field_177467_w = new WorldGenMinable(Blocks.quartz_ore.getDefaultState(), 14, BlockHelper.forBlock(Blocks.netherrack));
|
| 65 | private final WorldGenHellLava field_177473_x = new WorldGenHellLava(Blocks.flowing_lava, true);
|
| 66 | private final WorldGenHellLava field_177472_y = new WorldGenHellLava(Blocks.flowing_lava, false);
|
| 67 | private final GeneratorBushFeature field_177471_z = new GeneratorBushFeature(Blocks.brown_mushroom);
|
| 68 | private final GeneratorBushFeature field_177465_A = new GeneratorBushFeature(Blocks.red_mushroom);
|
| 69 | private final MapGenNetherBridge genNetherBridge = new MapGenNetherBridge();
|
| 70 | private final MapGenBase netherCaveGenerator = new MapGenCavesHell();
|
| 71 | double[] noiseData1;
|
| 72 | double[] noiseData2;
|
| 73 | double[] noiseData3;
|
| 74 | double[] noiseData4;
|
| 75 | double[] noiseData5;
|
| 76 |
|
| 77 | public ChunkProviderHell(World worldIn, boolean p_i45637_2_, long seed)
|
| 78 | {
|
| 79 | this.worldObj = worldIn;
|
| 80 | this.field_177466_i = p_i45637_2_;
|
| 81 | this.hellRNG = new Random(seed);
|
| 82 | this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16);
|
| 83 | this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16);
|
| 84 | this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8);
|
| 85 | this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4);
|
| 86 | this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4);
|
| 87 | this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10);
|
| 88 | this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16);
|
| 89 | worldIn.setSeaLevel(63);
|
| 90 | }
|
| 91 |
|
| 92 | public void func_180515_a(int p_180515_1_, int p_180515_2_, ChunkPrimer p_180515_3_)
|
| 93 | {
|
| 94 | int i = 4;
|
| 95 | int j = this.worldObj.getSeaLevel() / 2 + 1;
|
| 96 | int k = i + 1;
|
| 97 | int l = 17;
|
| 98 | int i1 = i + 1;
|
| 99 | this.noiseField = this.initializeNoiseField(this.noiseField, p_180515_1_ * i, 0, p_180515_2_ * i, k, l, i1);
|
| 100 |
|
| 101 | for (int j1 = 0; j1 < i; ++j1)
|
| 102 | {
|
| 103 | for (int k1 = 0; k1 < i; ++k1)
|
| 104 | {
|
| 105 | for (int l1 = 0; l1 < 16; ++l1)
|
| 106 | {
|
| 107 | double d0 = 0.125D;
|
| 108 | double d1 = this.noiseField[((j1 + 0) * i1 + k1 + 0) * l + l1 + 0];
|
| 109 | double d2 = this.noiseField[((j1 + 0) * i1 + k1 + 1) * l + l1 + 0];
|
| 110 | double d3 = this.noiseField[((j1 + 1) * i1 + k1 + 0) * l + l1 + 0];
|
| 111 | double d4 = this.noiseField[((j1 + 1) * i1 + k1 + 1) * l + l1 + 0];
|
| 112 | double d5 = (this.noiseField[((j1 + 0) * i1 + k1 + 0) * l + l1 + 1] - d1) * d0;
|
| 113 | double d6 = (this.noiseField[((j1 + 0) * i1 + k1 + 1) * l + l1 + 1] - d2) * d0;
|
| 114 | double d7 = (this.noiseField[((j1 + 1) * i1 + k1 + 0) * l + l1 + 1] - d3) * d0;
|
| 115 | double d8 = (this.noiseField[((j1 + 1) * i1 + k1 + 1) * l + l1 + 1] - d4) * d0;
|
| 116 |
|
| 117 | for (int i2 = 0; i2 < 8; ++i2)
|
| 118 | {
|
| 119 | double d9 = 0.25D;
|
| 120 | double d10 = d1;
|
| 121 | double d11 = d2;
|
| 122 | double d12 = (d3 - d1) * d9;
|
| 123 | double d13 = (d4 - d2) * d9;
|
| 124 |
|
| 125 | for (int j2 = 0; j2 < 4; ++j2)
|
| 126 | {
|
| 127 | double d14 = 0.25D;
|
| 128 | double d15 = d10;
|
| 129 | double d16 = (d11 - d10) * d14;
|
| 130 |
|
| 131 | for (int k2 = 0; k2 < 4; ++k2)
|
| 132 | {
|
| 133 | IBlockState iblockstate = null;
|
| 134 |
|
| 135 | if (l1 * 8 + i2 < j)
|
| 136 | {
|
| 137 | iblockstate = Blocks.lava.getDefaultState();
|
| 138 | }
|
| 139 |
|
| 140 | if (d15 > 0.0D)
|
| 141 | {
|
| 142 | iblockstate = Blocks.netherrack.getDefaultState();
|
| 143 | }
|
| 144 |
|
| 145 | int l2 = j2 + j1 * 4;
|
| 146 | int i3 = i2 + l1 * 8;
|
| 147 | int j3 = k2 + k1 * 4;
|
| 148 | p_180515_3_.setBlockState(l2, i3, j3, iblockstate);
|
| 149 | d15 += d16;
|
| 150 | }
|
| 151 |
|
| 152 | d10 += d12;
|
| 153 | d11 += d13;
|
| 154 | }
|
| 155 |
|
| 156 | d1 += d5;
|
| 157 | d2 += d6;
|
| 158 | d3 += d7;
|
| 159 | d4 += d8;
|
| 160 | }
|
| 161 | }
|
| 162 | }
|
| 163 | }
|
| 164 | }
|
| 165 |
|
| 166 | public void func_180516_b(int p_180516_1_, int p_180516_2_, ChunkPrimer p_180516_3_)
|
| 167 | {
|
| 168 | int i = this.worldObj.getSeaLevel() + 1;
|
| 169 | double d0 = 0.03125D;
|
| 170 | this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, p_180516_1_ * 16, p_180516_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D);
|
| 171 | this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, p_180516_1_ * 16, 109, p_180516_2_ * 16, 16, 1, 16, d0, 1.0D, d0);
|
| 172 | this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, p_180516_1_ * 16, p_180516_2_ * 16, 0, 16, 16, 1, d0 * 2.0D, d0 * 2.0D, d0 * 2.0D);
|
| 173 |
|
| 174 | for (int j = 0; j < 16; ++j)
|
| 175 | {
|
| 176 | for (int k = 0; k < 16; ++k)
|
| 177 | {
|
| 178 | boolean flag = this.slowsandNoise[j + k * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D;
|
| 179 | boolean flag1 = this.gravelNoise[j + k * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D;
|
| 180 | int l = (int)(this.netherrackExclusivityNoise[j + k * 16] / 3.0D + 3.0D + this.hellRNG.nextDouble() * 0.25D);
|
| 181 | int i1 = -1;
|
| 182 | IBlockState iblockstate = Blocks.netherrack.getDefaultState();
|
| 183 | IBlockState iblockstate1 = Blocks.netherrack.getDefaultState();
|
| 184 |
|
| 185 | for (int j1 = 127; j1 >= 0; --j1)
|
| 186 | {
|
| 187 | if (j1 < 127 - this.hellRNG.nextInt(5) && j1 > this.hellRNG.nextInt(5))
|
| 188 | {
|
| 189 | IBlockState iblockstate2 = p_180516_3_.getBlockState(k, j1, j);
|
| 190 |
|
| 191 | if (iblockstate2.getBlock() != null && iblockstate2.getBlock().getMaterial() != Material.air)
|
| 192 | {
|
| 193 | if (iblockstate2.getBlock() == Blocks.netherrack)
|
| 194 | {
|
| 195 | if (i1 == -1)
|
| 196 | {
|
| 197 | if (l <= 0)
|
| 198 | {
|
| 199 | iblockstate = null;
|
| 200 | iblockstate1 = Blocks.netherrack.getDefaultState();
|
| 201 | }
|
| 202 | else if (j1 >= i - 4 && j1 <= i + 1)
|
| 203 | {
|
| 204 | iblockstate = Blocks.netherrack.getDefaultState();
|
| 205 | iblockstate1 = Blocks.netherrack.getDefaultState();
|
| 206 |
|
| 207 | if (flag1)
|
| 208 | {
|
| 209 | iblockstate = Blocks.gravel.getDefaultState();
|
| 210 | iblockstate1 = Blocks.netherrack.getDefaultState();
|
| 211 | }
|
| 212 |
|
| 213 | if (flag)
|
| 214 | {
|
| 215 | iblockstate = Blocks.soul_sand.getDefaultState();
|
| 216 | iblockstate1 = Blocks.soul_sand.getDefaultState();
|
| 217 | }
|
| 218 | }
|
| 219 |
|
| 220 | if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air))
|
| 221 | {
|
| 222 | iblockstate = Blocks.lava.getDefaultState();
|
| 223 | }
|
| 224 |
|
| 225 | i1 = l;
|
| 226 |
|
| 227 | if (j1 >= i - 1)
|
| 228 | {
|
| 229 | p_180516_3_.setBlockState(k, j1, j, iblockstate);
|
| 230 | }
|
| 231 | else
|
| 232 | {
|
| 233 | p_180516_3_.setBlockState(k, j1, j, iblockstate1);
|
| 234 | }
|
| 235 | }
|
| 236 | else if (i1 > 0)
|
| 237 | {
|
| 238 | --i1;
|
| 239 | p_180516_3_.setBlockState(k, j1, j, iblockstate1);
|
| 240 | }
|
| 241 | }
|
| 242 | }
|
| 243 | else
|
| 244 | {
|
| 245 | i1 = -1;
|
| 246 | }
|
| 247 | }
|
| 248 | else
|
| 249 | {
|
| 250 | p_180516_3_.setBlockState(k, j1, j, Blocks.bedrock.getDefaultState());
|
| 251 | }
|
| 252 | }
|
| 253 | }
|
| 254 | }
|
| 255 | }
|
| 256 |
|
| 257 | /**
|
| 258 | * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
|
| 259 | * specified chunk from the map seed and chunk seed
|
| 260 | */
|
| 261 | public Chunk provideChunk(int x, int z)
|
| 262 | {
|
| 263 | this.hellRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
|
| 264 | ChunkPrimer chunkprimer = new ChunkPrimer();
|
| 265 | this.func_180515_a(x, z, chunkprimer);
|
| 266 | this.func_180516_b(x, z, chunkprimer);
|
| 267 | this.netherCaveGenerator.generate(this, this.worldObj, x, z, chunkprimer);
|
| 268 |
|
| 269 | if (this.field_177466_i)
|
| 270 | {
|
| 271 | this.genNetherBridge.generate(this, this.worldObj, x, z, chunkprimer);
|
| 272 | }
|
| 273 |
|
| 274 | Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
|
| 275 | BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, x * 16, z * 16, 16, 16);
|
| 276 | byte[] abyte = chunk.getBiomeArray();
|
| 277 |
|
| 278 | for (int i = 0; i < abyte.length; ++i)
|
| 279 | {
|
| 280 | abyte[i] = (byte)abiomegenbase[i].biomeID;
|
| 281 | }
|
| 282 |
|
| 283 | chunk.resetRelightChecks();
|
| 284 | return chunk;
|
| 285 | }
|
| 286 |
|
| 287 | /**
|
| 288 | * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the
|
| 289 | * size.
|
| 290 | */
|
| 291 | private double[] initializeNoiseField(double[] p_73164_1_, int p_73164_2_, int p_73164_3_, int p_73164_4_, int p_73164_5_, int p_73164_6_, int p_73164_7_)
|
| 292 | {
|
| 293 | if (p_73164_1_ == null)
|
| 294 | {
|
| 295 | p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_];
|
| 296 | }
|
| 297 |
|
| 298 | double d0 = 684.412D;
|
| 299 | double d1 = 2053.236D;
|
| 300 | this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, 1, p_73164_7_, 1.0D, 0.0D, 1.0D);
|
| 301 | this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, 1, p_73164_7_, 100.0D, 0.0D, 100.0D);
|
| 302 | this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, d0 / 80.0D, d1 / 60.0D, d0 / 80.0D);
|
| 303 | this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, d0, d1, d0);
|
| 304 | this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, d0, d1, d0);
|
| 305 | int i = 0;
|
| 306 | double[] adouble = new double[p_73164_6_];
|
| 307 |
|
| 308 | for (int j = 0; j < p_73164_6_; ++j)
|
| 309 | {
|
| 310 | adouble[j] = Math.cos((double)j * Math.PI * 6.0D / (double)p_73164_6_) * 2.0D;
|
| 311 | double d2 = (double)j;
|
| 312 |
|
| 313 | if (j > p_73164_6_ / 2)
|
| 314 | {
|
| 315 | d2 = (double)(p_73164_6_ - 1 - j);
|
| 316 | }
|
| 317 |
|
| 318 | if (d2 < 4.0D)
|
| 319 | {
|
| 320 | d2 = 4.0D - d2;
|
| 321 | adouble[j] -= d2 * d2 * d2 * 10.0D;
|
| 322 | }
|
| 323 | }
|
| 324 |
|
| 325 | for (int l = 0; l < p_73164_5_; ++l)
|
| 326 | {
|
| 327 | for (int i1 = 0; i1 < p_73164_7_; ++i1)
|
| 328 | {
|
| 329 | double d3 = 0.0D;
|
| 330 |
|
| 331 | for (int k = 0; k < p_73164_6_; ++k)
|
| 332 | {
|
| 333 | double d4 = 0.0D;
|
| 334 | double d5 = adouble[k];
|
| 335 | double d6 = this.noiseData2[i] / 512.0D;
|
| 336 | double d7 = this.noiseData3[i] / 512.0D;
|
| 337 | double d8 = (this.noiseData1[i] / 10.0D + 1.0D) / 2.0D;
|
| 338 |
|
| 339 | if (d8 < 0.0D)
|
| 340 | {
|
| 341 | d4 = d6;
|
| 342 | }
|
| 343 | else if (d8 > 1.0D)
|
| 344 | {
|
| 345 | d4 = d7;
|
| 346 | }
|
| 347 | else
|
| 348 | {
|
| 349 | d4 = d6 + (d7 - d6) * d8;
|
| 350 | }
|
| 351 |
|
| 352 | d4 = d4 - d5;
|
| 353 |
|
| 354 | if (k > p_73164_6_ - 4)
|
| 355 | {
|
| 356 | double d9 = (double)((float)(k - (p_73164_6_ - 4)) / 3.0F);
|
| 357 | d4 = d4 * (1.0D - d9) + -10.0D * d9;
|
| 358 | }
|
| 359 |
|
| 360 | if ((double)k < d3)
|
| 361 | {
|
| 362 | double d10 = (d3 - (double)k) / 4.0D;
|
| 363 | d10 = MathHelper.clamp_double(d10, 0.0D, 1.0D);
|
| 364 | d4 = d4 * (1.0D - d10) + -10.0D * d10;
|
| 365 | }
|
| 366 |
|
| 367 | p_73164_1_[i] = d4;
|
| 368 | ++i;
|
| 369 | }
|
| 370 | }
|
| 371 | }
|
| 372 |
|
| 373 | return p_73164_1_;
|
| 374 | }
|
| 375 |
|
| 376 | /**
|
| 377 | * Checks to see if a chunk exists at x, z
|
| 378 | */
|
| 379 | public boolean chunkExists(int x, int z)
|
| 380 | {
|
| 381 | return true;
|
| 382 | }
|
| 383 |
|
| 384 | /**
|
| 385 | * Populates chunk with ores etc etc
|
| 386 | */
|
| 387 | public void populate(IChunkProvider chunkProvider, int x, int z)
|
| 388 | {
|
| 389 | BlockFalling.fallInstantly = true;
|
| 390 | BlockPos blockpos = new BlockPos(x * 16, 0, z * 16);
|
| 391 | ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z);
|
| 392 | this.genNetherBridge.generateStructure(this.worldObj, this.hellRNG, chunkcoordintpair);
|
| 393 |
|
| 394 | for (int i = 0; i < 8; ++i)
|
| 395 | {
|
| 396 | this.field_177472_y.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8));
|
| 397 | }
|
| 398 |
|
| 399 | for (int j = 0; j < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; ++j)
|
| 400 | {
|
| 401 | this.field_177470_t.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8));
|
| 402 | }
|
| 403 |
|
| 404 | for (int k = 0; k < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); ++k)
|
| 405 | {
|
| 406 | this.field_177469_u.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8));
|
| 407 | }
|
| 408 |
|
| 409 | for (int l = 0; l < 10; ++l)
|
| 410 | {
|
| 411 | this.field_177468_v.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8));
|
| 412 | }
|
| 413 |
|
| 414 | if (this.hellRNG.nextBoolean())
|
| 415 | {
|
| 416 | this.field_177471_z.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8));
|
| 417 | }
|
| 418 |
|
| 419 | if (this.hellRNG.nextBoolean())
|
| 420 | {
|
| 421 | this.field_177465_A.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8));
|
| 422 | }
|
| 423 |
|
| 424 | for (int i1 = 0; i1 < 16; ++i1)
|
| 425 | {
|
| 426 | this.field_177467_w.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16)));
|
| 427 | }
|
| 428 |
|
| 429 | for (int j1 = 0; j1 < 16; ++j1)
|
| 430 | {
|
| 431 | this.field_177473_x.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16)));
|
| 432 | }
|
| 433 |
|
| 434 | BlockFalling.fallInstantly = false;
|
| 435 | }
|
| 436 |
|
| 437 | public boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z)
|
| 438 | {
|
| 439 | return false;
|
| 440 | }
|
| 441 |
|
| 442 | /**
|
| 443 | * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks.
|
| 444 | * Return true if all chunks have been saved.
|
| 445 | */
|
| 446 | public boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback)
|
| 447 | {
|
| 448 | return true;
|
| 449 | }
|
| 450 |
|
| 451 | /**
|
| 452 | * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently
|
| 453 | * unimplemented.
|
| 454 | */
|
| 455 | public void saveExtraData()
|
| 456 | {
|
| 457 | }
|
| 458 |
|
| 459 | /**
|
| 460 | * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk.
|
| 461 | */
|
| 462 | public boolean unloadQueuedChunks()
|
| 463 | {
|
| 464 | return false;
|
| 465 | }
|
| 466 |
|
| 467 | /**
|
| 468 | * Returns if the IChunkProvider supports saving.
|
| 469 | */
|
| 470 | public boolean canSave()
|
| 471 | {
|
| 472 | return true;
|
| 473 | }
|
| 474 |
|
| 475 | /**
|
| 476 | * Converts the instance data to a readable string.
|
| 477 | */
|
| 478 | public String makeString()
|
| 479 | {
|
| 480 | return "HellRandomLevelSource";
|
| 481 | }
|
| 482 |
|
| 483 | public List<BiomeGenBase.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
|
| 484 | {
|
| 485 | if (creatureType == EnumCreatureType.MONSTER)
|
| 486 | {
|
| 487 | if (this.genNetherBridge.func_175795_b(pos))
|
| 488 | {
|
| 489 | return this.genNetherBridge.getSpawnList();
|
| 490 | }
|
| 491 |
|
| 492 | if (this.genNetherBridge.isPositionInStructure(this.worldObj, pos) && this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.nether_brick)
|
| 493 | {
|
| 494 | return this.genNetherBridge.getSpawnList();
|
| 495 | }
|
| 496 | }
|
| 497 |
|
| 498 | BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(pos);
|
| 499 | return biomegenbase.getSpawnableList(creatureType);
|
| 500 | }
|
| 501 |
|
| 502 | public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position)
|
| 503 | {
|
| 504 | return null;
|
| 505 | }
|
| 506 |
|
| 507 | public int getLoadedChunkCount()
|
| 508 | {
|
| 509 | return 0;
|
| 510 | }
|
| 511 |
|
| 512 | public void recreateStructures(Chunk chunkIn, int x, int z)
|
| 513 | {
|
| 514 | this.genNetherBridge.generate(this, this.worldObj, x, z, (ChunkPrimer)null);
|
| 515 | }
|
| 516 |
|
| 517 | public Chunk provideChunk(BlockPos blockPosIn)
|
| 518 | {
|
| 519 | return this.provideChunk(blockPosIn.getX() >> 4, blockPosIn.getZ() >> 4);
|
| 520 | }
|
| 521 | }
|
| 522 |
|