Patchouli

Patchouli

168M Downloads

Expander (i.e., adding additional pages) templates

noobanidus opened this issue ยท 2 comments

commented

Basically, the "issue" here is:

  1. I have a series of recipes called XYZ.
  2. I have an API processor that returns the ingredients and output of that recipe.
  3. I have a template set up to show that recipe.
  4. I have CraftTweaker integration that allows end-users/mod pack developers to modify or delete recipes.
  5. I have an entry detailing the system in place to make these recipes.
  6. Patchouli is a hard dependency.

It's not possible for me to list every recipe by adding additional pages using the template, as a) I can only list the default recipes (which may be removed, thus resulting in an error), and b) it's not possible for me to predict what recipes might be added.

Thus, I have to tell people in the guide book "please check JEI (if you have it installed)".

An alternative option would be a page or template type: expander

It accepts a template, a string describing the parameter that determines the unique identifier (i.e., if my template has a "recipe" field which is looked up in the processor, this field would be "recipe"), and then a processor that returns a list of every unique value for the "recipe" field.

It then adds additional pages to the entry, one for each of the values returned by the processor, passing that value into a template.

There are some potential issues:

  • If inserted in the middle of an entry, it would result in an additional, unspecified number of pages to that entry, and if you were using a direct page reference in a link, that link would be broken.

I suppose that a solution to that would be to dynamically alter the value of "page" based on some function of an entry that takes a page number and adjusts it according to the number of additional pages added.


An alternative to this "expander", would be some sort of cycle-system that iterates through all of the available recipes in a single template, with a specified delay between them. This would negate issues involved in additional pages.

This is something I attempted to do with a processor itself, but balancing the number of ore dictionary entries against the outputs so that everything synchronised just became too frustrating.

commented

This issue is stale because it has been open for a while with no activity. Please bump if this is still an issue, or this ticket will be closed soon.

commented

Screw you, GitHub bug! This would still be amazing.