oierbravo / create-mechanical-extruder

Mechanical extruder for the amazing Create mod.
MIT License
5 stars 8 forks source link

JEI fails to sort the recipies in the recipe screen. #28

Open laserman120 opened 1 year ago

laserman120 commented 1 year ago

There does not seem to be any sorting happening when recipes are added.

For example:

event.recipes.createMechanicalExtruderExtruding(Item.of('minecraft:andesite').withChance(0.05),[Fluid.of('minecraft:water'),Fluid.of('minecraft:lava')]).withCatalyst('compressium:andesite_1'); event.recipes.createMechanicalExtruderExtruding(Item.of('minecraft:andesite').withChance(0.25),[Fluid.of('minecraft:water'),Fluid.of('minecraft:lava')]).withCatalyst('compressium:andesite_2'); event.recipes.createMechanicalExtruderExtruding(Item.of('minecraft:andesite').withChance(0.65),[Fluid.of('minecraft:water'),Fluid.of('minecraft:lava')]).withCatalyst('compressium:andesite_3'); event.recipes.createMechanicalExtruderExtruding(Item.of('minecraft:andesite'),[Fluid.of('minecraft:water'),Fluid.of('minecraft:lava')]).withCatalyst('compressium:andesite_4');

You would expect these to get added by the order they are added, but this is not the case. In this example the order it was shown in JEI was 4 - 2 - 1 - 3.

Adding a recipe id does not change the order in any way.

This makes the JEI information really unpractical to use especially when there are like in my case 30+ recipes.

I think the best solution would be to use manually added id's to sort them like this: event.recipes.createMechanicalExtruderExtruding(Item.of('minecraft:andesite').withChance(0.05),[Fluid.of('minecraft:water'),Fluid.of('minecraft:lava')]).withCatalyst('compressium:andesite_1').id("andesite_0"); event.recipes.createMechanicalExtruderExtruding(Item.of('minecraft:andesite').withChance(0.25),[Fluid.of('minecraft:water'),Fluid.of('minecraft:lava')]).withCatalyst('compressium:andesite_2').id("andesite_1); ...

Another additional complicated option would be to allow merging recipes. For example when different recipes create the same block but with different chances or amounts JEI scrolls through the smalles to the biggest, changing the output and input.

I am not sure if this is possible, but this would be another way to reduce the clutter from too many recipies. Especially in a case in which several lead to the same output.