Jump to content

Recommended Posts

Posted

Hi.

I created this account to ask help in this matter.

Im creating a mod with my mod team, but we have a BIG problem.

As we have many modders, we need to work on separated classes, otherwise we cant work at the same time. We have everything set up with github btw.

But I'm getting a null pointer exception when calling gameRegistry.addRecipe

 

Main class:

 

  Reveal hidden contents

 

 

DDItems Class:

 

  Reveal hidden contents

 

 

DDBlocks Class:

 

  Reveal hidden contents

 

 

The error log:

 

  Reveal hidden contents

 

 

Thanks in advance for any help

Posted

Impossible to read this wall of tekst.

 

Please use spoiler and code tags to format your post so it's readable.

Please include crash report (The full console output of the crash) in spoiler and code tags.

 

If you know which line is the offending line then write the contents of that line above all the spoilers.

As a rule of thumb, 1 spoiler tag for each file. and 1 separate spoiler tag for the crash log/report.

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted
  On 11/16/2013 at 1:21 PM, Mazetar said:

Impossible to read this wall of tekst.

 

Please use spoiler and code tags to format your post so it's readable.

Please include crash report (The full console output of the crash) in spoiler and code tags.

 

If you know which line is the offending line then write the contents of that line above all the spoilers.

As a rule of thumb, 1 spoiler tag for each file. and 1 separate spoiler tag for the crash log/report.

 

Sorry my bad. Solved that. Can you help me here?

Posted

What's Line 30 from DDItems?

-Mitchellbrine

 

  Quote

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

  Quote
I don't want your charity, I want your information
Posted

I don't know GitHub, but I'm pretty sure you can collaborate on one file. Anyway, to do this CORRECTLY, you need to:

 

1. Put the init and recipes in the MAIN CLASS instead of complicating yourself up in crazy ways.

 

2. Put the contents of the init in your load method.

 

3. Put the contents of your recipes method into your load method.

 

4. Delete your init and recipes methods.

 

Again, I state you can use just ONE file, not a million.

-Mitchellbrine

 

  Quote

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

  Quote
I don't want your charity, I want your information
Posted
  On 11/16/2013 at 7:23 PM, Mitchellbrine said:

What's Line 30 from DDItems?

 

Its this one:

 

  Reveal hidden contents

 

 

There are comments with the lines that give me errors. Well, errors when running, eclipse doesnt find any.

 

I now the problem is with this:

 

  Reveal hidden contents

 

I just dont know why he returns a Null Pointer Exception.

 

Edit:

But your repository only updates if you use the git pull command, and it wont commit with the push command unless you have the latest version of the file available in the repository. So if someones pushes, you wont know it, and when you push it you will receive an error, and you need to pull and lose ALL the work youve done since the last commit. This is very hard to handle, that's why we should code eveything in separated class files.

If you want to have a look at all the code, have a look at this:

https://github.com/Wild-Kingdoms/Dungeons-and-Digging

Posted
  On 11/16/2013 at 7:48 PM, Mitchellbrine said:

1. Put the init and recipes in the MAIN CLASS instead of complicating yourself up in crazy ways.

 

2. Put the contents of the init in your load method.

 

3. Put the contents of your recipes method into your load method.

 

4. Delete your init and recipes methods.

-Mitchellbrine

 

  Quote

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

  Quote
I don't want your charity, I want your information
Posted

Also don't new Object(){} for your recipes.  You can just add them as parameters:

 

GameRegistry.addShapelessRecipe(new ItemStack(BlockTrap.instance), new ItemStack(Item.painting), new ItemStack(Block.dispenser));

or

 

GameRegistry.addShapedRecipe(new ItemStack(BlockWallPlate.instance, 2), "s", "s", "s", 's', stone);

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
  On 11/16/2013 at 7:55 PM, Fowlron said:

I now the problem is with this:

 

  Reveal hidden contents

 

I just dont know why he returns a Null Pointer Exception.

 

Edit:

But your repository only updates if you use the git pull command, and it wont commit with the push command unless you have the latest version of the file available in the repository. So if someones pushes, you wont know it, and when you push it you will receive an error, and you need to pull and lose ALL the work youve done since the last commit. This is very hard to handle, that's why we should code eveything in separated class files.

If you want to have a look at all the code, have a look at this:

https://github.com/Wild-Kingdoms/Dungeons-and-Digging

Because "crystal" is null.

 

There are merge tools for github. You should learn and discuss within your team about how you want to use them.

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.