Jump to content

Recommended Posts

Posted

Hello, I am sending a packet and it is returning with an error. I don't really know what is causing it or were to start because the stack trace is leading to forge code resulting in a NullPointerException. Basically I need to send a boolean value along with three other integers to all the player in the server when an event is triggered. So I had setup a LAN world and when the person hosting the LAN world triggered the event, the packet would send and would the tile entity render, this is what I need to syn with the packet, and it would update and sync fine, but when another player triggers the event the player crashes, and they would not crash before I added the packet sending code. I add a try-catch and had it print the stack trace and the packet gets sent and it sync every player, but the stack trace is returning a NullPointerException. I will post my code and the stack trace bellow, but if anyone needs any more code, just ask. All help is appreciated, Thank You!

 

My Code

 

  Reveal hidden contents

 

 

Stack-Trace

 

  Reveal hidden contents

 

 

 

Edit:

BlockLogFire Class

 

  Reveal hidden contents

 

 

Packet Code

 

  Reveal hidden contents

 

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Posted

I edited my original post, the code should be there.

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Posted

Do you really need to use a custom packet if you have a TileEntity associated with the block?  I thought TileEntities are automatically synced?  So I think you should put your custom block properties into fields in the TileEntity instead, when onBlockActivated() happens update them in the TileEntity, and forget about custom packets.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.