Patchouli

Patchouli

167M Downloads

Allow variables to be used as an array

TagnumElite opened this issue ยท 0 comments

commented

Describe the feature

I am creating a guidebook for a mod and I wanted to create a tooltip containing a list of supported dimensions.

I created a template with a processor and tooltip component. I could probably implement this myself if need be but I decided to see if this is a feature that you actually want?

public class Processor implements IComponentProcessor {
   private Recipe<?> recipe;
   public void setup(IVariableProvider variables) {
       // Get the recipe from the variables
   }

  public IVariable process(String key) {
    if (key.equals("dimensions") {
      return IVariable.wrapList(recipe.validDimensions()); // Lets say validDimensions() returns a List of ResourceLocations converted into IVariables
    }
    return null;
  }
}
{
  "processor": "com.tagnumelite.test.patchouli.Processor",
  "components": [
    {
      "type": "patchouli:tooltip",
      "tooltip": "#dimensions", // I want to use a variable for the list instead of a list of variables
      "x": 32,
      "y": 20,
      "width": 40,
      "height": 30
    }
  ]
}

Additional context

No response