Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.