Hey there.
I don't think it's viable to have more than 4 ingredient slots in this plugin, there are a lot of points in the code where I hard-coded that number to get certain things to work. I can think of a few that might be tripping you up in editing it, but I'm not sure even if you get past those that it'd work.
- The ingredient list window is hard-coded to check for the cursor index of 4 to know when you've hit ok on the craft button, and not on an ingredient slot, so the onIngredientOk() function needs to be modified to check for an index of 6 or 8 (for 6 or 8 slots instead).
- The ingredient window is only supposed to show four items, and probably needs to be longer to facilitate extra items in the list. That might not be a problem if your project has a higher than default resolution, though.
- The function that checks for a partial recipe match only checks up to n-2 ingredients, meaning it will only ever check provided ingredients against recipes that are at most, two ingredients less than the total number of ingredients provided. You'd have to extend this function to n-4 (for 6 ingredients) and n-6 (for 8).
- The plugin manager only expects 4 ingredient slots, so you'd need to manually add more slots to the recipe list object, and parse those slots in the datamanager on load, like the other four slots. The plugin reads each ingredient item on project load and turns them into the actual database item, and then attaches that item to the recipe array for future use. Simply adding new slots to the plugin parameters will allow you to specify extra items in a recipe, but unless they're parsed in the same way this will be a problem.
- I had hardcoded the names of the first four ingredients, (secondType, secondId, etc) so you will need to work with that as well.
With this in mind, I think it's much more realistic to not edit the plugin at all, and rather make your base items craft into intermediate items, that then craft into the full item. This would allow you to stay within the four item limit, while still allowing more than four base ingredients.
For example, a sword recipe:
- <category> Sword blade
- Hilt
- Scabbard
To make each of these items requires more ingredients:
- Sword Blade
- <category> Metal
- Flux
- Sword mold
- Hilt
- Wood
- Leather
- Scabbard
- Leather
- Cloth
Obviously this isn't an ideal solution, but I feel like it's a little more doable than editing the core functions of the plugin, and you're a lot less likely to run into problems working within the four item limit. Keep in mind though, that there is a hard limit currently, in that you can only have one category ingredient per recipe, so you'd need to make each recipe if you had a few different types of hilts, scabbards and sword blades that could be interchanged in the recipe.