Jump to content

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


H41V0R
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

    {

}

 

}

Link to comment
Share on other sites

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.

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
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.

 Share



×
×
  • Create New...

Important Information

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