Posted April 6, 201312 yr 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!
April 6, 201312 yr You are looking for NBT Tag Coupounds. Two good sources of information on how to use them are here: http://www.minecraftforum.net/topic/982336-tutorial-147-nbttagcompound-using-itemstacks-stacktagcompound-for-permanent-extra-data-storage/ http://www.minecraftforge.net/wiki/How_to_use_NBT_Tag_Compound
April 6, 201312 yr Author You are looking for NBT Tag Coupounds. Two good sources of information on how to use them are here: http://www.minecraftforum.net/topic/982336-tutorial-147-nbttagcompound-using-itemstacks-stacktagcompound-for-permanent-extra-data-storage/ http://www.minecraftforge.net/wiki/How_to_use_NBT_Tag_Compound 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 }
April 6, 201312 yr Author you need to use packets so the gui can update. Ah, thanks so much! None of the tutorials i found about nbt mentioned this.
April 23, 201312 yr 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?
April 23, 201312 yr 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?
April 23, 201312 yr 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. If you guys dont get it.. then well ya.. try harder...
April 23, 201312 yr 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. 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.