Jump to content

updateEntity() doesn't work =(


diegogive

Recommended Posts

Hi everyone, can someone please tell me exactly how does it works the function

updateEntity()??  I'm programming a custom furnace with two slot for the ingrediente, a slot for the fuel, and obviously the output slot. I made the function cook() which simply check if is possible to cook, and in that case it remove the ingredients and put the output in the output slot, but shoud I put the cook() in updateEntity()? if i do so, it crash with the error: "Ticking tile entity".

 

Can someone explain where is my error please? =)

 

 

public boolean canCook()
{
	if (this.siliciumFurnaceItemStacks[1].stackSize > 0 && this.siliciumFurnaceItemStacks[2].stackSize > 0 && this.siliciumFurnaceItemStacks[3].stackSize > 0)
	{
		return true;
	}	
	else return true;
}

public void cook()
{
	ItemStack item;

	if (canCook() == true) 
	{
		for (int i = 0; i <=2; i++){
		this.siliciumFurnaceItemStacks[i].stackSize--;}


		this.siliciumFurnaceItemStacks[3] = new ItemStack(Item.diamond, 1);

		}
	}

public void updateEntity()
{
	cook();
	this.onInventoryChanged();
}

 

Attachments and other options

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.



×
×
  • Create New...

Important Information

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