Search in sources :

Example 1 with WorldProviderMars

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);
        }
    }
}
Also used : WorldProviderMars(micdoodle8.mods.galacticraft.planets.mars.dimension.WorldProviderMars) IGalacticraftWorldProvider(micdoodle8.mods.galacticraft.api.world.IGalacticraftWorldProvider) WorldProviderSpaceStation(micdoodle8.mods.galacticraft.core.dimension.WorldProviderSpaceStation) WorldProvider(net.minecraft.world.WorldProvider) IGalacticraftWorldProvider(micdoodle8.mods.galacticraft.api.world.IGalacticraftWorldProvider) WorldProviderMoon(micdoodle8.mods.galacticraft.core.dimension.WorldProviderMoon) Block(net.minecraft.block.Block) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with WorldProviderMars

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);
        }
    }
}
Also used : WorldProviderMars(micdoodle8.mods.galacticraft.planets.mars.dimension.WorldProviderMars) WorldGenEggs(micdoodle8.mods.galacticraft.planets.mars.world.gen.WorldGenEggs) BlockPos(net.minecraft.util.BlockPos) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

WorldProviderMars (micdoodle8.mods.galacticraft.planets.mars.dimension.WorldProviderMars)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 IGalacticraftWorldProvider (micdoodle8.mods.galacticraft.api.world.IGalacticraftWorldProvider)1 WorldProviderMoon (micdoodle8.mods.galacticraft.core.dimension.WorldProviderMoon)1 WorldProviderSpaceStation (micdoodle8.mods.galacticraft.core.dimension.WorldProviderSpaceStation)1 WorldGenEggs (micdoodle8.mods.galacticraft.planets.mars.world.gen.WorldGenEggs)1 Block (net.minecraft.block.Block)1 BlockPos (net.minecraft.util.BlockPos)1 WorldProvider (net.minecraft.world.WorldProvider)1