Jump to content

Recommended Posts

Posted

Hey!

 

I am currently working on a mod that adds some ores to the End. The ores I have generating in the overworld work fine, however the ores that I have generating in the end just don't generate!

 

Here is one of my end ore generator classes:

package com.evanw1256.bote.generation;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;

import com.evanw1256.bote.init.ModBlocks;

import cpw.mods.fml.common.IWorldGenerator;

public class EndriteGenerator implements IWorldGenerator {
 public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
    {
        switch(world.provider.dimensionId)
        {
            case 0: generateSurface(random, chunkX*16, chunkZ*16, world); break;
            case 1: generateEnd(random, chunkX*16, chunkZ*16, world); break;
            case -1: generateNether(random, chunkX*16, chunkZ*16, world); break;
            default:;
        }
    }

 public void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int minVainSize, int maxVainSize, int chancesToSpawn, int minY, int maxY )
    {
        for(int i = 0; i < chancesToSpawn; i++)
        {
            int posX = blockXPos + random.nextInt(16);
            int posY = minY + random.nextInt(maxY - minY);
            int posZ = blockZPos + random.nextInt(16);
            new WorldGenMinable(block, (minVainSize + random.nextInt(maxVainSize - minVainSize)), Blocks.stone).generate(world, random, posX, posY, posZ);
        }
    }

 private void generateNether(Random random, int i, int j, World world) {
  // TODO Auto-generated method stub
  
 }

 private void generateEnd(Random random, int i, int j, World world) {
  // TODO Auto-generated method stub
	 addOreSpawn(ModBlocks.endriteOre, world, random, i, j, 2, 5, 70, 0, 100);
 }

 private void generateSurface(Random random, int chunkX, int chunkZ, World world) {
 }

}

 

And then here is my generation init file:

package com.evanw1256.bote.init;

import com.evanw1256.bote.generation.EndriteGenerator;
import com.evanw1256.bote.generation.EnosGenerator;
import com.evanw1256.bote.generation.HemiteGenerator;
import com.evanw1256.bote.generation.TerriumGenerator;

import cpw.mods.fml.common.registry.GameRegistry;

public class ModGeneration {
public static void Init() {
	GameRegistry.registerWorldGenerator(new HemiteGenerator(), 1);
	GameRegistry.registerWorldGenerator(new TerriumGenerator(), 1);
	GameRegistry.registerWorldGenerator(new EndriteGenerator(), 1);
	GameRegistry.registerWorldGenerator(new EnosGenerator(), 1);
}
}

Posted

You're telling WorldGenMinable to replace stone.

new WorldGenMinable(block, (minVainSize + random.nextInt(maxVainSize - minVainSize)), Blocks.stone).generate(world, random, posX, posY, posZ);

Kain

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.