Jump to content

Recommended Posts

Posted

Hello,

I am using Forge Build 1007 and was wondering why the function setCompoundTag doesn't exist, because getCompoundTag exist.

Also getTaglist and tagAt in NBTTagList doesn't exist. Were they changed or are they missing?

 

 

Posted

Thanks for your help.

Now i have problems with the "new" getTagList function and tagAt.

 

My current code looks like this:

private void readFromNBT() {
        reading = true;
        // TODO for backwards compatibility
        if(NBTUtil.getCompoundTag(originalIS, "Inventory").hasKey("title")) {
            setInvName(NBTUtil.getCompoundTag(originalIS, "Inventory").getString("title"));
        } else {
            setInvName(NBTUtil.getCompoundTag(originalIS, "display").getString("Name"));
        }

        NBTTagList itemList = NBTUtil.getCompoundTag(originalIS, "Inventory").func_150295_c("Items") // But i need slotEntry as second Argument?!
        for(int i = 0; i < itemList.tagCount(); i++) {
            NBTTagCompound slotEntry = (NBTTagCompound) itemList.tagAt(i);//what was tagAt replaced for this situation?
            int j = slotEntry.getByte("Slot") & 0xff;

            if(j >= 0 && j < getSizeInventory()) {
                setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(slotEntry));
            }
        }

 

getTagList needs more arguments than in earlier version. I have trouble rewriting it. Can you or someone else give me some tips?

Posted

I used 10 as second argument for TAG_Compund and used this function instead of tagAt: func_150305_b. Errors are gone. Am I on the right way? I can't test because of some more, about 230 errors, in my mod. So im trying to fix them first :D

 

Ich danke dir bereits im voraus:

"Manchmal sieht man den Wald vor lauter Bäumen nicht".

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.