Open JamesYeoman opened 4 years ago
previousNumberOfCraft
is the total number of recipes that match the current workbench state, which is equal to the number of conflict for said state, which is equal to the number of results.
recipeIndex
is the number of time the player tried to move through recipe conflicts/results. It also maintains server/client synchronization of the selected result (in shift-click, for example).
Modulo keeps the selected recipe within previousNumberOfCraft
range and provides the cycle function.
As for your goal, i would suggest looking into Forge recipe sorting system. This mod obeys the registered order of recipes.
I'm wanting to implement a way of specifying an ordered whitelist of modids. The reason for this, is that I tend to prefer the Thermal Foundation ingots and blocks, but I want to be able to fall back to Ender Core, then Mekanism, then Forestry, then whatever the mod is able to detect as a last resort. Not only this, but I want to be able to retain my ability to choose between the different conflicts in case there's a recipe that god forbid doesn't use the Ore Dictionary.
The part I need clarification for is the
previousNumberOfCraft
property, and the purpose ofrecipeIndex % previousNumberOfCraft
inCraftingHandler
. The namepreviousNumberOfCraft
is an unhelpful name. There's no documentation as to what it's supposed to represent, and I can't seem to figure it out. Not only that, but I don't understand the need forrecipeIndex
modulopreviousNumberOfCraft
Any and all clarifications will be greatly appreciated.