use of micdoodle8.mods.galacticraft.planets.mars.dimension.WorldProviderMars in project Galacticraft by micdoodle8.
the class OreGenOtherMods method onPlanetDecorated.
@SubscribeEvent
public void onPlanetDecorated(GCCoreEventPopulate.Post event) {
this.worldObj = event.worldObj;
this.randomGenerator = event.rand;
this.pos = event.pos;
int dimDetected = 0;
WorldProvider prov = worldObj.provider;
if (!(prov instanceof IGalacticraftWorldProvider) || (prov instanceof WorldProviderSpaceStation)) {
return;
}
Block stoneBlock = null;
int stoneMeta = 0;
if (prov instanceof WorldProviderMoon) {
stoneBlock = GCBlocks.blockMoon;
stoneMeta = 4;
dimDetected = 1;
} else if (GalacticraftCore.isPlanetsLoaded && prov instanceof WorldProviderMars) {
stoneBlock = MarsBlocks.marsBlock;
stoneMeta = 9;
dimDetected = 2;
}
if (stoneBlock == null) {
return;
}
for (OreGenData ore : OreGenOtherMods.data) {
if (ore.dimRestrict == 0 || ore.dimRestrict == dimDetected) {
this.oreGen = new WorldGenMinableMeta(ore.oreBlock, ore.sizeCluster, ore.oreMeta, true, stoneBlock, stoneMeta);
this.genStandardOre1(ore.numClusters, this.oreGen, ore.minHeight, ore.maxHeight);
}
}
}
use of micdoodle8.mods.galacticraft.planets.mars.dimension.WorldProviderMars in project Galacticraft by micdoodle8.
the class EventHandlerMars method onPlanetDecorated.
@SubscribeEvent
public void onPlanetDecorated(GCCoreEventPopulate.Post event) {
if (this.eggGenerator == null) {
this.eggGenerator = new WorldGenEggs(MarsBlocks.rock);
}
if (event.worldObj.provider instanceof WorldProviderMars) {
int eggsPerChunk = 2;
BlockPos blockpos;
for (int eggCount = 0; eggCount < eggsPerChunk; ++eggCount) {
blockpos = event.pos.add(event.rand.nextInt(16) + 8, event.rand.nextInt(104) + 24, event.rand.nextInt(16) + 8);
this.eggGenerator.generate(event.worldObj, event.rand, blockpos);
}
}
}
Aggregations