Jump to content

Recommended Posts

Posted

Hi, I am just testing and messing around with world generation. The problem is I get no errors in my code, but when I start my new world to test it, but no matter what I do nothing will generate that I set to generate. Here is my code.

 

MainRegistry Class:

package com.hurleyboarder.mainregistery;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

import com.hurleyboarder.food.FoodCorndog;
import com.hurleyboarder.food.FoodHamburger;
import com.hurleyboarder.food.FoodPizza;
import com.hurleyboarder.lib.RefStrings;
import com.hurleyboarder.oregencomplete.BlockSulfurOre;
import com.hurleyboarder.oregencomplete.ItemSulfur;
import com.hurleyboarder.oregencomplete.SulfurOreWG;

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.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = RefStrings.MODID, name = RefStrings.NAME, version = RefStrings.VERSION)
public class MainRegistry {

public final static Block SulfurOre = new BlockSulfurOre(2000, Material.rock);

public static void PreLoad(FMLPreInitializationEvent PreEvent){

	SulfurOreWG worldgen1 = new SulfurOreWG();
	GameRegistry.registerWorldGenerator(worldgen1, 1);


}
@EventHandler
public static void Load (FMLInitializationEvent Event){

//Food List
Item Corndog = new FoodCorndog(5015, 5, true);
Item Hamburger = new FoodHamburger(5016, 5, true);
Item Pizza = new FoodPizza(5017, 5, true);

Item Sulfur = new ItemSulfur(2001);

//Registers
GameRegistry.registerItem(Corndog, "Corndog");
GameRegistry.registerItem(Hamburger, "Hamburger");
GameRegistry.registerItem(Pizza, "Pizza");

GameRegistry.registerBlock(SulfurOre, "Sulfurore");
GameRegistry.registerItem(Sulfur, "Sulfur");


//Language Registers
LanguageRegistry.addName(Corndog, "CornDog");
LanguageRegistry.addName(Hamburger, "Hamburger");
LanguageRegistry.addName(Pizza, "Pizza");

LanguageRegistry.addName(SulfurOre, "Sulfur Ore");
LanguageRegistry.addName(Sulfur, "Sulfur");

//Recipes
GameRegistry.addSmelting(SulfurOre, new ItemStack(Sulfur, 4), 20.0f);
GameRegistry.addShapelessRecipe(new ItemStack(Items.gunpowder), Sulfur, Items.coal);
}

 

Generation Class:

]package com.hurleyboarder.oregencomplete;

import java.util.Random;

import net.minecraft.init.Blocks;
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 SulfurOreWG 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(Blocks.bedrock, 50).generate(world, random, Xcoords, Ycoords, Zcoords);
	}

}

public void generateNether(World world, Random random, int i, int j) {


}

}

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.

Announcements



×
×
  • Create New...

Important Information

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