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.

Any NBTBoolean available? (Instead of creating NBTTagCompounds for this purpose)

Featured Replies

Posted

Helllo,

 

I have a Method which requires converting a Map<INBTSerializable,Boolean> into NBTTagLists, but it looks like NBTTagByte (and similiar primitves) are package-private classes and there fore cannot be used.

More specifically here is some simplified code of what I'm doing:

	private NBTTagList[] getConditionValueResources() {
            NBTTagList[] locations  = {new NBTTagList(), new NBTTagList() };
            for (Map.Entry<ISpellCondition,Boolean> condition :
                    conditions.entrySet()) {
                locations[0].appendTag(condition.getKey().serializeNBT());
                NBTTagCompound compound = new NBTTagCompound();
                compound.setBoolean(KEY_BOOLEAN_VALUE,condition.getValue());
                locations[1].appendTag(compound);
            }
            return locations;
        }

 

and what I'm looking for would be sth like:

	private NBTTagList[] getConditionValueResources() {
            NBTTagList[] locations  = {new NBTTagList(), new NBTTagList() };
            for (Map.Entry<ISpellCondition,Boolean> condition :
                    conditions.entrySet()) {
                locations[0].appendTag(new NBTTagBoolean(condition.getValue());
                locations[1].appendTag(compound);
            }
            return locations;
        }

This piece of code would allow for far less Overhead (an NBTTagCompound is contains an entire Map, although i only need on byte!) and I would omit this stupid converting NBTTagCompound and back...

(Note: I know, that there is no NBTTagBoolean Class, but that NBTTagByte is used instead. This would make it far easier too... But it is not public... :()

 

  • Author

Sry...

I'm such an idiot at Times...

:(

I used auto completion, and tried to access the private Constructor which naturally wouldn't work (and I didn't try to add a value to it, but rather tried to find an alternative to that...)

 

Sry sry sry sry sry.

(I have been looking for that for about the last 1.5h  xD) (I think programming scince 2 O'clock (am) doesn't do anything good to your mind...)

 

Edit:

Is it possible to close Stupid Topics like this? 

Edited by Major Tuvok
incomplete

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.