How to make ores generate in the nether in 1.11.2

Started by ALAND on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make ores generate in the nether in 1.11.2

I'm having problem with the nether ore generation.. I made my ore extremely common to generate in the nether but I wasn't able to find it anywhere, I'm using MCreator 1.7.5 (1.11.2)

This was also a problem in 1.7.10 modding, didn't it get fixed?

Here is the code for the block if needed..

 

package mod.mcreator;

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.Item;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.SoundType;
import net.minecraft.block.Block;

import java.util.Random;

public class mcreator_bromineOre {

    public mcreator_bromineOre() {
    }

    public static BlockBromineOre block;

    public static Object instance;

    public int addFuel(ItemStack fuel) {
        return 0;
    }

    public void serverLoad(FMLServerStartingEvent event) {
    }

    public void preInit(FMLPreInitializationEvent event) {
        block.setRegistryName("bromineore");
        GameRegistry.register(block);
        GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
    }

    public void registerRenderers() {
    }

    public void load(FMLInitializationEvent event) {
        if (event.getSide() == Side.CLIENT) {
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("testenvironmentmod:bromineore", "inventory"));
        }
    }

    static {

        block = (BlockBromineOre) (new BlockBromineOre().setHardness(3.0F).setResistance(15.0F).setLightLevel(0.0F).setUnlocalizedName("BromineOre")
                .setLightOpacity(0).setCreativeTab(CreativeTabs.MISC));
        block.setHarvestLevel("pickaxe", 1);
    }

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

    public void generateNether(World world, java.util.Random rand, int chunkX, int chunkZ) {
        for (int i = 0; i < 30; i++) {
            int randPosX = chunkX + rand.nextInt(16);
            int randPosY = rand.nextInt(116) + 1;
            int randPosZ = chunkZ + rand.nextInt(16);
            (new WorldGenMinable(mcreator_bromineOre.block.getDefaultState(), 30)).generate(world, rand, new BlockPos(randPosX, randPosY, randPosZ));
        }
    }

    static class BlockBromineOre extends Block {

        int a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0;

        boolean red = false;

        protected BlockBromineOre() {
            super(Material.ROCK);

            setSoundType(SoundType.STONE);

        }

        @Override
        public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
            int i = pos.getX();
            int j = pos.getY();
            int k = pos.getZ();
            world.scheduleUpdate(new BlockPos(i, j, k), this, this.tickRate(world));

        }

        @Override
        public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
            return red ? 15 : 0;
        }

        @Override
        public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
            return red ? 15 : 0;
        }

        @SideOnly(Side.CLIENT)
        @Override
        public BlockRenderLayer getBlockLayer() {
            return BlockRenderLayer.SOLID;
        }

        @Override
        public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
            return new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
        }

        @Override
        public int tickRate(World world) {
            return 10;
        }

        @Override
        public int quantityDropped(Random par1Random) {
            return 1;
        }

    }
}