Skip to content

Add Smelting Recipes #3141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

diesieben07
Copy link
Contributor

Allows items to specify how long they take to cook in a furnace.

@shadowfacts
Copy link
Contributor

You included the run/saves directory.

@diesieben07
Copy link
Contributor Author

Fixed.

@raoulvdberge
Copy link
Contributor

raoulvdberge commented Aug 1, 2016

Maybe you should stick that 200 in a static constant to avoid differences between furnace / itemstack's default when the default duration ever changes.

@diesieben07
Copy link
Contributor Author

Would it really change? And if it does, the patch in TileEntityFurnace would fail, giving the hint.

@KnightMiner
Copy link
Contributor

Any reason this is stored in the item? It prevents someone from adding a custom recipe for a vanilla item that is a different length than normal (eg, smelting obsidian into x taking 1000 ticks).

I would personally use a stack based map for this kinda like what is used for the furnace XP. Just add an additional function to the GameRegistry that sets the cook time (with the other furnace recipe functions) and pull that value for the cook time (or 200 if unset)

@diesieben07
Copy link
Contributor Author

I'll wait to see what @LexManos / @cpw think about that :)

@LexManos
Copy link
Member

I'm a bit worried about this.
Ideally we would rip out the entire system and find a way to move to a more IFurnaceRecipe{matches(input); getOutput(input); getBurnTime(input); }
That way you could do cool things like have a prioritized system, and have OreDictFurnaceRecipe, which takes all 'oreGold' and spits out minecraft:gold_ingot.
As Knight brings up a good point people quite often modify vanilla recipes if we move this to a system like that, then we'd be better off allowing for that style of control on vanilla as well.

@diesieben07
Copy link
Contributor Author

I definitely don't see why the burn time would go into the recipe. That would mean all recipes would need to know about all possible fuels? That doesn't solve the problem.

@asiekierka
Copy link
Contributor

@diesieben07 I do like Lex's idea more for versatility - and can't getBurnTime simply query the item's "default cook time" in doubt?

@diesieben07
Copy link
Contributor Author

I was being stupid and didn't remember what my own PR was about (it was 2 am in my defense).
I'll update this.

@diesieben07 diesieben07 force-pushed the cook-time branch 2 times, most recently from a67c653 to 6d2b5b9 Compare August 13, 2016 14:21
@diesieben07 diesieben07 changed the title Add Item.getCookTime Add Smelting Recipes Aug 13, 2016
@diesieben07
Copy link
Contributor Author

Updated as per the suggestions to now be a generic smelting recipe registry.

@diesieben07 diesieben07 force-pushed the cook-time branch 4 times, most recently from cabe1cb to 9fad05b Compare August 13, 2016 15:07

Verified

This commit was signed with the committer’s verified signature.
vcunat Vladimír Čunát
@BluGen
Copy link

BluGen commented Aug 13, 2016

just a curious question, could that system be extended to cover all processing recipes (e.g. smelting, macerating, alloy smelting, ...) in a generic way?

@diesieben07
Copy link
Contributor Author

@BluGen #1400 #1617

@Actuarius
Copy link

@williewillus added labels [Feature]

@Actuarius Actuarius added the Feature This request implements a new feature. label Aug 20, 2016
@gigaherz
Copy link
Contributor

Does this have any chance at being accepted soon? Just wondering, since I'm holding off on updating one of my mods in hopes to include custom smelting times.

@LexManos
Copy link
Member

LexManos commented Aug 21, 2016

  1. Probably best to split the vanilla recipe into multiple recipes of a simple 1 item input 1 item output.
  2. Needs license headers
  3. Needs sorting mechanic like crafting recipes.
    Beyond that we need to take some time to see how performant it is. and then make sure all binary compatibility is maintained.

NEVER hold off updating normal mods waiting on a PR, who knows if this will actually ever get in.
We have to see.
If it ever does you can add the feature you want to use using this later.

@diesieben07
Copy link
Contributor Author

The updates will have to wait for a few days, my laptop (only proper computer I have) is currently in repair and the netbook I am using right now is lagging behind updating the screen as I type this text... So yeah, not going to run an IDE on this.

* @param input the input stack
* @return the raw output stack
*/
protected abstract ItemStack getOutput0(ItemStack input);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a name like 'getRawOutput' would fit better here. Generally i dislike method names with numbers suffixed in public api. Adding to that, i can't really come up with a case where the recipe input does not match, but still wants to generate output. Maybe drop this method and make the normal 'getOutput' method do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method / mechanic is mostly a relic from my original implementation of the vanilla recipes where I did not want to implement the whole "search through the list" thing twice but also did not want to execute it twice when looking up recipes (first check matches then check getOutput, both of which would need to traverse the whole list).
But since Lex suggested splitting the vanilla recipes up anyways I will adjust all this as soon as I have my PC back.

@KnightMiner
Copy link
Contributor

Any update on this? I am mainly interested in the ability to make a furnace recipe use NBT to determine the NBT of the output

@diesieben07
Copy link
Contributor Author

Computer and other troubles have kept me from updating this. Soon™.

@liach
Copy link
Contributor

liach commented Oct 5, 2016

How about experience rewards?

@gigaherz
Copy link
Contributor

gigaherz commented Oct 5, 2016

@liach MC grants experience when you pick up the items, using <item exp> * <stack size>, so it would require too many changes to make the XP be accumulated "per recipe".

@liach
Copy link
Contributor

liach commented Oct 5, 2016

It seems that currently item exp is handled by item instances.

@gigaherz
Copy link
Contributor

gigaherz commented Oct 5, 2016

Yes, and since it's just the item's exp * stack size, it is all computed on the fly, when you pick up from the slot. Moving this to the recipe would require adding an "accumulated xp" to the furnace, which is way outside the scope of the PR.

@mezz
Copy link
Contributor

mezz commented Nov 24, 2016

Any update on this?

@diesieben07
Copy link
Contributor Author

Updating to 1.11.x as we speak, new PR incoming.

@mezz mezz added the Superseded This request has a more updated, more capable, and overall better alternative. label Nov 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature This request implements a new feature. Superseded This request has a more updated, more capable, and overall better alternative.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet