HELLO people! So I am working on my mod and I was wondering if it was possible that I could get a certain ore to spawn ONLY in ocean biomes. Obviously I would prefer to do this without editing base classes. This is my WorldGenOceanOre file so far (It doesn't work):
package RediscoveredMod;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGeneratorOceanOre implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
//This is my attempt at getting it to only spawn in ocean biomes. Doesn't work for some reason
if(world.provider.getBiomeGenForCoords(chunkX, chunkZ) == BiomeGenBase.ocean)
{
generateOcean(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateOcean(World world, Random random, int BlockX, int BlockZ)
{
for (int i = 0; i < 30; i++)
{
int Xcoord = BlockX + random.nextInt(16);
int Zcoord = BlockZ + random.nextInt(16);
int yCoord = random.nextInt(39);
(new WorldGenMinable(mod_Rediscovered.oceanOre.blockID, 4)).generate(world, random, Xcoord, yCoord, Zcoord);
}
}
}
Any help would be greatly appreciated. I know that emerald ore has a way of spawning in just extreme hills biomes but to do that for this ore I would need to edit the BiomeGenOcean file (Which I don't want to do).
use mc creator create a ore then slect a layer for it to generate save everything then pack mod in zip then copy the ore mod then use all the stuff in the flie put it in the mod you made there you go i think i'm not good at mod making.
http://www.minecraft...-special-biome/
This is for mobs but I beleive its the same thing :/
try using the instanceof operator, and checking it against BiomeGenOcean:
That works for me!
I love Minecraft