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

I'm not really sure how to even debug this to find out what's wrong.

 

i have an IEEP "Wallet"

 

when i give my wallet a value, the console tells me it's saving the property.

 

when i log out of the server and log back in i get a message telling me it's loaded the property from NBT, but it seems it hasn't, because the property has reset itself.

 

could someone take a look and help me work out what's wrong here please?

 

public void loadNBTData(NBTTagCompound nbt){
        System.out.println("[MineConomy] Loading Player Wallet");
        NBTTagCompound properties = (NBTTagCompound) nbt.getTag(EXT_PROP_NAME);
       setFunds(properties.getDouble("funds"));
        System.out.println("PLAYER'S FUNDS ARE NOW: " + getWallet());  //getWallet is 0.00 here. even after i set it to something like 1000
    }
    public void saveNBTData(NBTTagCompound nbt){
        System.out.println("[MineConomy] Saving Player Wallet");
        NBTTagCompound properties = new NBTTagCompound();
        nbt.setDouble("funds", getWallet());
        nbt.setTag(EXT_PROP_NAME, properties);
    }

 

What can be wrong:

- Your getter/setters are broken

- You are looking at wrong output (there is client AND server output) - only server side loads NBT, client one needs to be synchronized manually.

- You fkd up something else :) Post more code (maybe you are looking in wronge place? Any ticking events that use your wallet, anything?)

 

EDIT

In loadNBT - add Syso(nbt); or Syso(properties); Is there any (your) data? (yes, you can print NBT).

1.7.10 is no longer supported by forge, you are on your own.

  • Author

i can't believe my stupidity sometimes....

 

nbt.setDouble("funds", getWallet());

sould have been

properties.setDouble("funds", getWallet());

 

 

thanks Ernio for helping me debug that :)

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.