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 there,

 

I have been making a custom TileEntity and the basic idea is that you put 9 Gel into the block and when 9 of those are extracted (the number increases every time after 1 is extracted) a certain item is "created". So i have it all working, but i wanted to make it so that my GUI shows the correct number so i thought of using the NBTTagCompound Read and Write to save the ammount of gel (also because i wanted it to be saved whenever you close the game etc). To see what it is writing and reading i did the following:

@Override
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
System.out.println("[soul Forest] write : " + (short)this.gelAmmountExtracted);
par1NBTTagCompound.setShort("Gel", (short)this.gelAmmountExtracted);
// Some more code below (but thats for itemstacks) so i left it out
}

Now in the console i get the following values 1, 0. And whenever another gel is updated i get 2 and 0 etc. So 2 lines are being printed with 2 values and thats why my GUI picks up 0 continuesly, but how do i make it so that i don't read and write 2 values.

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.