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.

[1.7.10] [SOLVED] Ore Generation is broken, followed tutorials, it doesnt work

Featured Replies

Posted

HELP! My code is not working, I followed like 8 different tuts, stole code from GitHub (only as last resort), but my ore doesnt generate!

Main Class -

package com.rabidfox.syntheticgems;

 

import net.minecraft.block.Block;

import net.minecraft.init.Items;

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.event.FMLPreInitializationEvent;

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

 

@Mod(modid = "syntheticgems", version = "1.0.0")

public class SyntheticGems {

//Block Variables//

public static Block orebauxite;

public static Block oresodium;

//Item Variables//

public static Item itemsodiumraw;

public static Item itemlye;

public static Item itemlyesolution;

@EventHandler

public void preinit(FMLPreInitializationEvent event)

{

//Block Variable Defining//

orebauxite = new OreBauxite();

orebauxite.setHarvestLevel("pickaxe", 1);

oresodium = new OreSodium();

oresodium.setHarvestLevel("pickaxe", 0);

//Item Variable Defining//

itemsodiumraw = new ItemSodiumRaw();

itemlye = new ItemLye();

itemlyesolution = new ItemLyeSolution();

//Block Variable Registering//

GameRegistry.registerBlock(orebauxite, "orebauxite");

GameRegistry.registerBlock(oresodium, "oresodium");

//Item Variable Registering//

GameRegistry.registerItem(itemsodiumraw, "itemsodiumraw"); 

GameRegistry.registerItem(itemlye, "itemlye"); 

GameRegistry.registerItem(itemlyesolution, "itemlyesolution"); 

//Smelting//

GameRegistry.addSmelting(oresodium, new ItemStack(itemsodiumraw), (float) 0.1);

//Shapeless//

GameRegistry.addShapelessRecipe(new ItemStack(itemlye,1), itemsodiumraw, Items.water_bucket);

GameRegistry.addShapelessRecipe(new ItemStack(itemlyesolution,1), new ItemStack(itemlye), new ItemStack(Items.potionitem, 0));

}

public void init(FMLInitializationEvent event)

{

//Generator Registry//

GameRegistry.registerWorldGenerator(new SynthOreGen(), 5);

}

}

 

 

 

 

 

 

Ore Gen -

package com.rabidfox.syntheticgems;

 

 

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 SynthOreGen 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);

System.out.println("Generated Bauxite in chunk at " + chunkX*16 + "x, " + chunkZ*16 + "z!");

break;

case 1:

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

}

 

}

 

 

private void generateInEnd(World world, Random random, int x, int z) {

// TODO Auto-generated method stub

 

}

 

 

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

// TODO Auto-generated method stub

for (int i = 0; i < 25; i++) { // means set i = 0, then if its less than 25 keep adding one to i

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

int chunkY = random.nextInt(256);

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

 

 

new WorldGenMinable(SyntheticGems.orebauxite, 50).generate(world, random, chunkX, chunkY, chunkZ);

 

 

}

}

 

 

private void generateInNether(World world, Random random, int x, int z) {

// TODO Auto-generated method stub

 

}

 

 

}

 

PLZ HELP ME

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.