Jump to content

[1.7.2] Problems with SimpleNetworkWrappers and IMessages SOLVED!


Kant0sh

Recommended Posts

I'm working on the GUI functionality of my block for 4 days now, and I still cant pull it off :( about time to ask for some help...

I'm trying to display a simple progress bar, and i pulled it off for singleplayer, not using messages, just using the getClient().getServer() function to get the serverside TileEntity, but this doesn't work for multiplayer unfortunately... So now, I'm sending a message containing a string (because sending too many things at once had me get an IndexOutOfBounds) in which i carry all the data required... the string gets created by the getEncodedMessageAsString() method in the PrinterTileEntity class, and gets passed into the constructor in the sendToAllAround() method which gets called in updateEntity(). Here comes the problem: The message that is received only contains the string i set as field, so if i did "String string;", i got a NullPointer, and if i did "String string = "";" i got an empty string variable through :( if you want to look at the code, and the issue i have up for three days, here is the links:

 

GitHub: https://github.com/Kant0sh/threedeeprinter

Issue: https://github.com/Kant0sh/threedeeprinter/issues/1

PrinterTileEntity.java: https://github.com/Kant0sh/threedeeprinter/blob/master/main/threedeeprinter/mod3DPrinter/tileEntity/PrinterTileEntity.java

Message and MessageHandler in this package: https://github.com/Kant0sh/threedeeprinter/tree/master/main/threedeeprinter/mod3DPrinter/network/message

 

Help would be much appreciated

 

Edit: also, if you have GitHub, feel free to comment on the issue ;D

Thanks for helping me <3

Link to comment
Share on other sites

Well I saw this fellow post this in Paintings and Packets

 

Packets are easy.

https://gist.github.com/CatDany/4a3df7fcb3c8270cf70b

Please, hit "applaud" under my avatar, thanks :)

 

I haven't tried it get, but I bookmarked it and will give it a shot when I can, maybe it can help you?

Link to comment
Share on other sites

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.