import crafttweaker.data.IData; import crafttweaker.item.IItemStack; // Remove default recipes recipes.remove(); recipes.remove(); // Add recipe for Portable Seed Analyzer recipes.addShaped(, [[, , ], [, , ], [, , ]]); // Define a function to add seed analysis recipes function addSeedAnalysisRecipe(seedItem as IItemStack, recipeName as string) { recipes.addShapeless( recipeName, seedItem, [ (seedItem.marked("mark").transformNew(function(item) { return item.withTag(item.tag); })).noReturn(), .reuse() ], function(out, ins, cInfo) { var species = ins.mark.tag.agri_seed as string; var strength = ins.mark.tag.agri_strength as byte; var gain = ins.mark.tag.agri_gain as byte; var growth = ins.mark.tag.agri_growth as byte; var analyzed = 1 as byte; var updatedTag as IData = { agri_analyzed: analyzed, agri_strength: strength, agri_gain: gain, agri_seed: species, agri_growth: growth }; return out.updateTag(updatedTag); }, null ); } // Define all seeds that need analysis recipes var seedsToAnalyze as IItemStack[] = [ , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ]; // Add analysis recipes for all defined seeds for i, seed in seedsToAnalyze { addSeedAnalysisRecipe(seed, "scan_seed_" + i); } val agriclip = ; recipes.addShapeless( "scanagriclipping",, [(agriclip.marked("mark").transformNew(function(item) { return item.withTag(item.tag); })).noReturn(), .reuse()], function(out,ins,cInfo){ var species = ins.mark.tag.agri_seed as string; var strength = ins.mark.tag.agri_strength as byte; var gain = ins.mark.tag.agri_gain as byte; var growth = ins.mark.tag.agri_growth as byte; var analyzed = 1 as byte; var updatedTag as IData = { agri_analyzed: analyzed, agri_strength: strength, agri_gain: gain, agri_seed: species, agri_growth: growth }; return out.updateTag(updatedTag); }, null );