Jump to content

Ghost Item in GUI and NBT Tags


ss7

Recommended Posts

Hello,

 

I have a problem. When i put a item in my gui and i do stackSize-- a ghost item remains in the gui. I solved that problem with packets, but i think there is a easier way to do this. This is how i do it:

 

http://gw.minecraftforge.net/M2nX

 

My second problem is that the power and the progress that's displayed on the gui wouldn't saved in the nbt data:

 

http://gw.minecraftforge.net/XsgM

 

ss7

You sir are a god damn hero.

Link to comment
Share on other sites

Hello,

 

Because when i put in a item in the generator, it burns down and creates power. But when i put a item in, it doesn't decrease the stack size, so the item burns forever. And when i take the item out and right-click with it, it's gone! And i thought this has something to do with desync.

 

ss7

You sir are a god damn hero.

Link to comment
Share on other sites

Hello,

 

if (worldObj.isRemote)
		{
			if (inventory[0] != null && progress == 0)
			{
				if (inventory[0].stackSize > 1)
				{
					inventory[0].stackSize--;
				}

				if (inventory[0].stackSize == 0)
				{
					inventory[0] = null;
				}

				progress = 13;

				power++;
			}
		}

 

ss7

You sir are a god damn hero.

Link to comment
Share on other sites

Hello,

 

With burn, i mean that the item is consumed and the generator starts to generate power.

 

With progress bar code i mean this in updateEntity():

 

if (progressticks == 10)
	{
		progressticks = 0;

		if (progress != 0)
		{
			progress--;

			power++;
		}
	}

 

ss7

You sir are a god damn hero.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.