Jump to content

Ore Generator registration problem.


gash

Recommended Posts

Guten tag!

So, I have this generator code:

package com.gashk.amethyst.generation;

import java.util.Random;

import com.gashk.amethyst.init.Amethyst;

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.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;

public class AMGen implements IWorldGenerator {	
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
    switch(world.provider.getDimensionId())
    {
    case 0:
    generateSurface(world, random, chunkX*16, chunkZ*16);
    break;
    }
}

public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
    for (int i = 0; i < 25; i++)
    {
        int randPosX = chunkX + rand.nextInt(16);
        int randPosY = rand.nextInt(100);
        int randPosZ = chunkZ + rand.nextInt(16);
        (new WorldGenMinable(Amethyst.am_ore.getDefaultState(), 10)).generate(world, rand, new BlockPos(randPosX, randPosY, randPosZ));
    }
}
}

Everything is fine here. But when I try to register it in my main class like so:

GameRegistry.registerWorldGenerator(new PigGen(), 0);

It says:

The method registerWorldGenerator(IWorldGenerator, int) in the type GameRegistry is not applicable for the arguments (AMGen, int)

But AMGen implements IWorldGenerator ;-;

 

pls help!

 

Thanks!

 

Link to comment
Share on other sites

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.