Jump to content

How do I make ores/blocks only generate in certain biomes 1.7.10


Swifts_Tech_Talks

Recommended Posts

Hi im making a mod on 1.7.10 and I have a block that I only want to spawn in oceans (all ocean biomes)

I'm quite new to modding and I can't really find much on the internet for this so I wanted to make this thread.

 

here is my current code

 

package com.swift.swiftsmod;

import java.util.Random;

import cpw.mods.fml.common.IWorldGenerator;
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;

public class OreGeneration implements IWorldGenerator {

    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
            IChunkProvider chunkProvider) {
        switch (world.provider.dimensionId)

        {
        case 1:
            generateEnd(world, random, chunkX, chunkZ);
            break;

        case 0:
            generateOverworld(world, random, chunkX, chunkZ);
            break;

        case -1:
            generateNether(world, random, chunkX, chunkZ);
            break;
        }

    }

    public void generateEnd(World world, Random rand, int x, int z) {

    }

    public void generateOverworld(World world, Random rand, int x, int z) {
        generateOre(SwiftsMod.blockwaterOre, world, rand, x, z, 3, 9, 15, 1, 80, Blocks.stone);
        
        generateOre(SwiftsMod.blockmoneyOre, world, rand, x, z, 4, 14, 20, 1, 130, Blocks.stone); //4 min vien, 14 max vien, chance 20, 1 min level, 130 max level 

    }

    public void generateNether(World world, Random rand, int x, int z) {

    }

    public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, 
            int chance, int minY, int maxY, Block generateIn) {
        int veinSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
        int heightRange = maxY - minY;
        WorldGenMinable gen = new WorldGenMinable(block, veinSize, generateIn);
        for(int i = 0; i < chance; i++){
            int xRand = chunkX * 16 + random.nextInt(16);
            int yRand = random.nextInt(heightRange) + minY;
            int zRand = chunkZ * 16 + random.nextInt(16);
            gen.generate(world, random, xRand, yRand, zRand);
            
        }
    }
}

 

 

Link to comment
Share on other sites

6 minutes ago, Swifts_Tech_Talks said:

Hi im making a mod on 1.7.10

Update to a modern version of Minecraft.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

1 minute ago, Swifts_Tech_Talks said:

Thanks for the help...

You're welcome.

 

1 minute ago, Swifts_Tech_Talks said:

and no. If I wanted to make a 1.14 mod I'd make a 1.14 mod

I didn't say 1.14 I said modern. And I say it because we don't support any versions below 1.12 because the changes are massive.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

2 minutes ago, Swifts_Tech_Talks said:

Where would I go to get help on this mod then? Because anything above 1.9 is absolute garbage

I guess somewhere with people who share your opinion?

Edited by Animefan8888

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Just now, Swifts_Tech_Talks said:

Is there some old version mod support on this site? 

Nope.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Forge supports the current version (1.14 at the time of this writing) and one version back (ish, which is 1.12 at the time of this writing; 1.13 is sort of an interim version and was largely skipped). Sometimes it'll go back 2 versions (some help is available for 1.10, but won't be immediately locked).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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