Jump to content

Recommended Posts

Posted

Idk why my ore will not spawn

 

package com.kingz101.ore;

 

import java.util.Random;

 

import com.kingz101.blocks.MBlocks;

 

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 SMOreGeneration implements IWorldGenerator {

 

  @Override

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

        IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {

     

 

        switch(world.provider.dimensionId) {

        case -1 :

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

            break;

        case 0 :

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

            break;

        case 1 :

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

            break;

       

        }

     

  }

 

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

     

     

  }

 

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

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

        int xcoord = x + random.nextInt(16);

        int ycoord =  random.nextInt(256);

        int zcoord = z + random.nextInt(16);

        new WorldGenMinable(MBlocks.SMO, 4).generate(world, random, xcoord, ycoord, zcoord);

      }

     

  }

 

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

     

  }

 

}

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

package com.kingz101.ore;

 

import cpw.mods.fml.common.IWorldGenerator;

import cpw.mods.fml.common.registry.GameRegistry;

 

public class Ore {

 

public static void mainRegistry() {

defineOre();

IWorldGenerator SMOGen;

}

 

public static IWorldGenerator SMOGen;

 

public static void defineOre() {

 

SMOGen = new SMOreGeneration();

}

 

}

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

MAINREG

 

package com.kingz101.main;

 

 

import com.kingz101.armor.Marmor;

import com.kingz101.blocks.MBlocks;

import com.kingz101.item.MItems;

import com.kingz101.lib.RefStrings;

import com.kingz101.ore.Ore;

 

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

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;

 

@Mod(modid = RefStrings.MODID , name = RefStrings.NAME , version = RefStrings.VERSION)

public class MainRegistry {

 

@SidedProxy(clientSide = RefStrings.CLIENTSIDE , serverSide = RefStrings.SERVERSIDE)

public static ServerProxy proxy;

 

@EventHandler

public static void PreLoad(FMLPreInitializationEvent PreEvent) {

MItems.mainRegistry();

MBlocks.mainRegistry();

Ore.mainRegistry();

CraftingManager.mainRegistry();

proxy.registerRenderInfo () ;

}

@EventHandler

public static void load(FMLInitializationEvent event) {

 

}

@EventHandler

public static void PostLoad(FMLPostInitializationEvent PostEvent) {

 

}

}

 

 

 

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.