Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey, me again, I have been trying to get an ore to generate in the nether but it wont generate. It doesn't crash or anything.

                              Code:

 

World Gen File:

 

package MOnM;

import java.util.Random;

import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class WorldGeneratorMOnM implements IWorldGenerator{
    
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
        
	switch(world.provider.dimensionId){
            case 1:
                generateNether(world, random, chunkX * 16, chunkZ * 16);
            case 0:
                generateSurface(world, random, chunkX * 16, chunkZ * 16);
            case -1:
                generateEnd(world, random, chunkX * 16, chunkZ * 16);
	}

}
    
private void generateEnd(World world, Random random, int chunkX, int chunkZ){

}
    
private void generateSurface(World world, Random random, int chunkX,int chunkZ){
	for(int i = 0; i < 20; i++){
		int xCoord = chunkX + random.nextInt(16);
		int yCoord = random.nextInt(80);
		int zCoord = chunkZ + random.nextInt(16);

		(new WorldGenMinable(MOnM.MineriteOre.blockID, 10)).generate(world, random, xCoord, yCoord, zCoord);
	}}


    
private void generateNether(World world, Random random, int chunkX, int chunkZ){
	for(int i = 0; i < 40; i++){
		int xCoord = chunkX + random.nextInt(16);
		int yCoord = random.nextInt(60);
		int zCoord = chunkZ + random.nextInt(16);

		(new WorldGenMinable(MOnM.SataniteOre.blockID, 10)).generate(world, random, xCoord, yCoord, zCoord);

      }

}
}

 

Main File:

 

package MOnM;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = MOnM.modID, version = "0.1", name = "More Ores 'n Minerals")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class MOnM {

public static final String modID = "MOnM";

public static Block MineriteGemBlock;
public static Block MineriteOre;
public static Item MineriteDust;
public static Item MineriteGem;
public static Item MineriteIngot;


public static Block SataniteOre;
public static Block SataniteBlock;

	@EventHandler
public void load(FMLInitializationEvent event){
//Blocks
MineriteOre = new MineriteOre(2000,"mineriteore").setHardness(3.0F).setLightValue(1).setUnlocalizedName("mineriteore");
registerBlock(MineriteOre, "Minerite Ore", MineriteOre.getUnlocalizedName());

MineriteGemBlock = new MineriteGemBlock(2001,"mineritegemblock").setHardness(3.0F).setLightValue(1).setUnlocalizedName("mineritegemblock");
registerBlock(MineriteGemBlock, "Minerite Gem Block", MineriteGemBlock.getUnlocalizedName());

SataniteOre = new SataniteOre(2002,"sataniteore").setHardness(3.0F).setLightValue(1).setUnlocalizedName("sataniteore");
registerBlock(SataniteOre, "Satanite Ore", SataniteOre.getUnlocalizedName());

//Items
MineriteDust = new MineriteDust(2500,"mineritedust").setUnlocalizedName("mineritedust");



LanguageRegistry.addName(MineriteDust, "Minerite Dust");






//World Generator Registry
GameRegistry.registerWorldGenerator(new WorldGeneratorMOnM());


}
	public static void registerBlock(Block block, String name, String unlocalizedName){
		GameRegistry.registerBlock(block, MOnM.modID + unlocalizedName);
		LanguageRegistry.addName(block, name);
	}
}

 

Halp!

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.