#+----------------------+ #- Recipe command, GUIs #+----------------------+ #- @@@ Recipe Inventory recipeInventory_main: type: inventory inventory: chest gui: true #title: <&color[#F4F4F4]>Recept slots: - [filler] [filler] [filler] [filler] [] [filler] [filler] [filler] [filler] - [filler] [filler] [filler] [] [] [] [] [filler] [filler] - [filler] [filler] [] [] [] [] [filler] [filler] [filler] - [filler] [filler] [filler] [filler] [filler] [filler] [filler] [filler] [filler] definitions: filler: white_stained_glass_pane[display=<&7>] #- @@@ Player Command recipeCommand_recipe: type: command name: recipe usage: /recipe [item] description: Zobrazi recept pre vyrobenie daneho itemu. tab completions: 1: ]> data: CRAFTING: crafting_table COOKING: furnace BLASTING: blast_furnace SMOKING: smoker CAMPFIRE: campfire STONECUTTING: stonecutter SMITHING: smithing_table BREWING: brewing_stand script: - define material_name - if <[material_name]> == Null: - narrate "<&c>Nezadal si nazov itemu, ktoreho recept chces najst!" - stop - if <[material_name]> not in ]>: - narrate "<&c>Nevyzera to tak, ze si zadal existujuci item!" - stop # Definitions - define item <[material_name].as[item]> - define inventory - define map_recipes ]> - define list ]> # Adjustments - adjust <[inventory]> "title:<&color[#F4F4F4]>Recept <[item].material.translated_name>" # Main loop - foreach as:material key:type: - if <[map_recipes].keys.contains[<[type]>]>: # Recept pre dany typ craftingu existuje - definemap mechanizmy: display: <&e>].material.translated_name.strip_color> lore: <&7>Pocet najdenych receptov: <&e><[map_recipes].get[<[type]>].size><&a>Klikni pre zobrazenie receptov! quantity: <[map_recipes].get[<[type]>].size> - else: # Recept pre dany typ craftingu neexistuje - definemap mechanizmy: display: <&c>].material.translated_name.strip_color> lore: <&7>Pocet najdenych receptov: <&c>0 quantity: 1 - define list:->:].with_map[<[mechanizmy]>]> # Inventory setter - inventory fill destination:<[inventory]> origin:<[list]> - inventory open destination:<[inventory]> player: #- @@@ Recipe Procedure recipeProcedure_maprecipes: type: procedure definitions: item script: - define map_recipes - foreach CRAFTING|COOKING|BLASTING|SMOKING|CAMPFIRE|STONECUTTING|SMITHING|BREWING as:type: - foreach next if:<[item].recipe_ids[<[type]>].is_empty> # Dany item ma pre tento typ nejake recepty - define list_recipes - foreach <[item].recipe_ids[<[type]>]> as:recipe_id: # Recipe id predstavuje nazov toho speci itemu # trebars minecraft:diamond_from_deepslate_ore... - define list_recipes:->:]> # Vlozime ulozene recepty do mapy - define map_recipes <[map_recipes].with[<[type]>].as[<[list_recipes]>]> - determine <[map_recipes]>