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

Mortar recipes support "null" in CraftTweaker Zenscript #425

Open
RisingInIris2017 opened this issue Mar 14, 2020 · 4 comments
Open

Mortar recipes support "null" in CraftTweaker Zenscript #425

RisingInIris2017 opened this issue Mar 14, 2020 · 4 comments
Labels
3.2.0 intended for 3.2.0 or later (first 1.14/1.15 release) enhancement Improvements to current features

Comments

@RisingInIris2017
Copy link

RisingInIris2017 commented Mar 14, 2020

Describe your suggestion:

Now when we write a Roots Mortar recipe like this:

Mortar.addRecipe(*3,
[
       <mysticalworld:copper_ore>,<mysticalworld:copper_ore>,null,null,null
]
);

It is syntax correct, but will do nothing when you put 2 copper ore into Mortar and try to grind them.
My suggestion is to make Mortar recipe adding method support "null", so that we can put any number of materials into custom recipes as inputs.
Describe alternatives you've considered:
If this is difficult for devs to do so, maybe you can just disable "null" in Mortar recipe adding method.
For example,

Mortar.addRecipe(*3,
[
      <mysticalworld:copper_ore>,<mysticalworld:copper_ore>,null,null,null
]
);

will throw an CraftTweaker exception and write some information into crafttweaker.log.

@noobanidus
Copy link
Collaborator

Okay, so the issue isn't so much to do with nulls, but to do with the fact that the mortar was originally only designed to support spell recipes, which are specifically recipes of 5 ingredients. It was additionally modified to support recipes with 5 ingredients that just do general crafting rather than generating a specific type of spell dust.

This system was then extended to allow for processing-style recipes: you create a recipe with 1 ingredient, and it automatically creates recipes for 1, 2, 3, 4 and 5 ingredients, modifying the output accordingly (so if the original output was an itemstack with a count of 2, you would get 2, 4, 6, 8, 10 respectively).

Thus, it's only really designed to cope with 5 ingredients. Obviously I'm failing to clear out nulls, as there's already code in place to specifically say "hey, it has to be 1 or 5 ingredients".

I think what you're trying to do is ore duplication: 1 ore = 1.5 dust.

I'm not sure how to best go implementing this code-side. It's possible that I could specify a fractional/decimal float value for the output where one ore has a 50% chance of an extra, and 2 ore has a guaranteed chance of 3, and 3 ore has a guaranteed 4 ore and a chance of 5, and so-on.

I'll need to consider it further, but I'll definitely strip out nulls when checking for valid quantities of ingredients. I forgot that this was standard practice for padding in CraftTWeaker.

@Davoleo Davoleo added the bug Something isn't working label Mar 14, 2020
@RisingInIris2017
Copy link
Author

RisingInIris2017 commented Mar 15, 2020

Oh, thanks for your reply!
I know it may be difficult to change the Mortar mechanic because doing so may leads to a re-construct of codes.
I just post this issue for a suggestion. You may choose the best way you think to deal with this issue.
Thanks again!

@noobanidus
Copy link
Collaborator

I think I'll add an additional mortar recipe type that takes a percentage chance for additional output and quantity of potential additional output and make that available via CraftTweaker; it should resolve the majority of issues, and it can also be used to automatically create recipes with 1-2-3-4 and 5 inputs.

@noobanidus noobanidus added 3.1.0 destined for 3.1.0 after next alpha release and removed 3.1.0 labels Apr 15, 2020
@noobanidus
Copy link
Collaborator

Unfortunately, I'll most likely have to delay this until 3.2.

@noobanidus noobanidus added 3.2.0 intended for 3.2.0 or later (first 1.14/1.15 release) enhancement Improvements to current features and removed 3.1.0 destined for 3.1.0 after next alpha release bug Something isn't working labels Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.0 intended for 3.2.0 or later (first 1.14/1.15 release) enhancement Improvements to current features
Projects
None yet
Development

No branches or pull requests

3 participants