Jump to content

[1.8][Solved]Ore Will not Generate in the nether


KingOfMiners

Recommended Posts

I Can't get my ore to generate in the nether i Have the same coding as my ruby ore generation but i cant seem to get the ore to generate in the nether:

 

package com.moreoresmod.main.worldgeneration;

 

import java.util.Random;

 

import com.moreoresmod.main.init.MoreOresModBlocks;

 

import net.minecraft.block.Block;

import net.minecraft.init.Blocks;

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.minecraftforge.fml.common.IWorldGenerator;

 

public class NetherDiamondGeneration implements IWorldGenerator {

@Override

public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {

switch(world.provider.getDimensionId()){

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 random, int x, int z){

 

}

 

public void generateOverworld(World world, Random random, int x, int z){

 

}

 

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

generateOre(MoreOresModBlocks.nether_diamond, world, random, x, z, 2, 8, 50, 2, 256, Blocks.netherrack);

}

 

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 vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);

int hightRange = maxY - minY;

WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize);

for(int i = 0; i < chance; i++){

int xRand = chunkX * 16 + random.nextInt(16);

int yRand = random.nextInt(hightRange) + minY;

int zRand = chunkZ * 16 + random.nextInt(16);

gen.generate(world, random,new BlockPos(xRand, yRand, zRand));

}

}

}

 

  • Thanks 1
Link to comment
Share on other sites

Will It Work Now?

 

package com.moreoresmod.main.worldgeneration;

 

import java.util.Random;

 

import akka.japi.Predicate;

 

import com.moreoresmod.main.init.MoreOresModBlocks;

 

import net.minecraft.block.Block;

import net.minecraft.block.state.pattern.BlockHelper;

import net.minecraft.init.Blocks;

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.minecraftforge.fml.common.IWorldGenerator;

 

public class NetherDiamondGeneration implements IWorldGenerator {

@Override

public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {

BlockHelper.forBlock(Blocks.netherrack);

switch(world.provider.getDimensionId()){

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 random, int x, int z){

 

}

 

public void generateOverworld(World world, Random random, int x, int z){

 

}

 

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

generateOre(MoreOresModBlocks.nether_diamond, world, random, x, z, 2, 8, 50, 2, 256, Blocks.netherrack);

}

 

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 vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);

int hightRange = maxY - minY;

WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize);

for(int i = 0; i < chance; i++){

int xRand = chunkX * 16 + random.nextInt(16);

int yRand = random.nextInt(hightRange) + minY;

int zRand = chunkZ * 16 + random.nextInt(16);

gen.generate(world, random,new BlockPos(xRand, yRand, zRand));

}

}

}

  • Thanks 1
Link to comment
Share on other sites

  • 3 years later...
42 minutes ago, EOT3000 said:

What would I use instead of BlockHelper.forBlock in forge 1.12.2?

Please do not necro a thread. Make your own thread.

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

  • 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.