Jump to content

Not finding NullPointer


robmart

Recommended Posts

Forge version = 1506

I'm getting a nullpointer, but i can not find where it is. The game is not crashing, but it stops loading the game at "Loading - Initializing mods Phase 1".

This is the log: https://gist.github.com/robmart/490b7910c0ae10c457c2

InitItems class

 

@GameRegistry.ObjectHolder(Reference.MOD_ID)

public class InitItem {

 

    //Normal Items

    public static final ItemBasic CopperIngot = new ItemBasic(":CopperIngot", CreativeTabTCM.TCM_Main, EnumChatFormatting.BLUE + "Crafting Material");

 

    //Swords & Tools

    public static final Item.ToolMaterial Copper = EnumHelper.addToolMaterial("Copper", 2, 200, 5F, 1.5F, 8);

 

    public static final ItemPickaxeTCM CopperShortsword = new ItemPickaxeTCM(":CopperShortsword", Copper);

    public static final ItemPickaxeTCM CopperPickaxe = new ItemPickaxeTCM(":CopperPickaxe", Copper);

 

    public static Item.ToolMaterial Tin = EnumHelper.addToolMaterial("Tin", 2, 220, 5F, 1.5F, 10);

 

    public static Item.ToolMaterial CactusPick = EnumHelper.addToolMaterial("CactusPickaxe", 1, 200, 4.5F, 1F, 6);

 

    public static final ItemPickaxeTCM CactusPickaxe = new ItemPickaxeTCM(":CactusPickaxe", CactusPick);

 

    //Armour

    public static ItemArmor.ArmorMaterial ArmourWood = EnumHelper.addArmorMaterial("ArmourWood", Reference.MOD_ID.toLowerCase() + ":ArmourWood", 5, new int[]{1, 3, 2, 1}, 10);

 

    public static final ItemArmour OakWoodBoots = new ItemArmour(":OakWoodBoots", "OakWood", ArmourWood, 1, 3);

    public static final ItemArmour OakWoodHelmet = new ItemArmour(":OakWoodHelmet", "OakWood", ArmourWood, 1, 0);

    public static final ItemArmour OakWoodChestplate = new ItemArmour(":OakWoodChestplate", "OakWood", ArmourWood, 1, 1);

    public static final ItemArmour OakWoodLeggings = new ItemArmour(":OakWoodLeggings", "OakWood", ArmourWood, 2, 2);

 

    public static final ItemArmour SpruceWoodBoots = new ItemArmour(":SpruceWoodBoots", "SpruceWood", ArmourWood, 1, 3);

    public static final ItemArmour SpruceWoodHelmet = new ItemArmour(":SpruceWoodHelmet", "SpruceWood", ArmourWood, 1, 0);

    public static final ItemArmour SpruceWoodChestplate = new ItemArmour(":SpruceWoodChestplate", "SpruceWood", ArmourWood, 1, 1);

    public static final ItemArmour SpruceWoodLeggings = new ItemArmour(":SpruceWoodLeggings", "SpruceWood", ArmourWood, 2, 2);

 

    public static final ItemArmour BirchWoodBoots = new ItemArmour(":BirchWoodBoots", "BirchWood", ArmourWood, 1, 3);

    public static final ItemArmour BirchWoodHelmet = new ItemArmour(":BirchWoodHelmet", "BirchWood", ArmourWood, 1, 0);

    public static final ItemArmour BirchWoodChestplate = new ItemArmour(":BirchWoodChestplate", "BirchWood", ArmourWood, 1, 1);

    public static final ItemArmour BirchWoodLeggings = new ItemArmour(":BirchWoodLeggings", "BirchWood", ArmourWood, 2, 2);

 

    public static final ItemArmour JungleWoodBoots = new ItemArmour(":JungleWoodBoots", "JungleWood", ArmourWood, 1, 3);

    public static final ItemArmour JungleWoodHelmet = new ItemArmour(":JungleWoodHelmet", "JungleWood", ArmourWood, 1, 0);

    public static final ItemArmour JungleWoodChestplate = new ItemArmour(":JungleWoodChestplate", "JungleWood", ArmourWood, 1, 1);

    public static final ItemArmour JungleWoodLeggings = new ItemArmour(":JungleWoodLeggings", "JungleWood", ArmourWood, 2, 2);

 

    public static void Init(){

        //Normal Items

        GameRegistry.registerItem(CopperIngot, "CopperIngot");

 

        //Swords & Tools

        GameRegistry.registerItem(CactusPickaxe, "CactusPickaxe");

 

        GameRegistry.registerItem(CopperShortsword, "CopperShortsword");

        GameRegistry.registerItem(CopperPickaxe, "CopperPickaxe");

 

        //Armour

        GameRegistry.registerItem(OakWoodBoots, "OakWoodBoots");

        GameRegistry.registerItem(OakWoodHelmet, "OakWoodHelmet");

        GameRegistry.registerItem(OakWoodChestplate, "OakWoodChestplate");

        GameRegistry.registerItem(OakWoodLeggings, "OakWoodLeggings");

 

        GameRegistry.registerItem(SpruceWoodBoots, "SpruceWoodBoots");

        GameRegistry.registerItem(SpruceWoodHelmet, "SpruceWoodHelmet");

        GameRegistry.registerItem(SpruceWoodChestplate, "SpruceWoodChestplate");

        GameRegistry.registerItem(SpruceWoodLeggings, "SpruceWoodLeggings");

 

        GameRegistry.registerItem(BirchWoodBoots, "BirchWoodBoots");

        GameRegistry.registerItem(BirchWoodHelmet, "BirchWoodHelmet");

        GameRegistry.registerItem(BirchWoodChestplate, "BirchWoodChestplate");

        GameRegistry.registerItem(BirchWoodLeggings, "BirchWoodLeggings");

 

        GameRegistry.registerItem(JungleWoodBoots, "JungleWoodBoots");

        GameRegistry.registerItem(JungleWoodHelmet, "JungleWoodHelmet");

        GameRegistry.registerItem(JungleWoodChestplate, "JungleWoodChestplate");

        GameRegistry.registerItem(JungleWoodLeggings, "JungleWoodLeggings");

    }

}

 

 

ItemTextures

 

 

public final class ItemTextures {

 

    public static void registerItemRenderer() {

        //Basic Items

        Init(InitItem.CopperIngot);

 

        //Swords & Tools

        Init(InitItem.CactusPickaxe);

 

        Init(InitItem.CopperShortsword);

        Init(InitItem.CopperPickaxe);

 

        //Armour

        Init(InitItem.OakWoodHelmet);

        Init(InitItem.OakWoodChestplate);

        Init(InitItem.OakWoodLeggings);

        Init(InitItem.OakWoodBoots);

 

        Init(InitItem.SpruceWoodHelmet);

        Init(InitItem.SpruceWoodChestplate);

        Init(InitItem.SpruceWoodLeggings);

        Init(InitItem.SpruceWoodBoots);

 

        Init(InitItem.BirchWoodHelmet);

        Init(InitItem.BirchWoodChestplate);

        Init(InitItem.BirchWoodLeggings);

        Init(InitItem.BirchWoodBoots);

 

        Init(InitItem.JungleWoodHelmet);

        Init(InitItem.JungleWoodChestplate);

        Init(InitItem.JungleWoodLeggings);

        Init(InitItem.JungleWoodBoots);

    }

 

    public static void Init(Item item){

 

        RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();

 

        renderItem.getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getUnlocalizedName().substring(5), "inventory"));

    }

}

 

 

Link to comment
Share on other sites

I don't know 1.8, but try fixing what's wrong with your mcmod.info and see where it goes from there?

WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons

Link to comment
Share on other sites

The NullPointerException you're seeing is happening when Minecraft attempts to generate a crash report and is not related to your problem. If you'd look farther up in the log, you would've seen this:

 

 

 

[21:52:28] [Client thread/ERROR]: The mcmod.info file in TerrariaCraft cannot be parsed as valid JSON. It will be ignored

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected name at line 15 column 2

at com.google.gson.internal.Streams.parse(Streams.java:56) ~[streams.class:?]

at com.google.gson.JsonParser.parse(JsonParser.java:84) ~[JsonParser.class:?]

at com.google.gson.JsonParser.parse(JsonParser.java:59) ~[JsonParser.class:?]

at net.minecraftforge.fml.common.MetadataCollection.from(Unknown Source) [MetadataCollection.class:?]

at net.minecraftforge.fml.common.discovery.DirectoryDiscoverer.exploreFileSystem(Unknown Source) [DirectoryDiscoverer.class:?]

at net.minecraftforge.fml.common.discovery.DirectoryDiscoverer.discover(Unknown Source) [DirectoryDiscoverer.class:?]

at net.minecraftforge.fml.common.discovery.ContainerType.findMods(Unknown Source) [ContainerType.class:?]

at net.minecraftforge.fml.common.discovery.ModCandidate.explore(Unknown Source) [ModCandidate.class:?]

at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(Unknown Source) [ModDiscoverer.class:?]

at net.minecraftforge.fml.common.Loader.identifyMods(Unknown Source) [Loader.class:?]

at net.minecraftforge.fml.common.Loader.loadMods(Unknown Source) [Loader.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(Unknown Source) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Unknown Source) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Unknown Source) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Unknown Source) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]

at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]

at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

at GradleStart.main(Unknown Source) [start/:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]

at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) [idea_rt.jar:?]

Caused by: com.google.gson.stream.MalformedJsonException: Expected name at line 15 column 2

at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505) ~[JsonReader.class:?]

at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:494) ~[JsonReader.class:?]

at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:403) ~[JsonReader.class:?]

at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:666) ~[TypeAdapters$25.class:?]

at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:659) ~[TypeAdapters$25.class:?]

at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:642) ~[TypeAdapters$25.class:?]

at com.google.gson.internal.Streams.parse(Streams.java:44) ~[streams.class:?]

... 31 more

 

 

 

Specifically, this:

 

The mcmod.info file in TerrariaCraft cannot be parsed as valid JSON.

 

Run your mcmod.info file through a JSON validator. This will tell you what is wrong with your JSON.[/code]

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Link to comment
Share on other sites

The NullPointerException you're seeing is happening when Minecraft attempts to generate a crash report and is not related to your problem. If you'd look farther up in the log, you would've seen this:

 

 

 

[21:52:28] [Client thread/ERROR]: The mcmod.info file in TerrariaCraft cannot be parsed as valid JSON. It will be ignored

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected name at line 15 column 2

at com.google.gson.internal.Streams.parse(Streams.java:56) ~[streams.class:?]

at com.google.gson.JsonParser.parse(JsonParser.java:84) ~[JsonParser.class:?]

at com.google.gson.JsonParser.parse(JsonParser.java:59) ~[JsonParser.class:?]

at net.minecraftforge.fml.common.MetadataCollection.from(Unknown Source) [MetadataCollection.class:?]

at net.minecraftforge.fml.common.discovery.DirectoryDiscoverer.exploreFileSystem(Unknown Source) [DirectoryDiscoverer.class:?]

at net.minecraftforge.fml.common.discovery.DirectoryDiscoverer.discover(Unknown Source) [DirectoryDiscoverer.class:?]

at net.minecraftforge.fml.common.discovery.ContainerType.findMods(Unknown Source) [ContainerType.class:?]

at net.minecraftforge.fml.common.discovery.ModCandidate.explore(Unknown Source) [ModCandidate.class:?]

at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(Unknown Source) [ModDiscoverer.class:?]

at net.minecraftforge.fml.common.Loader.identifyMods(Unknown Source) [Loader.class:?]

at net.minecraftforge.fml.common.Loader.loadMods(Unknown Source) [Loader.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(Unknown Source) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Unknown Source) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Unknown Source) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Unknown Source) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]

at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]

at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

at GradleStart.main(Unknown Source) [start/:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]

at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) [idea_rt.jar:?]

Caused by: com.google.gson.stream.MalformedJsonException: Expected name at line 15 column 2

at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505) ~[JsonReader.class:?]

at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:494) ~[JsonReader.class:?]

at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:403) ~[JsonReader.class:?]

at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:666) ~[TypeAdapters$25.class:?]

at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:659) ~[TypeAdapters$25.class:?]

at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:642) ~[TypeAdapters$25.class:?]

at com.google.gson.internal.Streams.parse(Streams.java:44) ~[streams.class:?]

... 31 more

 

 

 

Specifically, this:

 

The mcmod.info file in TerrariaCraft cannot be parsed as valid JSON.
[/code

Run your mcmod.info file through a [url=http://jsonlint.com/]JSON validator[/url]. This will tell you what is wrong with your JSON.

So i fixed it, but it still crashes. New log https://gist.github.com/robmart/5f5fe85573fb54b2a077

Link to comment
Share on other sites

Build 1506 is so brand-spanking new that it might have a bug in it. Try again with (recommended) build 1450 (the one with a solid star beside it) and see if you get better results.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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



×
×
  • Create New...

Important Information

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