Jump to content

Recommended Posts

Posted

I am adding crops to my mod and when I click with the seed my client crashes. But if I give myself the block with commands I can place the plant on grass and farmland and when I click on the plant with bone meal and it works. I just need help making the seeds plant the crop.

 

Error:

 

 

  Reveal hidden contents

 

~ Ronaldi2001

Posted

Seed Class:

 

 

  Reveal hidden contents

 

 

Crop Class:

 

 

  Reveal hidden contents

 

~ Ronaldi2001

Posted

I followed the video below to help me, it works for him. Someone in the comments of the video has the same problem.

 

 

 

Sorry I just figured out that there is an insert code button for code I will use it next time.

~ Ronaldi2001

Posted

This is the Vanilla implementation of ItemSeeds#getPlant:

public IBlockState getPlant(IBlockAccess world, BlockPos pos) {
  return this.crops.getDefaultState();
}

Where this.crops is assigned from the first parameter of the constructor. In your case, it is somehow null.

 

Ensure your crop variable is not null when your seed's constructor is called or override the method to return your own state.

Posted

Show your main class.

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 4/3/2016 at 11:30 PM, wehttam664 said:

This is the Vanilla implementation of ItemSeeds#getPlant:

public IBlockState getPlant(IBlockAccess world, BlockPos pos) {
  return this.crops.getDefaultState();
}

Where this.crops is assigned from the first parameter of the constructor. In your case, it is somehow null.

 

Ensure your crop variable is not null when your seed's constructor is called or override the method to return your own state.

 

What would I put to override the state of the crop.

~ Ronaldi2001

Posted
  On 4/4/2016 at 1:06 AM, Draco18s said:

Show your main class.

 

Main Class:

 

 

  Reveal hidden contents

 

 

Crops Class:

 

 

  Reveal hidden contents

 

 

Items Class for seed:

 

 

  Reveal hidden contents

 

~ Ronaldi2001

Posted

You initialize Items before Blocks, but pass a Block (which is null) to your Item's constructor.

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.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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