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

Hi,

 

I want to save the data of a variable via NBTTagCompound.

It doesn't work. I don't know why.

 

What do I do wrong?

Thanks!

 

This is the simple tileentity class:

 

http://pastebin.com/qb0b3s7Z

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

  • Author

1. My system.out.println(butterTime) always begins counting from 0 when I join.

2. Forgot that, placed the overrides above the methods, but it definitely overrides them.

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

  • Author

Ah ok. Thanks for letting me know, included my mod id.

Also overrided hasTileEntity and createTileEntity, not using BLockContainer anymore.

Let's see...

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

i had a similar issue with tile entity rotations not being saved and the block just pointing north on load. i made some changes based on an example i was able to find. primarily adding a getter and setter, rather than calling the variable directly and checking if the tagcompound.hasKey before setting it in the readfromnbt.

 

 

        if(par1.hasKey("direction"))

        {

        this.direction = par1.getInteger("direction");

        }

 

 

I don't know why either would make a difference, but one of them, at least, solved the issue.

In the past I know it was a good practice to use worldObj.markBlockForUpdate() as well as markDirty(). Not sure if that would make a difference. Also, you could be having a client/server desync issue, as from what I can tell, you're not syncing any fields.

- Just because things are the way they are doesn't mean they can't be the way you want them to be. Unless they're aspen trees. You can tell they're aspens 'cause the way they are.

  • Author

Thanks for the help. But oh well, it works suddenly, I didn't change anything. Only restarted my pc.

Those weird programs...

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

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.