Hello,
I am currently trying to develop a mod called Minology. I've been having troubles with pieces of code in my file, CoreLanguageRegistry. Specifically...
public static void registerNames() {
registerBlocks();
registerTools();
registerItems();
registerMachines();
}
Keep in mind that I get no errors.
The only problem in the first piece of code is "registerBlocks();", which leads right into the other source in CoreLanguageRegistry. Usually, I find the crash's 'link' lead to the Copper Ore registry.
When I tried to comment it out, it came up with another crash, this time leading to the Vintium Ore registry. Then, I tried to comment out the entire registerBlocks void, along with it's reference in the registerNames void. That worked fine, but as soon as I uncommented registerBlocks (the very first line, and ending bracket), the line registering the Block of Copper, and it's reference in registerNames, it crashed again, with the same error.
After that, I decided to move registerBlocks into my main class file, and load it there. When I tried to run it it did not link to CoreLanguageRegistry; it linked to the Main Class file, on those same lines of code! Since it did not seem to make a difference, I moved it all back into CoreLanguageRegistry.
I have no clue why this is happening, and any help would be appreciated. I will give spoilers to CoreLanguageRegistry and the Crash Log. If any of you modders can debug this, please tell me why this is happening, and how I can fix it.
---- Minecraft Crash Report ----
// Quite honestly, I wouldn't worry myself about that.
Time: 6/24/13 10:55 AM
Description: Failed to start game
java.lang.NullPointerException
at cpw.mods.fml.common.registry.LanguageRegistry.addNameForObject(LanguageRegistry.java:110)
at cpw.mods.fml.common.registry.LanguageRegistry.addName(LanguageRegistry.java:120)
at pikadex.oremod.CoreLanguageRegistry.registerBlocks(CoreLanguageRegistry.java:16)
at pikadex.oremod.CoreLanguageRegistry.registerNames(CoreLanguageRegistry.java:9)
at pikadex.oremod.PikadexOres.load(PikadexOres.java:278)
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:494)
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:314)
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.propogateStateMessage(LoadController.java:165)
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:314)
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:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:447)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:732)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.5.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_21, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 951349264 bytes (907 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 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 v7.51 FML v5.2.2.684 Minecraft Forge 7.8.0.684 4 mods loaded, 4 mods active
mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{5.2.2.684} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge{7.8.0.684} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
pikadexOres{Alpha 1.0} [Minology] (bin) Unloaded->Constructed->Pre-initialized->Errored
LWJGL: 2.4.2
OpenGL: GeForce GT 520/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
EDIT: The error has changed a bit... this time, I get the error in CoreRecipe.class, yet I cannot spot out the error.
The error 'type' is:
java.lang.StringIndexOutOfBoundsException: String index out of range: 8
If it's any help, I'll also post the CoreRecipe code. So you know where I receive the errors, I'll mark the errors as best I can, by surrounding them with (((((5 BRACKETS))))). Oddly, it occurs only on the hoe crafting. It no longer does the error for the original, even though I did absolutely nothing to it (since the last crash from it).
Thanks,
Pikadex
package pikadex.oremod;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import cpw.mods.fml.common.registry.GameRegistry;
import pikadex.oremod.PikadexOres;
public class CoreRecipe {
/**
* When referenced in the Init method of the Main Class, it will register all of the
* recipes into Minecraft.
*/
public static void recipe() {
craftingRecipeShaped();
(((((craftingRecipeToolsAndArmor();)))))
craftingRecipeShapeless();
smeltingRecipe();
}
// Shaped Recipes
/**
* Holds all of the miscellaneous SHAPED crafting recipes in the class.
* To be loaded in the "recipe" void.
*/
private static void craftingRecipeShaped() {
GameRegistry.addRecipe(new ItemStack(PikadexOres.mechaniteIngot, 1),
" R ", "CMC", " R ", 'R', Item.redstone, 'M', PikadexOres.mechaniteRaw,
'G', PikadexOres.copperIngot
);
// Refined Ores --> Ore Blocks
GameRegistry.addRecipe(new ItemStack(PikadexOres.coreOreBlock, 1, 0),
"CCC", "CCC", "CCC", 'C', PikadexOres.copperIngot
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.coreOreBlock, 1, 1),
"VVV", "VVV", "VVV", 'V', PikadexOres.vintiumIngot
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.coreOreBlock, 1, 2),
"MMM", "MMM", "MMM", 'M', PikadexOres.mechaniteRaw
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.coreOreBlock, 1, 3),
"AAA", "AAA", "AAA", 'A', PikadexOres.ambrite
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.mechaniteBlock, 1),
"MM", "MM", 'M', PikadexOres.mechaniteIngot
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.vintiumEnergy, 3),
"V", "V", 'V', PikadexOres.vintiumIngot
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.stickStone, 4),
"SWS", "SWS", 'W', Block.planks, 'S', Block.cobblestone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.machineRegen, 1),
"GIG", "RMR", "VIV", 'M', PikadexOres.mechaniteBlock, 'R', Item.redstone,
'G', Item.speckledMelon, 'V', PikadexOres.vintiumEnergy,
'I', PikadexOres.mechaniteIngot
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.machineHealth, 1),
"GGG", "MRM", "III", 'I', new ItemStack(PikadexOres.coreOreBlock, 1, 0),
'G', Item.ghastTear, 'R', PikadexOres.machineRegen,
'M', PikadexOres.mechaniteIngot
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.metalBlade, 1),
"I", "I", 'I', Item.ingotIron
);
}
/**
* Holds all of the crafting recipes for armor and tools in the class.
* To be loaded in the "recipe" void.
*/
private static void craftingRecipeToolsAndArmor() {
// Copper
GameRegistry.addRecipe(new ItemStack(PikadexOres.swordCopper, 1),
"B", "B", "S", 'B', PikadexOres.copperBlade, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.pickaxeCopper, 1),
"CCC", " S ", " S ", 'C', PikadexOres.copperIngot, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.spadeCopper, 1),
"C", "S", "S", 'C', PikadexOres.copperIngot, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.axeCopper, 1),
"CC ", "CS ", " S ", 'C', PikadexOres.copperIngot, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.axeCopper, 1),
" CC", " SC", " S ", 'C', PikadexOres.copperIngot, 'S', PikadexOres.stickStone
);
(((((GameRegistry.addRecipe(new ItemStack(PikadexOres.hoeCopper, 1),)))))
"CC", " S ", " S ", 'C', PikadexOres.copperIngot, 'S', PikadexOres.stickStone
);
// Vintium
GameRegistry.addRecipe(new ItemStack(PikadexOres.swordVintium, 1),
"BBB", " S ", 'B', PikadexOres.vintiumBlade, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.pickaxeVintium, 1),
"VVV", " S ", " S ", 'V', PikadexOres.vintiumEnergy, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.spadeVintium, 1),
"V", "S", "S", 'V', PikadexOres.vintiumIngot, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.axeVintium, 1),
"VV ", "VS ", " S ", 'V', PikadexOres.vintiumEnergy, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.axeVintium, 1),
" VV", " SV", " S ", 'V', PikadexOres.vintiumEnergy, 'S', PikadexOres.stickStone
);
(((((GameRegistry.addRecipe(new ItemStack(PikadexOres.hoeVintium, 1),)))))
"VV", " S ", " S ", 'V', PikadexOres.vintiumIngot, 'S', PikadexOres.stickStone
);
// Mechanite
GameRegistry.addRecipe(new ItemStack(PikadexOres.swordMechanite, 1),
"B", "B", "S", 'B', PikadexOres.mechaniteBlade, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.pickaxeMechanite, 1),
"MMM", " S ", " S ", 'M', PikadexOres.mechaniteIngot, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.spadeMechanite, 1),
"M", "S", "S", 'M', PikadexOres.mechaniteIngot, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.axeMechanite, 1),
"MM ", "MS ", " S ", 'M', PikadexOres.mechaniteIngot, 'S', PikadexOres.stickStone
);
GameRegistry.addRecipe(new ItemStack(PikadexOres.axeMechanite, 1),
" MM", " SM", " S ", 'M', PikadexOres.mechaniteIngot, 'S', PikadexOres.stickStone
);
(((((GameRegistry.addRecipe(new ItemStack(PikadexOres.hoeMechanite, 1),)))))
"MM", " S ", " S ", 'M', PikadexOres.mechaniteIngot, 'S', PikadexOres.stickStone
);
}
// Shapeless Recipes
/**
* Holds all of the miscellaneous SHAPELESS crafting recipes in the class.
* To be loaded in the "recipe" void.
*/
private static void craftingRecipeShapeless() {
// Powered Bow (MECHANITE)
ItemStack bowMechanite = new ItemStack(Item.bow, 1, 0);
bowMechanite.addEnchantment(Enchantment.infinity, 1);
bowMechanite.addEnchantment(Enchantment.unbreaking, 3);
bowMechanite.setItemName("Powered Bow");
GameRegistry.addShapelessRecipe(bowMechanite,
new ItemStack(Item.bow, 1, 0),
PikadexOres.mechaniteIngot,
PikadexOres.mechaniteIngot);
// Ore Blocks --> Refined Ores
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.copperIngot, 9),
new ItemStack(PikadexOres.coreOreBlock, 1, 0)
);
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.vintiumIngot, 9),
new ItemStack(PikadexOres.coreOreBlock, 1, 1)
);
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.mechaniteRaw, 9),
new ItemStack(PikadexOres.coreOreBlock, 1, 2)
);
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.ambrite, 9),
new ItemStack(PikadexOres.coreOreBlock, 1, 3)
);
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.mechaniteIngot, 4),
PikadexOres.mechaniteBlock
);
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.vintiumIngot, 2),
PikadexOres.vintiumEnergy,
PikadexOres.vintiumEnergy,
PikadexOres.vintiumEnergy
);
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.stickStone, 1),
Item.stick,
Block.cobblestone
);
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.copperBlade, 1),
PikadexOres.copperIngot
);
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.vintiumBlade, 1),
PikadexOres.metalBlade,
PikadexOres.vintiumEnergy
);
GameRegistry.addShapelessRecipe(new ItemStack(PikadexOres.mechaniteBlade, 1),
PikadexOres.metalBlade,
PikadexOres.mechaniteIngot,
Item.redstone
);
}
// Smelting Recipes
/**
* Holds all of the SMELTING recipes in the class.
* To be loaded in the "recipe" void.
*/
private static void smeltingRecipe() {
FurnaceRecipes.smelting().addSmelting(PikadexOres.coreOre.blockID, 0, new ItemStack(PikadexOres.copperIngot, 1), 0.4F);
FurnaceRecipes.smelting().addSmelting(PikadexOres.coreOre.blockID, 1, new ItemStack(PikadexOres.vintiumIngot, 1), 0.8F);
FurnaceRecipes.smelting().addSmelting(PikadexOres.coreOre.blockID, 2, new ItemStack(PikadexOres.mechaniteRaw, 1), 1.2F);
FurnaceRecipes.smelting().addSmelting(PikadexOres.coreOre.blockID, 3, new ItemStack(PikadexOres.ambrite, 1), 0.6F);
}
}
EDIT 2 (sigh): Sorry about another edit, but I just had to. When I comment out the hoe lines in CoreRecipe, I still crash, getting the former CoreLanguageRegistry error. This makes absolutely no sense to me, and any help would be strongly appreciated.
Thanks,
Pikadex
EDIT 3 (omgusrs): Okay, I'm REALLY sorry about all these edits, but... I just keep on getting new errors. This time, it leads to CoreGameRegistry. The crash 'type' is:
cpw.mods.fml.common.LoaderException
This is getting extremely annoying, and please, PLEASE, any assistance would be greatly appreciated. I'll just give you all the code to CoreGameRegistry, and the code toPikadexOres, my main class. I just have no clue on what this is meaning...
For your hoe, it looks like you accidentally made one of the strings a different size. They don't have to be 3 characters long, but they all have to be the same. For your naming, you need to register the blocks first. The register block method creates the actual item block that is used in the itemstack, so there's going to be an npe if you don't register first.
Also, if you could post the line numbers of your third error, it would be easier than rummaging through the code looking for a mistake.
For your hoe, it looks like you accidentally made one of the strings a different size. They don't have to be 3 characters long, but they all have to be the same. For your naming, you need to register the blocks first. The register block method creates the actual item block that is used in the itemstack, so there's going to be an npe if you don't register first.
Also, if you could post the line numbers of your third error, it would be easier than rummaging through the code looking for a mistake.
For the Language Registry, I'm not positive, but I think that means I'm supposed to have CoreGameRegistry load before CoreLanguageRegistry. It appears if that worked, so that's good.
For the Recipes, I believe you are talking about the fact that one of the strings is 2 characters, and the others are 3.
As for CoreGameRegistry, I'll find code that is causing a crash, and post the lines below... Nevermind. As soon as I fixed the Recipe code, it suddenly fixed the code for CoreGameRegistry.
Thanks to integerArray!
Hello,
I am currently trying to develop a mod called Minology. I've been having troubles with pieces of code in my file, CoreLanguageRegistry. Specifically...
...and...
Keep in mind that I get no errors.
The only problem in the first piece of code is "registerBlocks();", which leads right into the other source in CoreLanguageRegistry. Usually, I find the crash's 'link' lead to the Copper Ore registry.
When I tried to comment it out, it came up with another crash, this time leading to the Vintium Ore registry. Then, I tried to comment out the entire registerBlocks void, along with it's reference in the registerNames void. That worked fine, but as soon as I uncommented registerBlocks (the very first line, and ending bracket), the line registering the Block of Copper, and it's reference in registerNames, it crashed again, with the same error.
After that, I decided to move registerBlocks into my main class file, and load it there. When I tried to run it it did not link to CoreLanguageRegistry; it linked to the Main Class file, on those same lines of code! Since it did not seem to make a difference, I moved it all back into CoreLanguageRegistry.
I have no clue why this is happening, and any help would be appreciated. I will give spoilers to CoreLanguageRegistry and the Crash Log. If any of you modders can debug this, please tell me why this is happening, and how I can fix it.
Thanks,
Pikadex
EDIT: The error has changed a bit... this time, I get the error in CoreRecipe.class, yet I cannot spot out the error.
The error 'type' is:
If it's any help, I'll also post the CoreRecipe code. So you know where I receive the errors, I'll mark the errors as best I can, by surrounding them with (((((5 BRACKETS))))). Oddly, it occurs only on the hoe crafting. It no longer does the error for the original, even though I did absolutely nothing to it (since the last crash from it).
Thanks,
Pikadex
EDIT 2 (sigh): Sorry about another edit, but I just had to. When I comment out the hoe lines in CoreRecipe, I still crash, getting the former CoreLanguageRegistry error. This makes absolutely no sense to me, and any help would be strongly appreciated.
Thanks,
Pikadex
EDIT 3 (omgusrs): Okay, I'm REALLY sorry about all these edits, but... I just keep on getting new errors. This time, it leads to CoreGameRegistry. The crash 'type' is:
This is getting extremely annoying, and please, PLEASE, any assistance would be greatly appreciated. I'll just give you all the code to CoreGameRegistry, and the code to PikadexOres, my main class. I just have no clue on what this is meaning...
Thanks,
Pikadex.
Also, if you could post the line numbers of your third error, it would be easier than rummaging through the code looking for a mistake.
For the Language Registry, I'm not positive, but I think that means I'm supposed to have CoreGameRegistry load before CoreLanguageRegistry. It appears if that worked, so that's good.
For the Recipes, I believe you are talking about the fact that one of the strings is 2 characters, and the others are 3.
As for CoreGameRegistry, I'll find code that is causing a crash, and post the lines below...
Nevermind. As soon as I fixed the Recipe code, it suddenly fixed the code for CoreGameRegistry.
Thanks massively,
Pikadex
But it seems as if you've already solved the problem.
Yes, I know, but I got no errors.
If you are talking about the 'links' to the specific lines in the console when it crashes, that I know, as well.