Jump to content

[SOLVED]Config IDs Default to 0


DrOlive

Recommended Posts

I have just made a mod and have added lots of items and a few blocks which were working fine until i tried to create a config file. After I attempted to create the config file, Minecraft crashed and I got this error report:

 

 

---- Minecraft Crash Report ----

// Don't do that.

 

Time: 21/07/13 8:37 PM

Description: Initializing game

 

java.lang.ExceptionInInitializerError

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:457)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:510)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:172)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:470)

at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)

at net.minecraft.client.main.Main.main(Main.java:93)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)

at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

Caused by: java.lang.IllegalArgumentException: Slot 0 is already occupied by drolive.orenimals.OrenimalsBlock@732ec880 when adding drolive.orenimals.OrenimalsBlock@46d8694

at net.minecraft.block.Block.<init>(Block.java:348)

at drolive.orenimals.OrenimalsBlock.<init>(OrenimalsBlock.java:12)

at drolive.orenimals.Orenimals.<clinit>(Orenimals.java:95)

... 35 more

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

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

 

-- Head --

Stacktrace:

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:457)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:510)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:172)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:470)

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)

at net.minecraft.client.main.Main.main(Main.java:93)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)

at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

 

-- System Details --

Details:

Minecraft Version: 1.6.2

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.7.0_07, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 953450400 bytes (909 MB) / 1047592960 bytes (999 MB) up to 1047592960 bytes (999 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v8.04 FML v6.2.19.789 Minecraft Forge 9.10.0.789 4 mods loaded, 4 mods active

mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed

FML{6.2.19.789} [Forge Mod Loader] (coremods) Unloaded->Constructed

Forge{9.10.0.789} [Minecraft Forge] (coremods) Unloaded->Constructed

Orenimals{1.0.0} [Orenimals] (bin) Unloaded

Launched Version: 1.6

LWJGL: 2.9.0

OpenGL: AMD M880G with ATI Mobility Radeon HD 4250 GL version 3.3.10179 Compatibility Profile Context, ATI Technologies Inc.

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Pack: Default

Current Language: English (US)

Profiler Position: N/A (disabled)

Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

 

 

Here is my main class:

 

package drolive.orenimals;

 

import java.util.Random;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.EnumToolMaterial;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.Configuration;

import net.minecraftforge.common.EnumHelper;

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="Orenimals", name="Orenimals", version="1.0.0")

@NetworkMod(clientSideRequired=true, serverSideRequired=false)

 

public class Orenimals {

 

public static CreativeTabs tabOrenimals = new CreativeTabs("tabOrenimals") {

public ItemStack getIconItemStack() {

return new ItemStack(Orenimals.ingotChickenium, 1, 0);

}

};

 

public static EnumToolMaterial toolPorkite = EnumHelper.addToolMaterial("PORKITE", 1, 260, 5.0F, 1.5F, 10);

public static EnumToolMaterial toolChickenium = EnumHelper.addToolMaterial("CHICKENIUM", 1, 200, 6.2F, 1.5F, 10);

public static EnumToolMaterial toolSteakite = EnumHelper.addToolMaterial("STEAKITE", 1, 200, 5.0F, 2.5F, 10);

public static EnumToolMaterial toolWoolidium = EnumHelper.addToolMaterial("WOOLIDIUM", 1, 200, 5.0F, 1.5F, 16);

 

public static int ingotPorkiteID;

public static int ingotChickeniumID;

public static int ingotSteakiteID;

public static int ingotWoolidiumID;

public static int pickaxePorkiteID;

public static int pickaxeChickeniumID;

public static int pickaxeSteakiteID;

public static int pickaxeWoolidiumID;

public static int shovelPorkiteID;

public static int shovelChickeniumID;

public static int shovelSteakiteID;

public static int shovelWoolidiumID;

public static int hoePorkiteID;

public static int hoeChickeniumID;

public static int hoeSteakiteID;

public static int hoeWoolidiumID;

public static int axePorkiteID;

public static int axeChickeniumID;

public static int axeSteakiteID;

public static int axeWoolidiumID;

public static int swordPorkiteID;

public static int swordChickeniumID;

public static int swordSteakiteID;

public static int swordWoolidiumID;

public static int orePorkiteID;

public static int oreChickeniumID;

public static int oreSteakiteID;

public static int oreWoolidiumID;

 

public static final Item ingotPorkite = new OrenimalsItem(ingotPorkiteID, 64, tabOrenimals, "ingotPorkite").func_111206_d("orenimals:ingotPorkite");

public static final Item ingotChickenium = new OrenimalsItem(ingotChickeniumID, 64, tabOrenimals, "ingotChickenium").func_111206_d("orenimals:ingotChickenium");

public static final Item ingotSteakite = new OrenimalsItem(ingotSteakiteID, 64, tabOrenimals, "ingotSteakite").func_111206_d("orenimals:ingotSteakite");

public static final Item ingotWoolidium = new OrenimalsItem(ingotWoolidiumID, 64, tabOrenimals, "ingotWoolididum").func_111206_d("orenimals:ingotWoolidium");

public static final Item pickaxePorkite = new OrenimalsPickaxe(pickaxePorkiteID, toolPorkite, tabOrenimals, "pickaxePorkite").func_111206_d("Orenimals:pickaxePorkite");

public static final Item pickaxeChickenium = new OrenimalsPickaxe(pickaxeChickeniumID, toolChickenium, tabOrenimals, "pickaxeChickenium").func_111206_d("Orenimals:pickaxeChickenium");

public static final Item pickaxeSteakite = new OrenimalsPickaxe(pickaxeSteakiteID, toolSteakite, tabOrenimals, "pickaxeSteakite").func_111206_d("Orenimals:pickaxeSteakite");

public static final Item pickaxeWoolidium = new OrenimalsPickaxe(pickaxeWoolidiumID, toolWoolidium, tabOrenimals, "pickaxeWoolidium").func_111206_d("Orenimals:pickaxeWoolidium");

public static final Item shovelPorkite = new OrenimalsShovel(shovelPorkiteID, toolPorkite, tabOrenimals, "shovelPorkite").func_111206_d("Orenimals:shovelPorkite");

public static final Item shovelChickenium = new OrenimalsShovel(shovelChickeniumID, toolChickenium, tabOrenimals, "shovelChickenium").func_111206_d("Orenimals:shovelChickenium");

public static final Item shovelSteakite = new OrenimalsShovel(shovelSteakiteID, toolSteakite, tabOrenimals, "shovelSteakite").func_111206_d("Orenimals:shovelSteakite");

public static final Item shovelWoolidium = new OrenimalsShovel(shovelWoolidiumID, toolWoolidium, tabOrenimals, "shovelWoolidium").func_111206_d("Orenimals:shovelWoolidium");

public static final Item hoePorkite = new OrenimalsHoe(hoePorkiteID, toolPorkite, tabOrenimals, "hoePorkite").func_111206_d("Orenimals:hoePorkite");

public static final Item hoeChickenium = new OrenimalsHoe(hoeChickeniumID, toolChickenium, tabOrenimals, "hoeChickenium").func_111206_d("Orenimals:hoeChickenium");

public static final Item hoeSteakite = new OrenimalsHoe(hoeSteakiteID, toolSteakite, tabOrenimals, "hoeSteakite").func_111206_d("Orenimals:hoeSteakite");

public static final Item hoeWoolidium = new OrenimalsHoe(hoeWoolidiumID, toolWoolidium, tabOrenimals, "hoeWoolidium").func_111206_d("Orenimals:hoeWoolidium");

public static final Item axePorkite = new OrenimalsAxe(axePorkiteID, toolPorkite, tabOrenimals, "axePorkite").func_111206_d("Orenimals:hatchetPorkite");

public static final Item axeChickenium = new OrenimalsAxe(axeChickeniumID, toolChickenium, tabOrenimals, "axeChickenium").func_111206_d("Orenimals:hatchetChickenium");

public static final Item axeSteakite = new OrenimalsAxe(axeSteakiteID, toolSteakite, tabOrenimals, "axeSteakite").func_111206_d("Orenimals:hatchetSteakite");

public static final Item axeWoolidium = new OrenimalsAxe(axeWoolidiumID, toolWoolidium, tabOrenimals, "axeWoolidium").func_111206_d("Orenimals:hatchetWoolidium");

public static final Item swordPorkite = new OrenimalsSword(swordPorkiteID, toolPorkite, tabOrenimals, "swordPorkite").func_111206_d("Orenimals:swordPorkite");

public static final Item swordChickenium = new OrenimalsSword(swordChickeniumID, toolChickenium, tabOrenimals, "swordChickenium").func_111206_d("Orenimals:swordChickenium");

public static final Item swordSteakite = new OrenimalsSword(swordSteakiteID, toolSteakite, tabOrenimals, "swordSteakite").func_111206_d("Orenimals:swordSteakite");

public static final Item swordWoolidium = new OrenimalsSword(swordWoolidiumID, toolWoolidium, tabOrenimals, "swordWoolidium").func_111206_d("Orenimals:swordWoolidium");

 

public static final Block orePorkite = new OrenimalsBlock(orePorkiteID, Material.rock, 3.0F, Block.soundStoneFootstep, "orePorkite", tabOrenimals).func_111022_d("orenimals:orePorkite");

public static final Block oreChickenium = new OrenimalsBlock(oreChickeniumID, Material.rock, 3.0F, Block.soundStoneFootstep, "oreChickenium", tabOrenimals).func_111022_d("orenimals:oreChickenium");

public static final Block oreSteakite = new OrenimalsBlock(oreSteakiteID, Material.rock, 3.0F, Block.soundStoneFootstep, "oreSteakite", tabOrenimals).func_111022_d("orenimals:oreSteakite");

public static final Block oreWoolidium = new OrenimalsBlock(oreWoolidiumID, Material.rock, 3.0F, Block.soundStoneFootstep, "oreWoolidium", tabOrenimals).func_111022_d("orenimals:oreWoolidium");

 

@Instance("Orenimals")

public static Orenimals instance;

 

@SidedProxy(clientSide="drolive.orenimals.client.ClientProxy", serverSide="drolive.orenimals.CommonProxy")

public static CommonProxy proxy;

 

@EventHandler

public void preInit(FMLPreInitializationEvent event){

 

Configuration config = new Configuration(event.getSuggestedConfigurationFile());

config.load();

 

ingotPorkiteID = config.getItem("Porkite Ingot", 26201).getInt();

ingotChickeniumID = config.getItem("Chickenium Ingot", 26202).getInt();

ingotSteakiteID = config.getItem("Steakite Ingot", 26203).getInt();

ingotWoolidiumID = config.getItem("Woolidium Ingot", 26204).getInt();

pickaxePorkiteID = config.getItem("Porkite Pickaxe", 26205).getInt();

pickaxeChickeniumID = config.getItem("Chickenium Pickaxe", 26206).getInt();

pickaxeSteakiteID = config.getItem("Steakite Pickaxe", 26207).getInt();

pickaxeWoolidiumID = config.getItem("Woolidium Pickaxe", 26208).getInt();

shovelPorkiteID = config.getItem("Porkite Shovel", 26209).getInt();

shovelChickeniumID = config.getItem("Chickenium Shovel", 26210).getInt();

shovelSteakiteID = config.getItem("Steakite Shovel", 26211).getInt();

shovelWoolidiumID = config.getItem("Woolidium Shovel", 26212).getInt();

hoePorkiteID = config.getItem("Porkite Hoe", 26213).getInt();

hoeChickeniumID = config.getItem("Chickenium Hoe", 26214).getInt();

hoeSteakiteID = config.getItem("Steakite Hoe", 26215).getInt();

hoeWoolidiumID = config.getItem("Woolidium Hoe", 26216).getInt();

axePorkiteID = config.getItem("Porkite Axe", 26217).getInt();

axeChickeniumID = config.getItem("Chickenium Axe", 26218).getInt();

axeSteakiteID = config.getItem("Steakite Axe", 26219).getInt();

axeWoolidiumID = config.getItem("Woolidium Axe", 26220).getInt();

swordPorkiteID = config.getItem("Porkite Sword", 26221).getInt();

swordChickeniumID = config.getItem("Chickenium Sword", 26222).getInt();

swordSteakiteID = config.getItem("Steakite Sword", 26223).getInt();

swordWoolidiumID = config.getItem("Woolidium Sword", 26224).getInt();

orePorkiteID = config.getBlock("Porkite Ore", 3001).getInt();

oreChickeniumID = config.getBlock("Chickenium Ore", 3002).getInt();

oreSteakiteID = config.getBlock("Steakite Ore", 3003).getInt();

oreWoolidiumID = config.getBlock("Woolidium Ore", 3004).getInt();

 

config.save();

}

 

@EventHandler

public void load(FMLInitializationEvent event){

proxy.registerRenderers();

 

GameRegistry.registerWorldGenerator(new OrenimalsWorldGen());

 

LanguageRegistry.instance().addStringLocalization("itemGroup.tabOrenimals", "en_US", "Orenimals");

 

ItemStack st = new ItemStack(Item.stick);

ItemStack po = new ItemStack(Orenimals.ingotPorkite);

ItemStack ch = new ItemStack(Orenimals.ingotChickenium);

ItemStack ste = new ItemStack(Orenimals.ingotSteakite);

ItemStack wo = new ItemStack(Orenimals.ingotWoolidium);

 

LanguageRegistry.addName(ingotPorkite, "Porkite Ingot");

GameRegistry.addSmelting(Orenimals.ingotPorkite.itemID, new ItemStack(Item.porkCooked), 0f);

 

LanguageRegistry.addName(ingotChickenium, "Chickenium Ingot");

GameRegistry.addSmelting(Orenimals.ingotChickenium.itemID, new ItemStack(Item.chickenCooked), 0f);

 

LanguageRegistry.addName(ingotSteakite, "Steakite Ingot");

GameRegistry.addSmelting(Orenimals.ingotSteakite.itemID, new ItemStack(Item.beefCooked), 0f);

 

LanguageRegistry.addName(ingotWoolidium, "Woolidium Ingot");

GameRegistry.addSmelting(Orenimals.ingotWoolidium.itemID, new ItemStack(Block.cloth), 0f);

 

LanguageRegistry.addName(pickaxePorkite, "Porkite Pickaxe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxePorkite), "xxx", " y ", " y ", 'x', po, 'y', st);

 

LanguageRegistry.addName(pickaxeChickenium, "Chickenium Pickaxe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxeChickenium), "xxx", " y ", " y ", 'x', ch, 'y', st);

 

LanguageRegistry.addName(pickaxeSteakite, "Steakite Pickaxe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxeSteakite), "xxx", " y ", " y ", 'x', ste, 'y', st);

 

LanguageRegistry.addName(pickaxeWoolidium, "Woolidium Pickaxe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxeWoolidium), "xxx", " y ", " y ", 'x', wo, 'y', st);

 

LanguageRegistry.addName(shovelPorkite, "Porkite Shovel");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelPorkite), "x", "y", "y", 'x', po, 'y', st);

 

LanguageRegistry.addName(shovelChickenium, "Chickenium Shovel");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelChickenium), "x", "y", "y", 'x', ch, 'y', st);

 

LanguageRegistry.addName(shovelSteakite, "Steakite Shovel");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelSteakite), "x", "y", "y", 'x', ste, 'y', st);

 

LanguageRegistry.addName(shovelWoolidium, "Woolidium Shovel");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelWoolidium), "x", "y", "y", 'x', wo, 'y', st);

 

LanguageRegistry.addName(hoePorkite, "Porkite Hoe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoePorkite), "xx", " y", " y", 'x', po, 'y', st);

 

LanguageRegistry.addName(hoeChickenium, "Chickenium Hoe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoeChickenium), "xx", " y", " y", 'x', ch, 'y', st);

 

LanguageRegistry.addName(hoeSteakite, "Steakite Hoe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoeSteakite), "xx", " y", " y", 'x', ste, 'y', st);

 

LanguageRegistry.addName(hoeWoolidium, "Woolidium Hoe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoeWoolidium), "xx", " y", " y", 'x', wo, 'y', st);

 

LanguageRegistry.addName(axePorkite, "Porkite Axe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axePorkite), "xx", "xy", " y", 'x', po, 'y', st);

 

LanguageRegistry.addName(axeChickenium, "Chickenium Axe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axeChickenium), "xx", "xy", " y", 'x', ch, 'y', st);

 

LanguageRegistry.addName(axeSteakite, "Steakite Axe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axeSteakite), "xx", "xy", " y", 'x', ste, 'y', st);

 

LanguageRegistry.addName(axeWoolidium, "Woolidium Axe");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axeWoolidium), "xx", "xy", " y", 'x', wo, 'y', st);

 

LanguageRegistry.addName(swordPorkite, "Porkite Sword");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordPorkite), "x", "x", "y", 'x', po, 'y', st);

 

LanguageRegistry.addName(swordChickenium, "Chickenium Sword");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordChickenium), "x", "x", "y", 'x', ch, 'y', st);

 

LanguageRegistry.addName(swordSteakite, "Steakite Sword");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordSteakite), "x", "x", "y", 'x', ste, 'y', st);

 

LanguageRegistry.addName(swordWoolidium, "Woolidium Sword");

GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordWoolidium), "x", "x", "y", 'x', wo, 'y', st);

 

LanguageRegistry.addName(orePorkite, "Porkite Ore");

GameRegistry.registerBlock(orePorkite, "orePorkite");

MinecraftForge.setBlockHarvestLevel(orePorkite, "pickaxe", 1);

GameRegistry.addSmelting(Orenimals.orePorkite.blockID, new ItemStack(Orenimals.ingotPorkite), 0.5f);

 

LanguageRegistry.addName(oreChickenium, "Chickenium Ore");

GameRegistry.registerBlock(oreChickenium, "oreChickenium");

MinecraftForge.setBlockHarvestLevel(oreChickenium, "pickaxe", 1);

GameRegistry.addSmelting(Orenimals.oreChickenium.blockID, new ItemStack(Orenimals.ingotChickenium), 0.5f);

 

LanguageRegistry.addName(oreSteakite, "Steakite Ore");

GameRegistry.registerBlock(oreSteakite, "oreSteakite");

MinecraftForge.setBlockHarvestLevel(oreSteakite, "pickaxe", 1);

GameRegistry.addSmelting(Orenimals.oreSteakite.blockID, new ItemStack(Orenimals.ingotSteakite), 0.5f);

 

LanguageRegistry.addName(oreWoolidium, "Woolidium Ore");

GameRegistry.registerBlock(oreWoolidium, "oreWoolidium");

MinecraftForge.setBlockHarvestLevel(oreWoolidium, "pickaxe", 1);

GameRegistry.addSmelting(Orenimals.oreWoolidium.blockID, new ItemStack(Orenimals.ingotWoolidium), 0.5f);

 

}

 

@EventHandler

public void postInit(FMLPostInitializationEvent event){

}

 

}

 

 

Here is my Item class:

 

package drolive.orenimals;

 

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

 

public class OrenimalsItem extends Item {

 

public OrenimalsItem(int id, int maxStackSize, CreativeTabs tab, String name) {

super(id);

setMaxStackSize(maxStackSize);

setCreativeTab(tab);

setUnlocalizedName(name);

 

}

 

}

 

 

 

Here is my Block class:

 

package drolive.orenimals;

 

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

 

public class OrenimalsItem extends Item {

 

public OrenimalsItem(int id, int maxStackSize, CreativeTabs tab, String name) {

super(id);

setMaxStackSize(maxStackSize);

setCreativeTab(tab);

setUnlocalizedName(name);

 

}

 

}

 

 

 

 

I'm pretty sure, but not certain, that the config isn't setting the IDs properly, so they're just defaulting to 0.

 

Note: This is my first mod so the code might be a bit messy. If it is, any tips on how to clean it up are appreciated.

 

Any help is appreciated! Thank you for your time!

 

Link to comment
Share on other sites

You are creating the Items on <clinit> which is basically when java loads the class. Don't do that, it's not good. (FML should spit warnings at you, too!)

Because of that, the Items get created before you even load the config, so all the config id fields are still at their default value 0.

Create the items in preInit, after you load the config.

 

I understand what you are saying, and I moved all the items and blocks to preInit after the config, but now I'm getting errors on everything that uses those items and blocks (crafting and smelting recipes, language registers) in Init. How would I fix this?

 

Here's the main class after i switched the Items and Blocks to preInit

package drolive.orenimals;

import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.EnumHelper;
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="Orenimals", name="Orenimals", version="1.0.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)

public class Orenimals {

public static CreativeTabs tabOrenimals = new CreativeTabs("tabOrenimals") {
	public ItemStack getIconItemStack() {
		return new ItemStack(Orenimals.ingotChickenium, 1, 0);
		}
};

public static EnumToolMaterial toolPorkite = EnumHelper.addToolMaterial("PORKITE", 1, 260, 5.0F, 1.5F, 10);
public static EnumToolMaterial toolChickenium = EnumHelper.addToolMaterial("CHICKENIUM", 1, 200, 6.2F, 1.5F, 10);
public static EnumToolMaterial toolSteakite = EnumHelper.addToolMaterial("STEAKITE", 1, 200, 5.0F, 2.5F, 10);
public static EnumToolMaterial toolWoolidium = EnumHelper.addToolMaterial("WOOLIDIUM", 1, 200, 5.0F, 1.5F, 16);

public static int ingotPorkiteID;
public static int ingotChickeniumID;
public static int ingotSteakiteID;
public static int ingotWoolidiumID;
public static int pickaxePorkiteID;
public static int pickaxeChickeniumID;
public static int pickaxeSteakiteID;
public static int pickaxeWoolidiumID;
public static int shovelPorkiteID;
public static int shovelChickeniumID;
public static int shovelSteakiteID;
public static int shovelWoolidiumID;
public static int hoePorkiteID;
public static int hoeChickeniumID;
public static int hoeSteakiteID;
public static int hoeWoolidiumID;
public static int axePorkiteID;
public static int axeChickeniumID;
public static int axeSteakiteID;
public static int axeWoolidiumID;
public static int swordPorkiteID;
public static int swordChickeniumID;
public static int swordSteakiteID;
public static int swordWoolidiumID;
public static int orePorkiteID;
public static int oreChickeniumID;
public static int oreSteakiteID;
public static int oreWoolidiumID;

@Instance("Orenimals")
public static Orenimals instance;

@SidedProxy(clientSide="drolive.orenimals.client.ClientProxy", serverSide="drolive.orenimals.CommonProxy")
public static CommonProxy proxy;

@EventHandler
public void preInit(FMLPreInitializationEvent event){

		Configuration config = new Configuration(event.getSuggestedConfigurationFile());
		config.load();

		ingotPorkiteID = config.getItem("Porkite Ingot", 26201).getInt();
		ingotChickeniumID = config.getItem("Chickenium Ingot", 26202).getInt();
		ingotSteakiteID = config.getItem("Steakite Ingot", 26203).getInt();
		ingotWoolidiumID = config.getItem("Woolidium Ingot", 26204).getInt();
		pickaxePorkiteID = config.getItem("Porkite Pickaxe", 26205).getInt();
		pickaxeChickeniumID = config.getItem("Chickenium Pickaxe", 26206).getInt();
		pickaxeSteakiteID = config.getItem("Steakite Pickaxe", 26207).getInt();
		pickaxeWoolidiumID = config.getItem("Woolidium Pickaxe", 26208).getInt();
		shovelPorkiteID = config.getItem("Porkite Shovel", 26209).getInt();
		shovelChickeniumID = config.getItem("Chickenium Shovel", 26210).getInt();
		shovelSteakiteID = config.getItem("Steakite Shovel", 26211).getInt();
		shovelWoolidiumID = config.getItem("Woolidium Shovel", 26212).getInt();
		hoePorkiteID = config.getItem("Porkite Hoe", 26213).getInt();
		hoeChickeniumID = config.getItem("Chickenium Hoe", 26214).getInt();
		hoeSteakiteID = config.getItem("Steakite Hoe", 26215).getInt();
		hoeWoolidiumID = config.getItem("Woolidium Hoe", 26216).getInt();
		axePorkiteID = config.getItem("Porkite Axe", 26217).getInt();
		axeChickeniumID = config.getItem("Chickenium Axe", 26218).getInt();
		axeSteakiteID = config.getItem("Steakite Axe", 26219).getInt();
		axeWoolidiumID = config.getItem("Woolidium Axe", 26220).getInt();
		swordPorkiteID = config.getItem("Porkite Sword", 26221).getInt();
		swordChickeniumID = config.getItem("Chickenium Sword", 26222).getInt();
		swordSteakiteID = config.getItem("Steakite Sword", 26223).getInt();
		swordWoolidiumID = config.getItem("Woolidium Sword", 26224).getInt();
		orePorkiteID = config.getBlock("Porkite Ore", 3001).getInt();
		oreChickeniumID = config.getBlock("Chickenium Ore", 3002).getInt();
		oreSteakiteID = config.getBlock("Steakite Ore", 3003).getInt();
		oreWoolidiumID = config.getBlock("Woolidium Ore", 3004).getInt();

		config.save();

		Item ingotPorkite = new OrenimalsItem(ingotPorkiteID, 64, tabOrenimals, "ingotPorkite").func_111206_d("orenimals:ingotPorkite");
		Item ingotChickenium = new OrenimalsItem(ingotChickeniumID, 64, tabOrenimals, "ingotChickenium").func_111206_d("orenimals:ingotChickenium");
		Item ingotSteakite = new OrenimalsItem(ingotSteakiteID, 64, tabOrenimals, "ingotSteakite").func_111206_d("orenimals:ingotSteakite");
		Item ingotWoolidium = new OrenimalsItem(ingotWoolidiumID, 64, tabOrenimals, "ingotWoolididum").func_111206_d("orenimals:ingotWoolidium");
		Item pickaxePorkite = new OrenimalsPickaxe(pickaxePorkiteID, toolPorkite, tabOrenimals, "pickaxePorkite").func_111206_d("Orenimals:pickaxePorkite");
		Item pickaxeChickenium = new OrenimalsPickaxe(pickaxeChickeniumID, toolChickenium, tabOrenimals, "pickaxeChickenium").func_111206_d("Orenimals:pickaxeChickenium");
		Item pickaxeSteakite = new OrenimalsPickaxe(pickaxeSteakiteID, toolSteakite, tabOrenimals, "pickaxeSteakite").func_111206_d("Orenimals:pickaxeSteakite");
		Item pickaxeWoolidium = new OrenimalsPickaxe(pickaxeWoolidiumID, toolWoolidium, tabOrenimals, "pickaxeWoolidium").func_111206_d("Orenimals:pickaxeWoolidium");
		Item shovelPorkite = new OrenimalsShovel(shovelPorkiteID, toolPorkite, tabOrenimals, "shovelPorkite").func_111206_d("Orenimals:shovelPorkite");
		Item shovelChickenium = new OrenimalsShovel(shovelChickeniumID, toolChickenium, tabOrenimals, "shovelChickenium").func_111206_d("Orenimals:shovelChickenium");
		Item shovelSteakite = new OrenimalsShovel(shovelSteakiteID, toolSteakite, tabOrenimals, "shovelSteakite").func_111206_d("Orenimals:shovelSteakite");
		Item shovelWoolidium = new OrenimalsShovel(shovelWoolidiumID, toolWoolidium, tabOrenimals, "shovelWoolidium").func_111206_d("Orenimals:shovelWoolidium");
		Item hoePorkite = new OrenimalsHoe(hoePorkiteID, toolPorkite, tabOrenimals, "hoePorkite").func_111206_d("Orenimals:hoePorkite");
		Item hoeChickenium = new OrenimalsHoe(hoeChickeniumID, toolChickenium, tabOrenimals, "hoeChickenium").func_111206_d("Orenimals:hoeChickenium");
		Item hoeSteakite = new OrenimalsHoe(hoeSteakiteID, toolSteakite, tabOrenimals, "hoeSteakite").func_111206_d("Orenimals:hoeSteakite");
		Item hoeWoolidium = new OrenimalsHoe(hoeWoolidiumID, toolWoolidium, tabOrenimals, "hoeWoolidium").func_111206_d("Orenimals:hoeWoolidium");
		Item axePorkite = new OrenimalsAxe(axePorkiteID, toolPorkite, tabOrenimals, "axePorkite").func_111206_d("Orenimals:hatchetPorkite");
		Item axeChickenium = new OrenimalsAxe(axeChickeniumID, toolChickenium, tabOrenimals, "axeChickenium").func_111206_d("Orenimals:hatchetChickenium");
		Item axeSteakite = new OrenimalsAxe(axeSteakiteID, toolSteakite, tabOrenimals, "axeSteakite").func_111206_d("Orenimals:hatchetSteakite");
		Item axeWoolidium = new OrenimalsAxe(axeWoolidiumID, toolWoolidium, tabOrenimals, "axeWoolidium").func_111206_d("Orenimals:hatchetWoolidium");
		Item swordPorkite = new OrenimalsSword(swordPorkiteID, toolPorkite, tabOrenimals, "swordPorkite").func_111206_d("Orenimals:swordPorkite");
		Item swordChickenium = new OrenimalsSword(swordChickeniumID, toolChickenium, tabOrenimals, "swordChickenium").func_111206_d("Orenimals:swordChickenium");
		Item swordSteakite = new OrenimalsSword(swordSteakiteID, toolSteakite, tabOrenimals, "swordSteakite").func_111206_d("Orenimals:swordSteakite");
		Item swordWoolidium = new OrenimalsSword(swordWoolidiumID, toolWoolidium, tabOrenimals, "swordWoolidium").func_111206_d("Orenimals:swordWoolidium");

		Block orePorkite = new OrenimalsBlock(orePorkiteID, Material.rock, 3.0F, Block.soundStoneFootstep, "orePorkite", tabOrenimals).func_111022_d("orenimals:orePorkite");
		Block oreChickenium = new OrenimalsBlock(oreChickeniumID, Material.rock, 3.0F, Block.soundStoneFootstep, "oreChickenium", tabOrenimals).func_111022_d("orenimals:oreChickenium");
		Block oreSteakite = new OrenimalsBlock(oreSteakiteID, Material.rock, 3.0F, Block.soundStoneFootstep, "oreSteakite", tabOrenimals).func_111022_d("orenimals:oreSteakite");
		Block oreWoolidium = new OrenimalsBlock(oreWoolidiumID, Material.rock, 3.0F, Block.soundStoneFootstep, "oreWoolidium", tabOrenimals).func_111022_d("orenimals:oreWoolidium");

}

@EventHandler
public void load(FMLInitializationEvent event){
		proxy.registerRenderers();

		GameRegistry.registerWorldGenerator(new OrenimalsWorldGen());

		LanguageRegistry.instance().addStringLocalization("itemGroup.tabOrenimals", "en_US", "Orenimals");

		ItemStack st = new ItemStack(Item.stick);
		ItemStack po = new ItemStack(Orenimals.ingotPorkite);
		ItemStack ch = new ItemStack(Orenimals.ingotChickenium);
		ItemStack ste = new ItemStack(Orenimals.ingotSteakite);
		ItemStack wo = new ItemStack(Orenimals.ingotWoolidium);

		LanguageRegistry.addName(ingotPorkite, "Porkite Ingot");
		GameRegistry.addSmelting(Orenimals.ingotPorkite.itemID, new ItemStack(Item.porkCooked), 0f);

		LanguageRegistry.addName(ingotChickenium, "Chickenium Ingot");
		GameRegistry.addSmelting(Orenimals.ingotChickenium.itemID, new ItemStack(Item.chickenCooked), 0f);

		LanguageRegistry.addName(ingotSteakite, "Steakite Ingot");
		GameRegistry.addSmelting(Orenimals.ingotSteakite.itemID, new ItemStack(Item.beefCooked), 0f);

		LanguageRegistry.addName(ingotWoolidium, "Woolidium Ingot");
		GameRegistry.addSmelting(Orenimals.ingotWoolidium.itemID, new ItemStack(Block.cloth), 0f);

		LanguageRegistry.addName(pickaxePorkite, "Porkite Pickaxe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxePorkite), "xxx", " y ", " y ", 'x', po, 'y', st);

		LanguageRegistry.addName(pickaxeChickenium, "Chickenium Pickaxe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxeChickenium), "xxx", " y ", " y ", 'x', ch, 'y', st);

		LanguageRegistry.addName(pickaxeSteakite, "Steakite Pickaxe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxeSteakite), "xxx", " y ", " y ", 'x', ste, 'y', st);

		LanguageRegistry.addName(pickaxeWoolidium, "Woolidium Pickaxe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxeWoolidium), "xxx", " y ", " y ", 'x', wo, 'y', st);

		LanguageRegistry.addName(shovelPorkite, "Porkite Shovel");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelPorkite), "x", "y", "y", 'x', po, 'y', st);

		LanguageRegistry.addName(shovelChickenium, "Chickenium Shovel");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelChickenium), "x", "y", "y", 'x', ch, 'y', st);

		LanguageRegistry.addName(shovelSteakite, "Steakite Shovel");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelSteakite), "x", "y", "y", 'x', ste, 'y', st);

		LanguageRegistry.addName(shovelWoolidium, "Woolidium Shovel");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelWoolidium), "x", "y", "y", 'x', wo, 'y', st);

		LanguageRegistry.addName(hoePorkite, "Porkite Hoe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoePorkite), "xx", " y", " y", 'x', po, 'y', st);

		LanguageRegistry.addName(hoeChickenium, "Chickenium Hoe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoeChickenium), "xx", " y", " y", 'x', ch, 'y', st);

		LanguageRegistry.addName(hoeSteakite, "Steakite Hoe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoeSteakite), "xx", " y", " y", 'x', ste, 'y', st);

		LanguageRegistry.addName(hoeWoolidium, "Woolidium Hoe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoeWoolidium), "xx", " y", " y", 'x', wo, 'y', st);

		LanguageRegistry.addName(axePorkite, "Porkite Axe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axePorkite), "xx", "xy", " y", 'x', po, 'y', st);

		LanguageRegistry.addName(axeChickenium, "Chickenium Axe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axeChickenium), "xx", "xy", " y", 'x', ch, 'y', st);

		LanguageRegistry.addName(axeSteakite, "Steakite Axe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axeSteakite), "xx", "xy", " y", 'x', ste, 'y', st);

		LanguageRegistry.addName(axeWoolidium, "Woolidium Axe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axeWoolidium), "xx", "xy", " y", 'x', wo, 'y', st);

		LanguageRegistry.addName(swordPorkite, "Porkite Sword");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordPorkite), "x", "x", "y", 'x', po, 'y', st);

		LanguageRegistry.addName(swordChickenium, "Chickenium Sword");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordChickenium), "x", "x", "y", 'x', ch, 'y', st);

		LanguageRegistry.addName(swordSteakite, "Steakite Sword");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordSteakite), "x", "x", "y", 'x', ste, 'y', st);

		LanguageRegistry.addName(swordWoolidium, "Woolidium Sword");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordWoolidium), "x", "x", "y", 'x', wo, 'y', st);

		LanguageRegistry.addName(orePorkite, "Porkite Ore");
		GameRegistry.registerBlock(orePorkite, "orePorkite");
		MinecraftForge.setBlockHarvestLevel(orePorkite, "pickaxe", 1);
		GameRegistry.addSmelting(Orenimals.orePorkite.blockID, new ItemStack(Orenimals.ingotPorkite), 0.5f);

		LanguageRegistry.addName(oreChickenium, "Chickenium Ore");
		GameRegistry.registerBlock(oreChickenium, "oreChickenium");
		MinecraftForge.setBlockHarvestLevel(oreChickenium, "pickaxe", 1);
		GameRegistry.addSmelting(Orenimals.oreChickenium.blockID, new ItemStack(Orenimals.ingotChickenium), 0.5f);

		LanguageRegistry.addName(oreSteakite, "Steakite Ore");
		GameRegistry.registerBlock(oreSteakite, "oreSteakite");
		MinecraftForge.setBlockHarvestLevel(oreSteakite, "pickaxe", 1);
		GameRegistry.addSmelting(Orenimals.oreSteakite.blockID, new ItemStack(Orenimals.ingotSteakite), 0.5f);

		LanguageRegistry.addName(oreWoolidium, "Woolidium Ore");
		GameRegistry.registerBlock(oreWoolidium, "oreWoolidium");
		MinecraftForge.setBlockHarvestLevel(oreWoolidium, "pickaxe", 1);
		GameRegistry.addSmelting(Orenimals.oreWoolidium.blockID, new ItemStack(Orenimals.ingotWoolidium), 0.5f);

}

@EventHandler
public void postInit(FMLPostInitializationEvent event){
}

}

Link to comment
Share on other sites

Don't make them local variables. Still have the Blocks and Items as a public static field in your class.

But do not construct them right there (at the field declaration).

Construct them in the preInit.

Btw: All your registering (Items, Blocks, Recipes) should happen in preInit, according to cpws javadocs.

 

Ok so I moved everything into preInit from Init, and it solved the ID problems (thank you by the way) but now I'm getting an error involving the ItemStacks.

Error report:

 

---- Minecraft Crash Report ----

// Hey, that tickles! Hehehe!

 

Time: 22/07/13 8:28 AM

Description: Initializing game

 

java.lang.NullPointerException

at net.minecraft.item.ItemStack.<init>(ItemStack.java:76)

at drolive.orenimals.Orenimals.preInit(Orenimals.java:178)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:521)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:172)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:470)

at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)

at net.minecraft.client.main.Main.main(Main.java:93)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)

at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

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

 

-- Head --

Stacktrace:

at net.minecraft.item.ItemStack.<init>(ItemStack.java:76)

at drolive.orenimals.Orenimals.preInit(Orenimals.java:178)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:521)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:172)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:470)

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)

at net.minecraft.client.main.Main.main(Main.java:93)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)

at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

 

-- System Details --

Details:

Minecraft Version: 1.6.2

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.7.0_07, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 949767224 bytes (905 MB) / 1047592960 bytes (999 MB) up to 1047592960 bytes (999 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v8.04 FML v6.2.19.789 Minecraft Forge 9.10.0.789 4 mods loaded, 4 mods active

mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized

FML{6.2.19.789} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized

Forge{9.10.0.789} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized

Orenimals{1.0.0} [Orenimals] (bin) Unloaded->Constructed->Errored

Launched Version: 1.6

LWJGL: 2.9.0

OpenGL: AMD M880G with ATI Mobility Radeon HD 4250 GL version 3.3.10179 Compatibility Profile Context, ATI Technologies Inc.

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Pack: Default

Current Language: English (US)

Profiler Position: N/A (disabled)

Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

 

 

My main class once again:

package drolive.orenimals;

import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.EnumHelper;
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="Orenimals", name="Orenimals", version="1.0.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)

public class Orenimals {
//Creative Tab
public static CreativeTabs tabOrenimals = new CreativeTabs("tabOrenimals") {
	public ItemStack getIconItemStack() {
		return new ItemStack(Orenimals.ingotChickenium, 1, 0);
		}
};
//Tool Materials
public static EnumToolMaterial toolPorkite = EnumHelper.addToolMaterial("PORKITE", 1, 260, 5.0F, 1.5F, 10);
public static EnumToolMaterial toolChickenium = EnumHelper.addToolMaterial("CHICKENIUM", 1, 200, 6.2F, 1.5F, 10);
public static EnumToolMaterial toolSteakite = EnumHelper.addToolMaterial("STEAKITE", 1, 200, 5.0F, 2.5F, 10);
public static EnumToolMaterial toolWoolidium = EnumHelper.addToolMaterial("WOOLIDIUM", 1, 200, 5.0F, 1.5F, 16);
//Item IDs
public static int ingotPorkiteID;
public static int ingotChickeniumID;
public static int ingotSteakiteID;
public static int ingotWoolidiumID;
public static int pickaxePorkiteID;
public static int pickaxeChickeniumID;
public static int pickaxeSteakiteID;
public static int pickaxeWoolidiumID;
public static int shovelPorkiteID;
public static int shovelChickeniumID;
public static int shovelSteakiteID;
public static int shovelWoolidiumID;
public static int hoePorkiteID;
public static int hoeChickeniumID;
public static int hoeSteakiteID;
public static int hoeWoolidiumID;
public static int axePorkiteID;
public static int axeChickeniumID;
public static int axeSteakiteID;
public static int axeWoolidiumID;
public static int swordPorkiteID;
public static int swordChickeniumID;
public static int swordSteakiteID;
public static int swordWoolidiumID;
//Block IDs
public static int orePorkiteID;
public static int oreChickeniumID;
public static int oreSteakiteID;
public static int oreWoolidiumID;
//Items
public static Item ingotPorkite;
public static Item ingotChickenium;
public static Item ingotSteakite;
public static Item ingotWoolidium;
public static Item pickaxePorkite;
public static Item pickaxeChickenium;
public static Item pickaxeSteakite;
public static Item pickaxeWoolidium;
public static Item shovelPorkite;
public static Item shovelChickenium;
public static Item shovelSteakite;
public static Item shovelWoolidium;
public static Item hoePorkite;
public static Item hoeChickenium;
public static Item hoeSteakite;
public static Item hoeWoolidium;
public static Item axePorkite;
public static Item axeChickenium;
public static Item axeSteakite;
public static Item axeWoolidium;
public static Item swordPorkite;
public static Item swordChickenium;
public static Item swordSteakite;
public static Item swordWoolidium;
//Blocks
public static Block orePorkite;
public static Block oreChickenium;
public static Block oreSteakite;
public static Block oreWoolidium;

@Instance("Orenimals")
public static Orenimals instance;

@SidedProxy(clientSide="drolive.orenimals.client.ClientProxy", serverSide="drolive.orenimals.CommonProxy")
public static CommonProxy proxy;

@EventHandler
public void preInit(FMLPreInitializationEvent event){

		Configuration config = new Configuration(event.getSuggestedConfigurationFile());
		config.load();

		ingotPorkiteID = config.getItem("Porkite Ingot", 26201).getInt();
		ingotChickeniumID = config.getItem("Chickenium Ingot", 26202).getInt();
		ingotSteakiteID = config.getItem("Steakite Ingot", 26203).getInt();
		ingotWoolidiumID = config.getItem("Woolidium Ingot", 26204).getInt();
		pickaxePorkiteID = config.getItem("Porkite Pickaxe", 26205).getInt();
		pickaxeChickeniumID = config.getItem("Chickenium Pickaxe", 26206).getInt();
		pickaxeSteakiteID = config.getItem("Steakite Pickaxe", 26207).getInt();
		pickaxeWoolidiumID = config.getItem("Woolidium Pickaxe", 26208).getInt();
		shovelPorkiteID = config.getItem("Porkite Shovel", 26209).getInt();
		shovelChickeniumID = config.getItem("Chickenium Shovel", 26210).getInt();
		shovelSteakiteID = config.getItem("Steakite Shovel", 26211).getInt();
		shovelWoolidiumID = config.getItem("Woolidium Shovel", 26212).getInt();
		hoePorkiteID = config.getItem("Porkite Hoe", 26213).getInt();
		hoeChickeniumID = config.getItem("Chickenium Hoe", 26214).getInt();
		hoeSteakiteID = config.getItem("Steakite Hoe", 26215).getInt();
		hoeWoolidiumID = config.getItem("Woolidium Hoe", 26216).getInt();
		axePorkiteID = config.getItem("Porkite Axe", 26217).getInt();
		axeChickeniumID = config.getItem("Chickenium Axe", 26218).getInt();
		axeSteakiteID = config.getItem("Steakite Axe", 26219).getInt();
		axeWoolidiumID = config.getItem("Woolidium Axe", 26220).getInt();
		swordPorkiteID = config.getItem("Porkite Sword", 26221).getInt();
		swordChickeniumID = config.getItem("Chickenium Sword", 26222).getInt();
		swordSteakiteID = config.getItem("Steakite Sword", 26223).getInt();
		swordWoolidiumID = config.getItem("Woolidium Sword", 26224).getInt();
		orePorkiteID = config.getBlock("Porkite Ore", 3001).getInt();
		oreChickeniumID = config.getBlock("Chickenium Ore", 3002).getInt();
		oreSteakiteID = config.getBlock("Steakite Ore", 3003).getInt();
		oreWoolidiumID = config.getBlock("Woolidium Ore", 3004).getInt();

		config.save();

GameRegistry.registerWorldGenerator(new OrenimalsWorldGen());

		LanguageRegistry.instance().addStringLocalization("itemGroup.tabOrenimals", "en_US", "Orenimals");
		//Items
		Item ingotPorkite = new OrenimalsItem(ingotPorkiteID, 64, tabOrenimals, "ingotPorkite").func_111206_d("orenimals:ingotPorkite");
		Item ingotChickenium = new OrenimalsItem(ingotChickeniumID, 64, tabOrenimals, "ingotChickenium").func_111206_d("orenimals:ingotChickenium");
		Item ingotSteakite = new OrenimalsItem(ingotSteakiteID, 64, tabOrenimals, "ingotSteakite").func_111206_d("orenimals:ingotSteakite");
		Item ingotWoolidium = new OrenimalsItem(ingotWoolidiumID, 64, tabOrenimals, "ingotWoolididum").func_111206_d("orenimals:ingotWoolidium");
		Item pickaxePorkite = new OrenimalsPickaxe(pickaxePorkiteID, toolPorkite, tabOrenimals, "pickaxePorkite").func_111206_d("Orenimals:pickaxePorkite");
		Item pickaxeChickenium = new OrenimalsPickaxe(pickaxeChickeniumID, toolChickenium, tabOrenimals, "pickaxeChickenium").func_111206_d("Orenimals:pickaxeChickenium");
		Item pickaxeSteakite = new OrenimalsPickaxe(pickaxeSteakiteID, toolSteakite, tabOrenimals, "pickaxeSteakite").func_111206_d("Orenimals:pickaxeSteakite");
		Item pickaxeWoolidium = new OrenimalsPickaxe(pickaxeWoolidiumID, toolWoolidium, tabOrenimals, "pickaxeWoolidium").func_111206_d("Orenimals:pickaxeWoolidium");
		Item shovelPorkite = new OrenimalsShovel(shovelPorkiteID, toolPorkite, tabOrenimals, "shovelPorkite").func_111206_d("Orenimals:shovelPorkite");
		Item shovelChickenium = new OrenimalsShovel(shovelChickeniumID, toolChickenium, tabOrenimals, "shovelChickenium").func_111206_d("Orenimals:shovelChickenium");
		Item shovelSteakite = new OrenimalsShovel(shovelSteakiteID, toolSteakite, tabOrenimals, "shovelSteakite").func_111206_d("Orenimals:shovelSteakite");
		Item shovelWoolidium = new OrenimalsShovel(shovelWoolidiumID, toolWoolidium, tabOrenimals, "shovelWoolidium").func_111206_d("Orenimals:shovelWoolidium");
		Item hoePorkite = new OrenimalsHoe(hoePorkiteID, toolPorkite, tabOrenimals, "hoePorkite").func_111206_d("Orenimals:hoePorkite");
		Item hoeChickenium = new OrenimalsHoe(hoeChickeniumID, toolChickenium, tabOrenimals, "hoeChickenium").func_111206_d("Orenimals:hoeChickenium");
		Item hoeSteakite = new OrenimalsHoe(hoeSteakiteID, toolSteakite, tabOrenimals, "hoeSteakite").func_111206_d("Orenimals:hoeSteakite");
		Item hoeWoolidium = new OrenimalsHoe(hoeWoolidiumID, toolWoolidium, tabOrenimals, "hoeWoolidium").func_111206_d("Orenimals:hoeWoolidium");
		Item axePorkite = new OrenimalsAxe(axePorkiteID, toolPorkite, tabOrenimals, "axePorkite").func_111206_d("Orenimals:hatchetPorkite");
		Item axeChickenium = new OrenimalsAxe(axeChickeniumID, toolChickenium, tabOrenimals, "axeChickenium").func_111206_d("Orenimals:hatchetChickenium");
		Item axeSteakite = new OrenimalsAxe(axeSteakiteID, toolSteakite, tabOrenimals, "axeSteakite").func_111206_d("Orenimals:hatchetSteakite");
		Item axeWoolidium = new OrenimalsAxe(axeWoolidiumID, toolWoolidium, tabOrenimals, "axeWoolidium").func_111206_d("Orenimals:hatchetWoolidium");
		Item swordPorkite = new OrenimalsSword(swordPorkiteID, toolPorkite, tabOrenimals, "swordPorkite").func_111206_d("Orenimals:swordPorkite");
		Item swordChickenium = new OrenimalsSword(swordChickeniumID, toolChickenium, tabOrenimals, "swordChickenium").func_111206_d("Orenimals:swordChickenium");
		Item swordSteakite = new OrenimalsSword(swordSteakiteID, toolSteakite, tabOrenimals, "swordSteakite").func_111206_d("Orenimals:swordSteakite");
		Item swordWoolidium = new OrenimalsSword(swordWoolidiumID, toolWoolidium, tabOrenimals, "swordWoolidium").func_111206_d("Orenimals:swordWoolidium");
		//Blocks
		Block orePorkite = new OrenimalsBlock(orePorkiteID, Material.rock, 3.0F, Block.soundStoneFootstep, "orePorkite", tabOrenimals).func_111022_d("orenimals:orePorkite");
		Block oreChickenium = new OrenimalsBlock(oreChickeniumID, Material.rock, 3.0F, Block.soundStoneFootstep, "oreChickenium", tabOrenimals).func_111022_d("orenimals:oreChickenium");
		Block oreSteakite = new OrenimalsBlock(oreSteakiteID, Material.rock, 3.0F, Block.soundStoneFootstep, "oreSteakite", tabOrenimals).func_111022_d("orenimals:oreSteakite");
		Block oreWoolidium = new OrenimalsBlock(oreWoolidiumID, Material.rock, 3.0F, Block.soundStoneFootstep, "oreWoolidium", tabOrenimals).func_111022_d("orenimals:oreWoolidium");
		//Recipes
		ItemStack st = new ItemStack(Item.stick);
		ItemStack po = new ItemStack(Orenimals.ingotPorkite);
		ItemStack ch = new ItemStack(Orenimals.ingotChickenium);
		ItemStack ste = new ItemStack(Orenimals.ingotSteakite);
		ItemStack wo = new ItemStack(Orenimals.ingotWoolidium);

		LanguageRegistry.addName(ingotPorkite, "Porkite Ingot");
		GameRegistry.addSmelting(Orenimals.ingotPorkite.itemID, new ItemStack(Item.porkCooked), 0f);

		LanguageRegistry.addName(ingotChickenium, "Chickenium Ingot");
		GameRegistry.addSmelting(Orenimals.ingotChickenium.itemID, new ItemStack(Item.chickenCooked), 0f);

		LanguageRegistry.addName(ingotSteakite, "Steakite Ingot");
		GameRegistry.addSmelting(Orenimals.ingotSteakite.itemID, new ItemStack(Item.beefCooked), 0f);

		LanguageRegistry.addName(ingotWoolidium, "Woolidium Ingot");
		GameRegistry.addSmelting(Orenimals.ingotWoolidium.itemID, new ItemStack(Block.cloth), 0f);

		LanguageRegistry.addName(pickaxePorkite, "Porkite Pickaxe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxePorkite), "xxx", " y ", " y ", 'x', po, 'y', st);

		LanguageRegistry.addName(pickaxeChickenium, "Chickenium Pickaxe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxeChickenium), "xxx", " y ", " y ", 'x', ch, 'y', st);

		LanguageRegistry.addName(pickaxeSteakite, "Steakite Pickaxe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxeSteakite), "xxx", " y ", " y ", 'x', ste, 'y', st);

		LanguageRegistry.addName(pickaxeWoolidium, "Woolidium Pickaxe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.pickaxeWoolidium), "xxx", " y ", " y ", 'x', wo, 'y', st);

		LanguageRegistry.addName(shovelPorkite, "Porkite Shovel");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelPorkite), "x", "y", "y", 'x', po, 'y', st);

		LanguageRegistry.addName(shovelChickenium, "Chickenium Shovel");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelChickenium), "x", "y", "y", 'x', ch, 'y', st);

		LanguageRegistry.addName(shovelSteakite, "Steakite Shovel");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelSteakite), "x", "y", "y", 'x', ste, 'y', st);

		LanguageRegistry.addName(shovelWoolidium, "Woolidium Shovel");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.shovelWoolidium), "x", "y", "y", 'x', wo, 'y', st);

		LanguageRegistry.addName(hoePorkite, "Porkite Hoe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoePorkite), "xx", " y", " y", 'x', po, 'y', st);

		LanguageRegistry.addName(hoeChickenium, "Chickenium Hoe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoeChickenium), "xx", " y", " y", 'x', ch, 'y', st);

		LanguageRegistry.addName(hoeSteakite, "Steakite Hoe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoeSteakite), "xx", " y", " y", 'x', ste, 'y', st);

		LanguageRegistry.addName(hoeWoolidium, "Woolidium Hoe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.hoeWoolidium), "xx", " y", " y", 'x', wo, 'y', st);

		LanguageRegistry.addName(axePorkite, "Porkite Axe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axePorkite), "xx", "xy", " y", 'x', po, 'y', st);

		LanguageRegistry.addName(axeChickenium, "Chickenium Axe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axeChickenium), "xx", "xy", " y", 'x', ch, 'y', st);

		LanguageRegistry.addName(axeSteakite, "Steakite Axe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axeSteakite), "xx", "xy", " y", 'x', ste, 'y', st);

		LanguageRegistry.addName(axeWoolidium, "Woolidium Axe");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.axeWoolidium), "xx", "xy", " y", 'x', wo, 'y', st);

		LanguageRegistry.addName(swordPorkite, "Porkite Sword");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordPorkite), "x", "x", "y", 'x', po, 'y', st);

		LanguageRegistry.addName(swordChickenium, "Chickenium Sword");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordChickenium), "x", "x", "y", 'x', ch, 'y', st);

		LanguageRegistry.addName(swordSteakite, "Steakite Sword");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordSteakite), "x", "x", "y", 'x', ste, 'y', st);

		LanguageRegistry.addName(swordWoolidium, "Woolidium Sword");
		GameRegistry.addShapedRecipe(new ItemStack(Orenimals.swordWoolidium), "x", "x", "y", 'x', wo, 'y', st);

		LanguageRegistry.addName(orePorkite, "Porkite Ore");
		GameRegistry.registerBlock(orePorkite, "orePorkite");
		MinecraftForge.setBlockHarvestLevel(orePorkite, "pickaxe", 1);
		GameRegistry.addSmelting(Orenimals.orePorkite.blockID, new ItemStack(Orenimals.ingotPorkite), 0.5f);

		LanguageRegistry.addName(oreChickenium, "Chickenium Ore");
		GameRegistry.registerBlock(oreChickenium, "oreChickenium");
		MinecraftForge.setBlockHarvestLevel(oreChickenium, "pickaxe", 1);
		GameRegistry.addSmelting(Orenimals.oreChickenium.blockID, new ItemStack(Orenimals.ingotChickenium), 0.5f);

		LanguageRegistry.addName(oreSteakite, "Steakite Ore");
		GameRegistry.registerBlock(oreSteakite, "oreSteakite");
		MinecraftForge.setBlockHarvestLevel(oreSteakite, "pickaxe", 1);
		GameRegistry.addSmelting(Orenimals.oreSteakite.blockID, new ItemStack(Orenimals.ingotSteakite), 0.5f);

		LanguageRegistry.addName(oreWoolidium, "Woolidium Ore");
		GameRegistry.registerBlock(oreWoolidium, "oreWoolidium");
		MinecraftForge.setBlockHarvestLevel(oreWoolidium, "pickaxe", 1);
		GameRegistry.addSmelting(Orenimals.oreWoolidium.blockID, new ItemStack(Orenimals.ingotWoolidium), 0.5f);

}

@EventHandler
public void load(FMLInitializationEvent event){
		proxy.registerRenderers();

}

@EventHandler
public void postInit(FMLPostInitializationEvent event){
}

}

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.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
    • It is an issue with quark - update it to this build: https://www.curseforge.com/minecraft/mc-mods/quark/files/3642325
    • Remove Instant Massive Structures Mod from your server     Add new crash-reports with sites like https://paste.ee/  
    • Update your drivers: https://www.amd.com/en/support/graphics/amd-radeon-r9-series/amd-radeon-r9-200-series/amd-radeon-r9-280x
  • Topics

×
×
  • Create New...

Important Information

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