9
9
10
10
import java .util .List ;
11
11
import java .util .Random ;
12
- import micdoodle8 .mods .galacticraft .api .prefab .world .gen .BiomeAdaptive ;
13
- import micdoodle8 .mods .galacticraft .api .prefab .world .gen .MapGenBaseMeta ;
14
- import micdoodle8 .mods .galacticraft .api .world .ChunkProviderBase ;
15
- import micdoodle8 .mods .galacticraft .core .perlin .generator .GradientNoise ;
16
- import micdoodle8 .mods .galacticraft .planets .venus .VenusBlocks ;
17
- import micdoodle8 .mods .galacticraft .planets .venus .blocks .BlockBasicVenus ;
18
- import micdoodle8 .mods .galacticraft .planets .venus .world .gen .dungeon .DungeonConfigurationVenus ;
19
- import micdoodle8 .mods .galacticraft .planets .venus .world .gen .dungeon .MapGenDungeonVenus ;
20
- import micdoodle8 .mods .galacticraft .planets .venus .world .gen .dungeon .RoomBossVenus ;
21
- import micdoodle8 .mods .galacticraft .planets .venus .world .gen .dungeon .RoomTreasureVenus ;
12
+
22
13
import net .minecraft .block .BlockFalling ;
23
14
import net .minecraft .block .state .IBlockState ;
24
15
import net .minecraft .entity .EnumCreatureType ;
35
26
import net .minecraft .world .gen .NoiseGeneratorOctaves ;
36
27
import net .minecraft .world .gen .NoiseGeneratorPerlin ;
37
28
29
+ import net .minecraftforge .event .ForgeEventFactory ;
30
+
31
+ import micdoodle8 .mods .galacticraft .api .prefab .world .gen .BiomeAdaptive ;
32
+ import micdoodle8 .mods .galacticraft .api .prefab .world .gen .MapGenBaseMeta ;
33
+ import micdoodle8 .mods .galacticraft .api .world .ChunkProviderBase ;
34
+ import micdoodle8 .mods .galacticraft .core .perlin .generator .GradientNoise ;
35
+ import micdoodle8 .mods .galacticraft .planets .venus .VenusBlocks ;
36
+ import micdoodle8 .mods .galacticraft .planets .venus .blocks .BlockBasicVenus ;
37
+ import micdoodle8 .mods .galacticraft .planets .venus .world .gen .dungeon .DungeonConfigurationVenus ;
38
+ import micdoodle8 .mods .galacticraft .planets .venus .world .gen .dungeon .MapGenDungeonVenus ;
39
+ import micdoodle8 .mods .galacticraft .planets .venus .world .gen .dungeon .RoomBossVenus ;
40
+ import micdoodle8 .mods .galacticraft .planets .venus .world .gen .dungeon .RoomTreasureVenus ;
41
+
38
42
public class ChunkProviderVenus extends ChunkProviderBase
39
43
{
40
44
@@ -86,7 +90,7 @@ public ChunkProviderVenus(World worldIn, long seed, boolean mapFeaturesEnabled)
86
90
{
87
91
for (int j = -2 ; j <= 2 ; ++j )
88
92
{
89
- float f = 10.0F / MathHelper .sqrt (( float ) ( i * i + j * j ) + 0.2F );
93
+ float f = 10.0F / MathHelper .sqrt (i * i + j * j + 0.2F );
90
94
this .parabolicField [i + 2 + (j + 2 ) * 5 ] = f ;
91
95
}
92
96
}
@@ -171,7 +175,7 @@ private void setBlocksInChunk(int chunkX, int chunkZ, ChunkPrimer primer)
171
175
private void replaceBlocksForBiome (int x , int z , ChunkPrimer primer , Biome [] biomes )
172
176
{
173
177
double d0 = 0.03125D ;
174
- this .stoneNoise = this .noiseGen4 .getRegion (this .stoneNoise , ( double ) ( x * 16 ), ( double ) ( z * 16 ) , 16 , 16 , d0 * 2.0D , d0 * 2.0D , 1.0D );
178
+ this .stoneNoise = this .noiseGen4 .getRegion (this .stoneNoise , x * 16 , z * 16 , 16 , 16 , d0 * 2.0D , d0 * 2.0D , 1.0D );
175
179
176
180
for (int i = 0 ; i < 16 ; ++i )
177
181
{
@@ -186,7 +190,7 @@ private void replaceBlocksForBiome(int x, int z, ChunkPrimer primer, Biome[] bio
186
190
@ Override
187
191
public Chunk generateChunk (int x , int z )
188
192
{
189
- this .rand .setSeed (( long ) x * 341873128712L + ( long ) z * 132897987541L );
193
+ this .rand .setSeed (x * 341873128712L + z * 132897987541L );
190
194
ChunkPrimer chunkprimer = new ChunkPrimer ();
191
195
this .setBlocksInChunk (x , z , chunkprimer );
192
196
this .biomesForGeneration = this .world .getBiomeProvider ().getBiomes (this .biomesForGeneration , x * 16 , z * 16 , 16 , 16 );
@@ -291,15 +295,15 @@ private void createLandPerBiome(int x, int z)
291
295
}
292
296
293
297
++j ;
294
- double d8 = ( double ) f3 ;
295
- double d9 = ( double ) f2 ;
298
+ double d8 = f3 ;
299
+ double d9 = f2 ;
296
300
d8 = d8 + d7 * 0.2D ;
297
301
d8 = d8 * 8.5 / 8.0D ;
298
302
double d0 = 8.5 + d8 * 4.0D ;
299
303
300
304
for (int l1 = 0 ; l1 < 33 ; ++l1 )
301
305
{
302
- double d1 = (( double ) l1 - d0 ) * 12.0 * 128.0D / 256.0D / d9 ;
306
+ double d1 = (l1 - d0 ) * 12.0 * 128.0D / 256.0D / d9 ;
303
307
304
308
if (d1 < 0.0D )
305
309
{
@@ -311,7 +315,7 @@ private void createLandPerBiome(int x, int z)
311
315
312
316
if (l1 > 29 )
313
317
{
314
- double d6 = (double ) (( float ) ( l1 - 29 ) / 3.0F ) ;
318
+ double d6 = (l1 - 29 ) / 3.0F ;
315
319
d5 = d5 * (1.0D - d6 ) + -10.0D * d6 ;
316
320
}
317
321
@@ -333,9 +337,9 @@ public void populate(int x, int z)
333
337
this .rand .setSeed (this .world .getSeed ());
334
338
long k = this .rand .nextLong () / 2L * 2L + 1L ;
335
339
long l = this .rand .nextLong () / 2L * 2L + 1L ;
336
- this .rand .setSeed (( long ) x * k + ( long ) z * l ^ this .world .getSeed ());
340
+ this .rand .setSeed (x * k + z * l ^ this .world .getSeed ());
337
341
boolean isValley = biomegenbase instanceof BiomeAdaptive && ((BiomeAdaptive ) biomegenbase ).isInstance (BiomeGenVenusValley .class );
338
-
342
+ ForgeEventFactory . onChunkPopulate ( true , this , this . world , this . rand , x , z , false );
339
343
if (this .rand .nextInt (isValley ? 3 : 10 ) == 0 )
340
344
{
341
345
int i2 = this .rand .nextInt (16 ) + 8 ;
@@ -368,7 +372,7 @@ public void populate(int x, int z)
368
372
369
373
biomegenbase .decorate (this .world , this .rand , new BlockPos (i , 0 , j ));
370
374
WorldEntitySpawner .performWorldGenSpawning (this .world , biomegenbase , i + 8 , j + 8 , 16 , 16 , this .rand );
371
-
375
+ ForgeEventFactory . onChunkPopulate ( false , this , this . world , this . rand , x , z , false );
372
376
BlockFalling .fallInstantly = false ;
373
377
}
374
378
0 commit comments