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

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?

 

 

  • Author

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?

  • Author

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

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.