Skip to content
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

Getting generated MetaItem's as an IItemStack #1352

Merged
merged 7 commits into from
Jan 26, 2021
Merged

Getting generated MetaItem's as an IItemStack #1352

merged 7 commits into from
Jan 26, 2021

Conversation

idcppl
Copy link
Contributor

@idcppl idcppl commented Dec 17, 2020

What:
This would allow you to get material generated IItemStack's through the bracket handler, and would make looping over MetaItem's everytime not a thing. Also somewhat related to #1335
So the bracket handler could also accept the oreDict name, for example, <metaitem:plateIron>

Copy link
Member

@LAGIdiot LAGIdiot left a comment

Choose a reason for hiding this comment

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

Can you please be more descriptive in PR opening comment and provide some real use cases.
As I am not that familiar with this matter provided information does not say much to me.

@LAGIdiot LAGIdiot added the integration: CT CraftTweaker integration label Dec 18, 2020
@idcppl
Copy link
Contributor Author

idcppl commented Dec 18, 2020

This would allow for all Metaitems that gregtech generates to be gotten in an IItemStack form that doesn't have to rely on getting the first in oredict. There is probably some more things I could make smoother. If you really don't care for the material based generation items being in this, I could just remove that part. The old system looped everytime the bracket was called and very inefficient.

@idcppl
Copy link
Contributor Author

idcppl commented Dec 18, 2020

An example would be,

RecipeMap.getByName("macerator").recipeBuilder()
.inputs([<ore:ingotSteel>])
.outputs(<metaitem:ingotSteel>)
.duration(60)
.EUt(30)
.buildAndRegister();

vs

RecipeMap.getByName("macerator").recipeBuilder()
.inputs([<ore:ingotSteel>])
.outputs(<ore:ingotSteel>.firstItem)
.duration(60)
.EUt(30)
.buildAndRegister();

It's almost the same, but the metaitem bracket handler guarantee's that it'll be GTCE ingot, only if it's generated by GTCE, else just use <ore:ingotSteel>.firstItem

Copy link
Member

@LAGIdiot LAGIdiot left a comment

Choose a reason for hiding this comment

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

Good work updating PR. There is one thing that need to be resolved everything else seems reasonable.

@idcppl
Copy link
Contributor Author

idcppl commented Jan 17, 2021

Believe this should be finished, now that common is out of api area.

Copy link
Member

@LAGIdiot LAGIdiot left a comment

Choose a reason for hiding this comment

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

Thank you for finishing this up.

@LAGIdiot LAGIdiot added the rsr: revision Release size requirements: Revision label Jan 24, 2021
@LAGIdiot LAGIdiot merged commit 8336b9d into GregTechCE:master Jan 26, 2021
@serenibyss serenibyss mentioned this pull request Mar 24, 2021
Tictim referenced this pull request in Tictim/GregTech Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration: CT CraftTweaker integration rsr: revision Release size requirements: Revision status: accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants