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, so I have this weird issue where if I change the 'cost' and 'amount' variable on the tile and restart the world the change will stay....but if I then change them again and restart the world they will revert back to the previous numbers. Anyone have any idea why this could be occuring?

 

Tile Entity: https://github.com/Beardlessbrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/TileVending.java#L127-L194

Custom ItemHandler: https://github.com/Beardlessbrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/ItemVendorHandler.java#L44-L60

Custom Item: https://github.com/Beardlessbrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/ItemVendor.java#L133-L179

 

  • Author

For the amount value I am changing it in the #setAmnt method here

 

https://github.com/Beardlessbrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/GuiVending.java#L989-L1007

 

Its not even just the values...If I add a new item into the machine and restart it will revert back to how it was before. Odd how it will save nbt once but after that revert for some reason.. Any ideas?

Edited by BeardlessBrady

  • Author

I tried debugging the #toNBT and #fromNBT methods in my itemVendor class. It seems to only save the NBT when I pause the game for the very first time after first placing the block but when I quit the world it does not save the NBT nor does it do it when I pause any other time. It will however save NBT and load NBT on world startup... Any ideas?

Edited by BeardlessBrady

  • Author

I have a custom container that uses the methods at the beginning. It all works fine in game it just doesn't save correctly to NBT on world restart

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.