This is a fork of Selection GUI Crafting by Gliese_832_c.
Fork? Rewrite!
What started as a fork of the original mod, quickly turned into a rewrite. The original crafting system felt way to clunky and not user-friendly. The new system is much more intuitive and user-friendly. It also allows much more customization and is more flexible to benefit the needs of modpack developers. An added bonus is the support for GroovyScript. The old CraftTweaker support was rewritten as well to reflect the new system.
What even is this?
SelectionGUI Crafting gives modpack authors the ability to add crafting recipes into a selection GUI that is triggered by right-clicking while holding the right items. This could, for example, be used for clay recipes. Instead of manually arranging clay balls in a different way in a crafting table, it would be possible to make it so that you right-click with a spatula in one hand, clay in the other, and just select the clay item you want to make. Another use example would be forging. Right-click with a hammer in one hand, an ingot in the other, and select your desired toolhead.
CraftTweaker & GroovyScript Integration
I tried to make them as similar as possible as the CraftTweaker Wiki is basically dead for 1.12 at this point. I'll publish additional documentation to the GroovyScript wiki. CraftTweaker methods can be referenced there as well, as all the method names / parameters are the same. Below are a few examples.
CraftTweaker
val test = mods.selectionguicrafting.category.categoryBuilder();
test.id("test");
test.displayName("Test");
test.register();
val myRecipe = mods.selectionguicrafting.recipe.recipeBuilder();
myRecipe.category("test");
myRecipe.output(<minecraft:sand> * 2);
myRecipe.tool(<minecraft:stick> * 5);
myRecipe.input(<minecraft:snow> * 3);
myRecipe.register();
mods.selectionguicrafting.recipe.recipeBuilder().category("test").output(<minecraft:sand> * 5).tool(<minecraft:stick> * 10).input(<minecraft:snow> * 2).register();
GroovyScript
// Crafting Category:
// All recipes in the mod are divided into categories. Each category has its own set of recipes. Each category can have its own texture for the background, border, frame, decoration, and progress bar. The category can also have its own sounds and particles. It also allows to specify how the sounds are played, if recipes in the category can be added to the crafting queue and how the output items are handed to the player.
mods.selectionguicrafting.category.removeByName('dummy_category_1')
// mods.selectionguicrafting.category.removeAll()
mods.selectionguicrafting.category.categoryBuilder()
.id('dummy_category')
.displayName('Your first Category')
.background('selectionguicrafting:textures/gui/background/wood.png')
.register()
mods.selectionguicrafting.category.categoryBuilder()
.id('blub')
.displayName('Pick your recipe')
.background('selectionguicrafting:textures/gui/background/lake.png')
.backgroundType('SINGLE_CUT')
.register()
mods.selectionguicrafting.category.categoryBuilder()
.id('dead')
.displayName('This is another dummy category to test')
.background('selectionguicrafting:textures/gui/background/deadlands.png')
.decoration('selectionguicrafting:textures/gui/decor/gold.png')
.border('selectionguicrafting:textures/gui/background/wood.png')
.backgroundType('SINGLE_CUT')
.register()
// Crafting Recipe:
// Creates a recipe that is shown in the specified category. Each recipe requires at least an input (placed in the offhand), tool (placed in the mainhand), and output. There can also be an optional catalyst (placed in the inventory). The recipe can have its own frame, sounds, particles, and progress bar. It also allows to specify how the sounds are played, if the recipe can be added to the crafting queue, how the output items are handed to the player, and how much durability is consumed, if the tool is a damageable item. The crafting time as well as a possible XP reward can be set as well.
// mods.selectionguicrafting.recipe.removeByCategory('dummy_category')
mods.selectionguicrafting.recipe.removeByInput(item('minecraft:cobblestone'))
mods.selectionguicrafting.recipe.removeByOutput(item('minecraft:stone'))
mods.selectionguicrafting.recipe.removeByTool(item('minecraft:wool'))
// mods.selectionguicrafting.recipe.removeAll()
mods.selectionguicrafting.recipe.recipeBuilder()
.category('dummy_category')
.input(item('minecraft:stone') * 3)
.output(item('minecraft:cobblestone') * 2, 0.5f)
.tool(item('minecraft:wooden_pickaxe'), 1.0f)
.time(200)
.xp(1)
.sound('minecraft:block.anvil.land', 1.0f, 1.0f)
.register()
mods.selectionguicrafting.recipe.recipeBuilder()
.category('blub')
.input(item('minecraft:diamond'))
.output(item('minecraft:wheat_seeds') * 5, 0.5f)
.tool(item('minecraft:grass') * 5, 1.0f)
.register()
mods.selectionguicrafting.recipe.recipeBuilder()
.category('dummy_category')
.input(item('minecraft:stone') * 32)
.output(item('minecraft:diamond') * 50, 0.5f)
.output(item('minecraft:clay') * 2, 0.1f)
.tool(item('minecraft:wooden_pickaxe'), 1.0f)
.tool(item('minecraft:diamond_pickaxe'), 10.0f, 10.0f)
.durability(10)
.time(200)
.xp(1)
.sound('minecraft:block.anvil.land', 1.0f, 1.0f)
.register()
mods.selectionguicrafting.recipe.recipeBuilder()
.category('dead')
.input(item('minecraft:wheat_seeds') * 3)
.output(item('minecraft:sand') * 2)
.tool(item('minecraft:wooden_pickaxe'), 1.0f, 1.1f)
.tool(item('minecraft:golden_pickaxe'), 0.5f, 1.5f)
.catalyst(item('minecraft:apple') * 2, 0.9f)
.time(40)
.durability(1)
.queueType(false)
.outputType('INVENTORY')
.xp(1)
.register()
mods.selectionguicrafting.recipe.recipeBuilder()
.category('dead')
.input(item('minecraft:stick') * 3)
.output(item('minecraft:sand') * 2)
.tool(item('minecraft:wooden_pickaxe'), 1.0f, 1.1f)
.tool(item('minecraft:golden_pickaxe'), 0.5f, 1.5f)
.catalyst(item('minecraft:apple') * 2, 0.9f)
.frame('selectionguicrafting:textures/gui/frame/iron.png')
.time(40)
.durability(1)
.queueType(false)
.register()