Jump to content

Ore not Generating


enderborn10172

Recommended Posts

Will someone please help me figure our why the ore is not generating. I have followed multiple tutorials and thought that I did everything the exact same, but apparently, I'm missing something. I'm using forge 1.9.4.

 

I have minimal experience with Java. I am a Registered Nurse and single mom, and I honestly have no time to take a Java class; however, I do learn quickly and have learned a good bit from tutorials. I am trying to make a mod for my son, and we will appreciate any help that I receive.

 

OreGen:

 

 

package enderborn10172.Radiated.worldGen;

 

import java.util.Random;

 

import enderborn10172.Radiated.init.modblocks;

import net.minecraft.block.Block;

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

import net.minecraft.init.Blocks;

import net.minecraft.util.math.BlockPos;

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkGenerator;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.feature.WorldGenMinable;

import net.minecraftforge.fml.common.IWorldGenerator;

 

public class OreGen implements IWorldGenerator{

 

@Override

public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,

IChunkProvider chunkProvider) {

 

switch(world.provider.getDimension()){

 

case 0:

generateOverworld(world, random, chunkX * 16, chunkZ * 16);

break;

}

 

 

}

 

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

generateOre(modblocks.RadioactiveOre, world, random, x, z, 4, 9, 10, 15, 20, Blocks.STONE);

 

 

}

 

public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVeinSize, int maxVeinSize,

int chance, int minY, int maxY, Block generateIn){

int veinSize = minVeinSize + random.nextInt(maxVeinSize - minVeinSize);

int heightRange = maxY - minY;

WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), veinSize, BlockMatcher.forBlock(generateIn));

 

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

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

int yRand = minY + heightRange;

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

BlockPos newPos = new BlockPos(xRand, yRand, zRand);

gen.generate(world, random, newPos);

 

}

 

 

 

}

 

 

}

 

 

 

Main:

 

 

package enderborn10172.Radiated;

 

import java.io.File;

 

import enderborn10172.Radiated.init.ModCrafting;

import enderborn10172.Radiated.init.modarmor;

import enderborn10172.Radiated.init.modblocks;

import enderborn10172.Radiated.init.moditems;

import enderborn10172.Radiated.init.modtools;

import enderborn10172.Radiated.proxy.CommonProxy;

import enderborn10172.Radiated.proxy.client.ConfigHandler;

import enderborn10172.Radiated.world.BiomeRegistry;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.fml.common.Mod.EventHandler;

import net.minecraftforge.fml.common.Mod.Instance;

import net.minecraftforge.fml.common.SidedProxy;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION, acceptedMinecraftVersions = Reference.ACCEPTED_VERSIONS)

public class RadiatedMain {

 

@Instance

public static RadiatedMain instance;

 

@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)

public static CommonProxy proxy;

 

public static final CreativeTabs CREATIVE_TAB = new RadiationTab();

 

private static File configDir;

 

public static File getconfinDir(){

return configDir;

 

}

 

 

@EventHandler

public void preInit(FMLPreInitializationEvent event)

{

 

moditems.init();

moditems.register();

 

modblocks.init();

modblocks.register();

 

modtools.init();

modtools.register();

 

modarmor.init();

modarmor.register();

 

 

 

 

//Configuration

 

configDir = new File(event.getModConfigurationDirectory() + "/" + Reference.MOD_ID);

configDir.mkdirs();

ConfigHandler.init(new File(configDir.getPath(), Reference.MOD_ID + ".cfg"));

 

 

//Miscellaneous

 

BiomeRegistry.MainBiomeRegistry();

 

 

 

 

 

}

 

@EventHandler

public void init(FMLInitializationEvent event)

{

proxy.init();

 

 

ModCrafting.register();

 

 

 

}

 

@EventHandler

public void postInit(FMLPostInitializationEvent event)

{

}

 

 

}

 

 

 

Blocks:

 

 

package enderborn10172.Radiated.init;

 

import enderborn10172.Radiated.blocks.BlockAnimalDecay;

import enderborn10172.Radiated.blocks.BlockContaminatedStone;

import enderborn10172.Radiated.blocks.BlockHardenedPoison;

import enderborn10172.Radiated.blocks.BlockHardenedStone;

import enderborn10172.Radiated.blocks.BlockRadioactiveOre;

import net.minecraft.block.Block;

import net.minecraft.client.Minecraft;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;

import net.minecraft.item.Item;

import net.minecraft.item.ItemBlock;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

public class modblocks {

 

//Declare the block

 

public static Block RadioactiveOre;

public static Block AnimalDecay;

public static Block ContaminatedStone;

public static Block HardenedStone;

public static Block HardenedPoison;

 

 

//Initialize the block

 

public static void init(){

RadioactiveOre = new BlockRadioactiveOre();

AnimalDecay = new BlockAnimalDecay();

ContaminatedStone = new BlockContaminatedStone();

HardenedStone = new BlockHardenedStone();

HardenedPoison = new BlockHardenedPoison();

 

 

}

 

//Register the block

 

public static void register(){

registerBlock(RadioactiveOre);

registerBlock(AnimalDecay);

registerBlock(ContaminatedStone);

registerBlock(HardenedStone);

registerBlock(HardenedPoison);

 

 

}

 

private static void registerBlock(Block block) {

GameRegistry.register(block);

ItemBlock item = new ItemBlock(block);

item.setRegistryName(block.getRegistryName());

GameRegistry.register(item);

}

 

 

//The Following method calls the method below it.

 

public static void registerRenders(){

registerRender(RadioactiveOre);

registerRender(AnimalDecay);

registerRender(ContaminatedStone);

registerRender(HardenedStone);

registerRender(HardenedPoison);

 

 

}

 

//Where in the assets folder we will be looking for the item.

 

private static void registerRender(Block block){

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));

 

}

}

 

 

 

Client Proxy:

 

 

package enderborn10172.Radiated.proxy;

 

import enderborn10172.Radiated.init.modarmor;

import enderborn10172.Radiated.init.modblocks;

import enderborn10172.Radiated.init.moditems;

import enderborn10172.Radiated.init.modtools;

import enderborn10172.Radiated.world.BiomeRegistry;

import enderborn10172.Radiated.worldGen.OreGen;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

public class ClientProxy implements CommonProxy {

 

 

 

public void init() {

 

 

 

 

 

moditems.registerRenders();

modblocks.registerRenders();

modtools.registerRenders();

modarmor.registerRenders();

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

 

}

 

//public void BiomeRegistry.MainBiomeRegistry();

 

 

}

 

 

 

Thanks in advance for all your help!

 

 

 

 

 

Link to comment
Share on other sites

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

 

out of the "ClientProxy"

 

Why the fuck would a world generator be in the client side only code?

 

You know the client isn't responsible for world state information, right?

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

The ugly language is not necessary. However, to answer your question, no, I do not know that. However, if you would like to respectfully teach me something, I would love to learn.

Thanks in advance

 

I've also tried placing it in the preInit and the Init, and I continue to have my problem. That's why I decided after two days of trying to ask on this forum.

Link to comment
Share on other sites

The ugly language is not necessary. However, to answer your question, no, I do not know that. However, if you would like to respectfully teach me something, I would love to learn.

Thanks in advance

Well basically we have two sides, client and server. The server handles basically everything, while the client only handles what needs to be handled on the client: keyboard and mouse input to GUIs.

 

I've also tried placing it in the preInit and the Init, and I continue to have my problem. That's why I decided after two days of trying to ask on this forum.

Have you generated a new world? Or chunks?

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

Well basically we have two sides, client and server. The server handles basically everything, while the client only handles what needs to be handled on the client: keyboard and mouse input to GUIs.

 

Have you generated a new world? Or chunks?

Thanks for your understanding and the explanation. I always just create a new world with every test run. I know it's not necessary; however, that's just my method.

 

You pass block coordinates to generateOre but generateOre expects chunk coordinates. Hence you end up with huge coordinate values.

Thank you as well. I made these adjustments, and I am extremely happy to report that the ore is now in game.

Appreciate the both of you!

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello I must download mods  
    • How I Recovered Over €72,000 from a Scam Trading Broker in London with the Help of Adrian Lamo Hacker I’d like to share my recovery experience here from London, UK, with a scam trading broker to help others avoid falling into the same trap I did. Like many, I thought I was making a smart investment by trading online. I had heard stories of people earning substantial returns, so I was excited when I found a trading platform that seemed legitimate. However, little did I know, I was dealing with a scam. The broker I encountered was highly convincing. They promised me high returns and offered a professional-looking platform. I was persuaded by their smooth talk, testimonials, and fake success stories. Over time, I started transferring funds into the trading account they set up for me. My initial investments were small, but soon I transferred a significant amount—almost €72,620—hoping to see my account grow. Unfortunately, things took a sharp turn for the worse. Despite the early promises of returns, I was unable to withdraw any of my funds. Each time I requested to withdraw, I was met with endless excuses and delays. It became clear that I was dealing with a fraudulent broker, and my money was stuck in their fake account with no way of getting it back. I felt devastated and helpless. It was hard to believe that I had been scammed. However, after doing some research, I came across Adrian Lamo Hacker a company that specializes in recovering funds lost to scams. I was skeptical at first, but after reading positive reviews and testimonials, I decided to reach out for help. From the moment I contacted them through , the team was professional, understanding, and reassuring. They guided me through the recovery process step by step, and after some time, I was overjoyed to learn that my money had been successfully recovered. I’m incredibly grateful to Adrian Lamo Hacker for their expertise and hard work. They helped me get back what I thought was lost forever. If you’re reading this and have fallen victim to a similar scam, I urge you to reach out to a reputable recovery service like ADRIAN LAMO HACKER via Email: Adrianlamo @ consultant . com/ / Telegram ID: @ADRIANLAMOHACKERTECH Don’t give up on getting your money back. There are experts out there who can help, and I am proof that recovery is possible.
    • No se me descarga la carpeta de forge. Despues de darle a install y q me salte a la pagina de publicidad, espero los 5 segundos, le doy a skip pero en vez de descargarse del archivo del forge, se me descarga un .jar que es un bloc de notas, no me aparece la carpeta con la descarga por ningun lado 
    • Alright, well before removing IC2 I changed the max chunks from 15 to 6, and that seems to have fixed most of it, BUT, the console log keeps spamming out this "[16:01:09] [File IO Thread/WARN] [FML]: Large Chunk Detected: (11, 19) Size: 578 ./servermodworld2024oct/region/r.5.2.mca", and it is still lagging a little. What exactly does this mean and by some chance is this a chunk I can find and fix? If so how can I find it? After testing the server without IC2, the same error message still shows up, and the server continues to suffer in terms of lag.
  • Topics

×
×
  • Create New...

Important Information

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