Jump to content

[1.6.4] OreGen Test


ianno1993

Recommended Posts

Well hello everyone. I'm new to Forge modding and relative new to Java, But i understand enough to program a mod.

 

But i have problems with a adding ore with custom drops. it doesn't seems to recognize my custom drop. And i have no idea what i have to paste, I will paste just the code i have so far.

 

Also before hand, i will say sorry for not using the "Insert code" option, but it didn't work.

EDIT: N.V.M, it worked in a other browser.

 

The main .java:

package ianno.worldgenplus;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraftforge.common.MinecraftForge;
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.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="WorldGenPlus", name="WorldGenPlus", version="0.0.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class WorldGenPlus {

public final static Block carbyneOre = new carbyneOre(500, Material.rock);

public final static Item carbyneCompound = new CarbyneCompound(5000);



        // The instance of your mod that Forge uses.
        @Instance("WorldGenPlus")
        public static WorldGenPlus instance;
       
        // Says where the client and server 'proxy' code is loaded.
        @SidedProxy(clientSide="ianno.worldgenplus.client.ClientProxy", serverSide="ianno.worldgenplus.CommonProxy")
        public static CommonProxy proxy;
       
        @EventHandler
        public void preInit(FMLPreInitializationEvent event) {
                // Stub Method
        }
       
        @EventHandler
        public void load(FMLInitializationEvent event) {
                proxy.registerRenderers();
                
                GameRegistry.registerBlock(carbyneOre, "carbyneOre");
                LanguageRegistry.addName(carbyneOre, "Carbyne Ore");
                MinecraftForge.setBlockHarvestLevel(carbyneOre, "pickaxe", 3);
                
                GameRegistry.registerItem(carbyneCompound, "carbyneCompound");
                LanguageRegistry.addName(carbyneCompound,"Carbyne Compound");
        }
       
        @EventHandler
        public void postInit(FMLPostInitializationEvent event) {
                // Stub Method
        }
       
}

 

 

 

The Ore.java:

package ianno.worldgenplus;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraftforge.common.MinecraftForge;
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.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="WorldGenPlus", name="WorldGenPlus", version="0.0.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class WorldGenPlus {

public final static Block carbyneOre = new carbyneOre(500, Material.rock);

public final static Item carbyneCompound = new CarbyneCompound(5000);



        // The instance of your mod that Forge uses.
        @Instance("WorldGenPlus")
        public static WorldGenPlus instance;
       
        // Says where the client and server 'proxy' code is loaded.
        @SidedProxy(clientSide="ianno.worldgenplus.client.ClientProxy", serverSide="ianno.worldgenplus.CommonProxy")
        public static CommonProxy proxy;
       
        @EventHandler
        public void preInit(FMLPreInitializationEvent event) {
                // Stub Method
        }
       
        @EventHandler
        public void load(FMLInitializationEvent event) {
                proxy.registerRenderers();
                
                GameRegistry.registerBlock(carbyneOre, "carbyneOre");
                LanguageRegistry.addName(carbyneOre, "Carbyne Ore");
                MinecraftForge.setBlockHarvestLevel(carbyneOre, "pickaxe", 3);
                
                GameRegistry.registerItem(carbyneCompound, "carbyneCompound");
                LanguageRegistry.addName(carbyneCompound,"Carbyne Compound");
        }
       
        @EventHandler
        public void postInit(FMLPostInitializationEvent event) {
                // Stub Method
        }
       
}

 

 

 

The OreDrop.java:

package ianno.worldgenplus;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class CarbyneCompound extends Item {

public CarbyneCompound(int id) {
	super(id);
	setMaxStackSize(64);
	setCreativeTab(CreativeTabs.tabMaterials);
	setUnlocalizedName("carbyneCompound");


}

}

 

 

Thanks for spending time to watch this. and i hope you are able to help me.

 

 

Also IF you have a better option to this, i will change my post.

 

Greetings,

The Dutch Guy

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

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