-
-
Save JayZX535/7dbcc11fb758fe29bf18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.caninemod.caninemod.structures; | |
import java.util.Random; | |
import cpw.mods.fml.common.IWorldGenerator; | |
import net.minecraft.world.World; | |
import net.minecraft.world.biome.BiomeGenBase; | |
import net.minecraft.world.chunk.IChunkProvider; | |
public class StructureGen implements IWorldGenerator | |
{ | |
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) | |
{ | |
switch (world.provider.dimensionId) | |
{ | |
case -1: generateNether(world, random, chunkX*16, chunkZ*16); | |
case 0: generateSurface(world, random, chunkX*16, chunkZ*16); | |
} | |
} | |
private void generateSurface(World world, Random random, int blockX, int blockZ) | |
{ | |
if (world.getBiomeGenForCoords(blockX, blockZ) == BiomeGenBase.plains) | |
{ | |
Random randomGenerator = new Random(); | |
int randomInt = randomGenerator.nextInt(5); | |
if (randomInt == 1) | |
{ | |
int Xcoord1 = blockX + random.nextInt(16); | |
int Ycoord1 = random.nextInt(80); | |
int Zcoord1 = blockZ + random.nextInt(16); | |
(new OldRuin()).generate(world, random, Xcoord1, Ycoord1, Zcoord1); | |
} | |
} | |
} | |
private void generateNether(World world, Random random, int blockX, int blockZ) | |
{ | |
Random randomGenerator = new Random(); | |
int randomInt = randomGenerator.nextInt(3); | |
if (randomInt == 1) | |
{ | |
int Xcoord1 = blockX + random.nextInt(16); | |
int Ycoord1 = random.nextInt(80); | |
int Zcoord1 = blockZ + random.nextInt(16); | |
(new NetherDogDungeon()).generate(world, random, Xcoord1, Ycoord1, Zcoord1); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment