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

Hey everyone, I'm working on a furnace that will have a fuel buffer and it's working like I want it to. It'll burn coal when theres room to store energy and then it'll use that energy to cook items. The only problem is that whenever i save and quit then come back, the buffer is reset to 0. Is there a way to save that number? Thanks a lot!

  • Author
  On 4/6/2013 at 2:38 AM, Alamurla said:

 

I tried using nbt data before after looking up the problem, but it wasn't working for me. Heres the code I have, I don't have a clue as to why it's not working. This is just a method in my tile entity class.

 

@Override
        public void readFromNBT(NBTTagCompound tagCompound) {
        	// working code for setting itemstacks, commenting this out breaks the furnace so i know this is being called
                super.readFromNBT(tagCompound);
                NBTTagList tagList = tagCompound.getTagList("Inventory");
                for (int i = 0; i < tagList.tagCount(); i++) {
                        NBTTagCompound tag = (NBTTagCompound) tagList.tagAt(i);
                        byte slot = tag.getByte("Slot");
                        if (slot >= 0 && slot < inv.length) {
                                inv[slot] = ItemStack.loadItemStackFromNBT(tag);
                        }
                } //(ends here)
                
                fuelLevel = tagCompound.getInteger("Fuel"); // reading it isn't working
                //fuelLevel = 50; // me even trying to brute force set it and still not working
        }

  • Author
  On 4/6/2013 at 5:36 AM, endershadow said:

you need to use packets so the gui can update.

 

Ah, thanks so much! None of the tutorials i found about nbt mentioned this.

  • 3 weeks later...
  On 4/6/2013 at 5:36 AM, endershadow said:

you need to use packets so the gui can update.

 

But it isn't the GUI thats going wrong, its the saving, but mabye Packets will help, but how do I use them/what should I do with them?

  On 4/6/2013 at 5:36 AM, endershadow said:

you need to use packets so the gui can update.

 

But it isn't the GUI thats going wrong, its the saving, but mabye Packets will help, but how do I use them/what should I do with them?

The gui is client side, all information must be serverside.

If the client is doing something to change the info inn a tileEntity you must let the server know!

To let the server kniw this you use packets :)

 

Take a look on the tutorials on the forgewiki as well as google for packet tutorials.

  Quote

If you guys dont get it.. then well ya.. try harder...

The gui is client side, all information must be serverside.

If the client is doing something to change the info inn a tileEntity you must let the server know!

To let the server kniw this you use packets :)

 

Take a look on the tutorials on the forgewiki as well as google for packet tutorials.

  Quote

If you guys dont get it.. then well ya.. try harder...

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.