Jump to content

Recommended Posts

Posted

I am trying to move my client ticker over to a server ticker, as all my code was only being executed by the client.  However, I am getting a nullPointerException on a MinecraftServer variable inside of my server ticker.  Here's the code and error:

 

 

  Reveal hidden contents

 

 

 

  Reveal hidden contents

 

 

 

  Reveal hidden contents

 

 

And the error report:

 

 

  Reveal hidden contents

 

 

Any ideas?

Posted

This is line 129:

 

		    File beginningOfWorld = new File(minecraft.getMinecraftDir() + "/mods/TimeMod/present/" + ms.getWorldName());

 

I'm fairly confident it's because ms is null, but I have no idea how to fix it.  I tried if(ms != null) but that just crashed.  :P

Posted

if(ms != null){

    System.out.println("the world isnt null");

}

???

 

 

also, if that crashed i would be pretty certain that its the root cause

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

does this happen in game or before ? like on startup, becuase if its on startup that might make sens as the server/world isnt generated yet

 

 

also

private void onServerTick(MinecraftServer server, Minecraft mc)
    {
    	if(FMLServerHandler.instance().getServer() != null || mc.theWorld != null)
    	{

 

cant you send FMLServerHandler.instance().getServer() to the method instead ? cuz that you know isnt null

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

It happens with I load a world.  I tried changing the line to this:

 

 

  Reveal hidden contents

 

 

But I got the same crash.

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.