Jump to content

[1.9]java.lang.NullPointerException when trying to port to 1.9


Recommended Posts

Posted
Minecraft#getRenderViewEntity

is returning

null

for some reason. Does your mod mess with the render view entity at all?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

The change log shows a couple NPE fixes since build 1887, so there's a chance that updating Forge could help. However, you should first set a few relevant break points and step to the crash in the debugger to see if anything jumps out at you. Find what's null, where it should have been initialized, and then try to see why it wasn't.

 

If neither effort helps, then get ready to post lots of source code.

 

PS: If you don't need examplemod, then get rid of it

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.

Posted

Still, error when I load a save

 

Main mod file:

package com.h41v0r.dchem;

 

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.fml.common.SidedProxy;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

import java.util.logging.Logger;

 

@Mod(modid=dchem.MODID, name=dchem.MODNAME, version=dchem.MODVER)

public class dchem

{

 

 

 

  @SidedProxy(clientSide = "com.h41v0r.dchem.ClientProxy", serverSide = "com.h41v0r.dchem.ServerProxy")

public static CommonProxy proxy;

 

 

@Mod.Instance

public static dchem instance;

 

public static Logger logger;

 

/*@Mod.EventHandler

public void preInit(FMLPreInitializationEvent event) {

logger = event.getModLog();

proxy.preInit(event);

}*/

   

    @Mod.EventHandler

    public void init(FMLInitializationEvent event)

    {

}

 

}

Posted

Well, for starters, it looks like you've completely commented out your preInit event handler, so it looks like your mod main does nothing.

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.

Posted

Its not the mod, I tried w/ a empty src folder and still got the same error

 

EDIT: After trying it in eclipse, it worked. Perhaps I should've mentioned that I was using IDEA

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.