Jump to content

Recommended Posts

Posted

After some constructive criticism from Draco18s (Sorry if I spelled it wrong) I changed my register for my blocks and items to the GameRegister.register(...) fuction.

 

Now, upon registering the textures for the blocks my game crashes for some reason. Here's extra info if you need it.

 

Crash Report:

 

  Reveal hidden contents

 

Block Texture Render class:

 

  Reveal hidden contents

 

ModBlocks class:

 

  Reveal hidden contents

 

BasicBlock class:

 

  Reveal hidden contents

 

Posted
  On 8/11/2016 at 4:41 PM, Matryoshika said:

Where are you calling your BlockRenderRegistry? It must be called client-side only, and after you initialize ModBlocks

 

I'm calling it from my client proxy.

Posted
  On 8/11/2016 at 5:06 PM, diesieben07 said:

You are most likely trying to register your block models before even creating your Blocks.

 

My proxy is the last piece of code read. Here:

 

Main class:

 

  Reveal hidden contents

 

ServerProxy class:

 

  Reveal hidden contents

 

Client proxy:

 

  Reveal hidden contents

 

Posted
  On 8/11/2016 at 5:18 PM, diesieben07 said:

Oh... yeah. You are not creating an ItemBlock for any of your Blocks, hence Item.getItemFromBlock returns null.

 

Ok, so will I have to register the the Block and the ItemBlock or just the ItemBlock?

 

EDIT: Let me refrase that, how on earth do I fix this?

Posted

To clarify: you need to register both. The old 'registerBlock' method automatically created an itemblock for you, but not any more (allowing for technical blocks). Just create a new instance of the ItemBlock and give it the same registry name as your block.

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 8/11/2016 at 5:32 PM, diesieben07 said:

Both.

It's still crashes... just for different reasons... Of which I don't know of.

 

Here's the crash report:

 

  Reveal hidden contents

 

And here's the ModBlocks class:

 

  Reveal hidden contents

 

 

EDIT: It will still crash the same way even if I change GameRegistry.register(IBlock.setRegistryName(block.getRegistryName())); to GameRegistry.register(IBlock.setRegistryName(block.getUnlocalizedName().substring(5)));

Posted
  On 8/11/2016 at 8:39 PM, diesieben07 said:

You are trying to use the fields that store your block instance (e.g.

industrializedWood

) before you initialize them.

Also I think you need to register the Block before the ItemBlock.

 

Crash Report...

 

  Reveal hidden contents

 

Posted

Updated code:

 

  Reveal hidden contents

 

Note: I put IBlock.setRegistryName(block.getUnlocalizedName().substring(5)); because the unlocalizedName (except the tile. part) is the same as the registry name.

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.