Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.penumbral.steelworks.world;
- import java.util.Random;
- import net.minecraft.block.Block;
- import net.minecraft.block.state.pattern.BlockHelper;
- import net.minecraft.init.Blocks;
- import net.minecraft.util.BlockPos;
- import net.minecraft.world.World;
- import net.minecraft.world.chunk.IChunkProvider;
- import net.minecraft.world.gen.feature.WorldGenMinable;
- import net.minecraftforge.fml.common.IWorldGenerator;
- import com.penumbral.steelworks.init.SteelworksBlocks;
- public class OreGeneration implements IWorldGenerator{
- @Override
- public void generate(Random random, int chunkX, int chunkZ, World world,
- IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
- switch(world.provider.getDimensionId()) {
- case 1:
- generateEnd(world, random, chunkX * 16, chunkZ * 16);
- break;
- case 0:
- generateOverworld(world, random, chunkX * 16, chunkZ * 16);
- break;
- case -1:
- generateNether(world, random, chunkX * 16, chunkZ * 16);
- break;
- }
- }
- private void generateEnd(World world, Random random, int x, int z) {
- }
- public void generateOverworld(World world, Random random, int x, int z) {
- int x1 = x + random.nextInt(16);
- int y = 0 + random.nextInt(64-0);
- int z1 = z + random.nextInt(16);
- (new FireClayGen(SteelworksBlocks.fire_clayblock, 100)).generate(world, random, new BlockPos(x1, y, z1));
- }
- private void generateNether(World world, Random random, int x, int z) {
- }
- public void generateOre(Block block, World world, Random random, int posX, int posZ, int minVein, int maxVein, int spawnChance, int minY, int maxY)
- {
- WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), (minVein + random.nextInt(maxVein - minVein)), BlockHelper.forBlock(Blocks.clay));
- for (int i = 0; i < spawnChance; i++) {
- int xPos = posX + random.nextInt(16);
- int yPos = minY + random.nextInt(maxY - minY);
- int zPos = posZ + random.nextInt(16);
- gen.generate(world, random, new BlockPos(xPos, yPos, zPos));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement