Jump to content

Recommended Posts

Posted

Hi guys,

Managed to get my proximity detector working with my gui, but i have a small bug at the moment which i'm not too sure about. The debug lines i added to my code to see what it was doing are saying that the variable is not being reset in the client. This doesn't appear to be having any real effect but i don't like the idea that it's there and would rater fix it so it doesn't break anything in the future, also i've got a feeling it's the reason there's a small amount of flickering in the texture when the field is toggled off.

 

the console output making me think this:

//first loaded
2013-05-22 16:36:15 [iNFO] [sTDOUT] null+ANALOG+|true
2013-05-22 16:36:15 [iNFO] [sTDOUT] null+ANALOG+|false

//PLAYERS field activated
2013-05-22 16:36:23 [iNFO] [sTDOUT] null+PLAYERS+ANALOG+|false
2013-05-22 16:36:23 [iNFO] [sTDOUT] null+PLAYERS+ANALOG+|true

//PLAYERS field deactivated
2013-05-22 16:23:38 [iNFO] [sTDOUT] null+PLAYERS+ANALOG+|true
2013-05-22 16:23:38 [iNFO] [sTDOUT] null+ANALOG+|false

the true and false bits are the output from worldObj.isRemote in the tileentity

the null at the start exists due to how i load the data from the nbt, don't think it should be causing any problems and the fix is simple enough, just an extra if statement to see if the field exists in the nbt before trying to add anything to the set.

 

block code:https://github.com/Yagoki/MTech/blob/master/MTech/mtech/block/BlockProximityDetector.java

 

tileentity code:https://github.com/Yagoki/MTech/blob/master/MTech/mtech/tileentity/TileEntityProximityDetector.java

 

gui code: https://github.com/Yagoki/MTech/blob/master/MTech/mtech/client/gui/GuiProximityDetector.java

 

packet handler code: https://github.com/Yagoki/MTech/blob/master/MTech/mtech/handler/packet/MyPacketHandler.java

 

if you need anymore of my code it's all on there, and should all be the latest push.

 

 

[EDIT] fixed it, the problem was i was the list on the client wasn't removing stuff, fixed it by adding a method to clear the Set before it is updated in the onDataPacket method in the tileentity

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.