Jump to content

1.12.2 OreGen


Recommended Posts

No errors in the console or errors at all but nothing is spawning

Generator Class

public class OreGeneratorFTU implements IWorldGenerator{
	private WorldGenerator ORE_OVERWORLD_FUTURIUM;
	private WorldGenerator ORE_OVERWORLD_TITANIUM;
	private WorldGenerator ORE_OVERWORLD_URANIUM;
	public OreGeneratorFTU() 
		ORE_OVERWORLD_FUTURIUM = new WorldGenMinable(ModBlocks.ORE_OVERWORLD_FUTURIUM.getDefaultState(), 9, BlockMatcher.forBlock(Blocks.STONE));
		ORE_OVERWORLD_URANIUM = new WorldGenMinable(ModBlocks.ORE_OVERWORLD_URANIUM.getDefaultState(), 5, BlockMatcher.forBlock(Blocks.STONE));
		ORE_OVERWORLD_TITANIUM = new WorldGenMinable(ModBlocks.ORE_OVERWORLD_TITANIUM.getDefaultState(), 3, BlockMatcher.forBlock(Blocks.STONE));

	private void runGenerator(WorldGenerator gen, World world, Random rand, int chunkX, int chunkZ, int chance, int minHeight, int maxHeight)
		if(minHeight > maxHeight || minHeight < 0 || maxHeight > 256) throw new IllegalArgumentException("Ore Generated Out Of Bounds !!!");
		int heightDiff = maxHeight - minHeight +1;
		for(int i = 0; i < chance; i++)
			int x = chunkX * 16 + rand.nextInt(16);
			int y = minHeight * 16 + rand.nextInt(heightDiff);
			int z = chunkZ * 16 + rand.nextInt(16);
			gen.generate(world, rand, new BlockPos(x,y,z));

	public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
			IChunkProvider chunkProvider) 
		case -1:
		case 0:
			runGenerator(ORE_OVERWORLD_FUTURIUM, world, random, chunkX, chunkZ, 50, 40, 100);
			runGenerator(ORE_OVERWORLD_TITANIUM, world, random, chunkX, chunkZ, 30, 10, 60);
			runGenerator(ORE_OVERWORLD_URANIUM, world, random, chunkX, chunkZ, 10, 0, 15);
		case 1:


package com.mrf.infinityweapons.util.handlers;

import com.mrf.infinityweapons.init.ModBlocks;
import com.mrf.infinityweapons.init.ModItems;
import com.mrf.infinityweapons.init.ModTileEntitys;
import com.mrf.infinityweapons.util.IHasModel;
import com.mrf.infinityweapons.util.IHasTileEntity;
import com.mrf.infinityweapons.worldgen.ores.OreGeneratorFTU;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class RegistryHandler
	public static void onItemRegester(RegistryEvent.Register<Item> event)
		event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));

	public static void onBlockRegister(RegistryEvent.Register<Block> event)
		event.getRegistry().registerAll(ModBlocks.BLOCKS.toArray(new Block[0]));

	public static void onModelRegister(ModelRegistryEvent event)
		for (Item item : ModItems.ITEMS) {
			if (item instanceof IHasModel) {
				((IHasModel) item).registerModels();

		for (Block block : ModBlocks.BLOCKS) {
			if (block instanceof IHasModel) {
				((IHasModel) block).registerModels();
		for (TileEntity tileEntity : ModTileEntitys.TILEENTITYS) {
			if (tileEntity instanceof IHasTileEntity) {
				((IHasTileEntity) tileEntity).registerTileEntity();
	public static void otherRegistries() 
		GameRegistry.registerWorldGenerator(new OreGeneratorFTU(), 0);


package com.mrf.infinityweapons;

import com.mrf.infinityweapons.proxy.CommonProxy;
import com.mrf.infinityweapons.tabs.InfinityWeaponsTab;
import com.mrf.infinityweapons.util.Referance;
import com.mrf.infinityweapons.util.handlers.GuiHandler;
import com.mrf.infinityweapons.util.handlers.RegistryHandler;

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.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;

@Mod(modid = Referance.MOD_ID , name = Referance.NAME , version = Referance.VERSION)
public class Main {
	public static final CreativeTabs infinityweaponstab = new InfinityWeaponsTab("infinityweaponstab");
	public static Main instance;	
	@SidedProxy(clientSide = Referance.CLIENT_PROXY_CLASS , serverSide = Referance.COMMON_PROXY_CLASS)
	public static CommonProxy proxy;
	public static void PreInit(FMLPreInitializationEvent event) 
	public static void Init(FMLInitializationEvent event) 
		NetworkRegistry.INSTANCE.registerGuiHandler(Main.instance, new GuiHandler());
	public static void PostInit(FMLPostInitializationEvent event)

Can someone please tell me what im doing wrong

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.

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.


  • Create New...

Important Information

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