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

Hi everyone, I'm trying to make a ore generation in my world but the block don't generate in my world i have already deleted my old world and make a new one but still doesn't work can someone help me??

Code:

basic.java: 
import tutorial.basic.armor.Armor;
import tutorial.basic.blocks.HardedIce;
import tutorial.basic.blocks.MeteorBlock;
import tutorial.basic.blocks.ModBlocks;
import tutorial.basic.items.IceShard;
import tutorial.basic.items.MeteorHelmet;
import tutorial.basic.items.meteorore;
import tutorial.basic.tools.IceSword;
import tutorial.basic.tools.MeteorSword;
import tutorial.basic.worldgeneration.MeteorBlockWG;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="basic", name="basic", version="1.0.0")

public class basic {
     public final static String NAME = "basic";
     public static Block meteorblock = new MeteorBlock();
         public static Block hardedice = new HardedIce();
         public static Item meteorore = new meteorore(1600);
         public static ToolMaterial meteorore1 = EnumHelper.addToolMaterial("meteorore", 2, 250, 11.0F, 2.5F, 10);
        @Instance("basic")
        public static basic instance;
        public static MeteorBlockWG Worldgen1 = new MeteorBlockWG();
        // Says where the client and server 'proxy' code is loaded.
        @SidedProxy(clientSide="tutorial.basic.client.ClientProxy", serverSide="tutorial.basic.CommonProxy")
        public static CommonProxy proxy;
        //Items
        public static ToolMaterial iceshard1 = EnumHelper.addToolMaterial("iceshard", 2, 250, 13.0F, 4.0F, 10);
        public static Item iceshard = new IceShard(30001);
        //Armor
        public static ArmorMaterial MeteorOre = EnumHelper.addArmorMaterial("MeteorOre", 15, new int[]{2, 5, 4, 1}, 30);
        public static Item MeteorHelmet = new Armor(5000, MeteorOre, 0, 0, "meteorore").setUnlocalizedName("MeteorHelmet").setTextureName("basic:MeteorHelmet");
        public static Item MeteorChestplate = new Armor(5000, MeteorOre, 0, 1, "meteorore").setUnlocalizedName("MeteorChestplate").setTextureName("basic:MeteorChestplate");
        //Tools
         public final static Item meteorsword = new MeteorSword(5000, meteorore1);
         public final static Item icesword = new IceSword(50001, iceshard1);
        @EventHandler
        public void load(FMLInitializationEvent event) { 
        	
                proxy.registerRenderers();
                GameRegistry.addRecipe(new ItemStack(meteorsword), new Object[]{
                	" y " ,
                	" y " ,
                	" z " ,
                	'y', basic.meteorore, 'x', ModBlocks.meteorblock, 'z', Items.stick
                });
                GameRegistry.registerWorldGenerator(Worldgen1, 1);
                GameRegistry.registerItem(icesword, "IceSword");
                LanguageRegistry.addName(icesword, "Ice Sword");
                GameRegistry.registerItem(MeteorHelmet, "MeteorHelmet");
                LanguageRegistry.addName(MeteorHelmet, "Meteor Helmet");
                GameRegistry.registerItem(MeteorChestplate, "Meteor Chestplate");
                LanguageRegistry.addName(MeteorChestplate, "Meteor Chestplate");
                GameRegistry.registerBlock(hardedice, "hardedice");
                GameRegistry.registerItem(meteorsword, "meteorsword");
        		LanguageRegistry.addName(meteorsword, "Meteor Sword");
        		GameRegistry.registerBlock(meteorblock, "meteorblock");
        		LanguageRegistry.addName(hardedice, "Harded Ice");
                GameRegistry.registerItem(meteorore, "meteorore");
                LanguageRegistry.addName(meteorore, "Meteor Ore");
                GameRegistry.registerItem(iceshard, "iceshard");
                LanguageRegistry.addName(iceshard, "Ice Shard");
                GameRegistry.addSmelting(new ItemStack(ModBlocks.meteorblock), new ItemStack(basic.meteorore), 20F);
        	    GameRegistry.addSmelting(new ItemStack(basic.hardedice), new ItemStack(basic.iceshard), 20F);
        	    //Crafting
        	    GameRegistry.addRecipe(new ItemStack(basic.MeteorHelmet), new Object[] { "WWW", "W W", "   ", 'W', new ItemStack(meteorore)});
        	    GameRegistry.addRecipe(new ItemStack(basic.MeteorChestplate), new Object[] { "W W", "WWW", "WWW", 'W', new ItemStack(meteorore)});
        	    };
        
        @EventHandler
        public void PreInit(FMLPreInitializationEvent event){
        	ModBlocks.init();
        }
       
}

MeteorBlockWG:
package tutorial.basic.worldgeneration;

import java.util.Random;

import tutorial.basic.basic;
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 MeteorBlockWG 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);

	}


}

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

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

		int Xcoords = x + random.nextInt(16);
		int Ycoords = random.nextInt(256);
		int Zcoords = z + random.nextInt(16);
		new WorldGenMinable(basic.meteorblock, 50).generate(world, random, Xcoords, Ycoords, Zcoords);
	}

}

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


}

 

 

First of all, you should put your code between code tags. 50 might be too big, I think the max ore size is 32. Are there any error messages? BTW, for your generation not to appear in the nether you need to break the switch statement after

generateNether()

.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

I don't see you registering your IWorldGenerator class in the main mod file, also you should use a .lang file instead of using LanguageRegistry.addname()- this method is deprecated

The proud(ish) developer of Ancients

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.