Jump to content

Recommended Posts

Posted

So I'm trying to make a furnace, and I got everything set up but I'm having one problem, when I try and smelt items, I put some cobblestone/raw porkchop in and the smelting result is 1 item, 4 items, 16 items, 32 items, then 64 items. (Instead of 1 item, 2 items, 3 items, 4 items, etc. as it should be.) So that makes it when you put 5 items in it smelts them all into a stack of whatever the result is.

Another problem is a lot of times if I try and pull it out before it is a full stack, the items will disappear.

Last problem is after it smelts the first stack(Or I pull items out early) it won't put ANY more items into the result slot, it just uses up the input without putting anything into the output.

 

Now I have narrowed it down to this one function I have.

public static ItemStack getSmeltingResultForItem(ItemStack stack)
	{
		else return FurnaceRecipes.instance().getSmeltingResult(stack);
	}

That is returning the crazy doubling numbers I'm seeing. Even more so, when I replace the above code with this.

public static ItemStack getSmeltingResultForItem(ItemStack stack)
	{
		if(stack.getItem()==Item.getItemFromBlock(Blocks.COBBLESTONE))
		{
			return new ItemStack(Item.getItemFromBlock(Blocks.STONE), 1);
		}
		else return FurnaceRecipes.instance().getSmeltingResult(stack);
	}

It works perfect for cobblestone, but then has the same problem with raw pork-chop or anything else I put in.

For a better view of my code I will put all related classes in

KSTileEntityBlessedFurnace

  Reveal hidden contents

TileEntityContainerBase

  Reveal hidden contents

ContainerBlessedFurnace

  Reveal hidden contents

BlockBlessedFurnace

  Reveal hidden contents

I wouldn't think you would need all this code to figure out the problem, but just in case I put it all there. (It also has a gui I just didn't put that here)

My IGN is TheUnderTaker11, but when I tried to sign up for this site it would not send the email... So yea now I have to use this account.

Posted

Because you're modifying the recipe stack. You need to clone it before adding it to the output slot.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.