From: An0n3m0us Date: Wed, 1 Jan 2020 01:38:06 +0000 (+0000) Subject: Move crafting, cooking and fuel recipes into corresponding files X-Git-Tag: 5.2.0~23 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6e32287a420bdf8d1b795dc4fbcb35b717cd4316;p=oweals%2Fminetest_game.git Move crafting, cooking and fuel recipes into corresponding files --- diff --git a/mods/default/chests.lua b/mods/default/chests.lua index 8dbf9d89..b401d916 100644 --- a/mods/default/chests.lua +++ b/mods/default/chests.lua @@ -318,3 +318,39 @@ default.chest.register_chest("chest_locked", { groups = {choppy = 2, oddly_breakable_by_hand = 2}, protected = true, }) + +minetest.register_craft({ + output = "default:chest", + recipe = { + {"group:wood", "group:wood", "group:wood"}, + {"group:wood", "", "group:wood"}, + {"group:wood", "group:wood", "group:wood"}, + } +}) + +minetest.register_craft({ + output = "default:chest_locked", + recipe = { + {"group:wood", "group:wood", "group:wood"}, + {"group:wood", "default:steel_ingot", "group:wood"}, + {"group:wood", "group:wood", "group:wood"}, + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:chest_locked", + recipe = {"default:chest", "default:steel_ingot"}, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:chest", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:chest_locked", + burntime = 30, +}) diff --git a/mods/default/crafting.lua b/mods/default/crafting.lua index e3a24f16..bc436fc5 100644 --- a/mods/default/crafting.lua +++ b/mods/default/crafting.lua @@ -56,13 +56,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:stick 4", - recipe = { - {"group:wood"}, - } -}) - minetest.register_craft({ output = "default:sign_wall_steel 3", recipe = { @@ -81,55 +74,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:torch 4", - recipe = { - {"default:coal_lump"}, - {"group:stick"}, - } -}) - - -minetest.register_craft({ - output = "default:skeleton_key", - recipe = { - {"default:gold_ingot"}, - } -}) - -minetest.register_craft({ - output = "default:chest", - recipe = { - {"group:wood", "group:wood", "group:wood"}, - {"group:wood", "", "group:wood"}, - {"group:wood", "group:wood", "group:wood"}, - } -}) - -minetest.register_craft({ - output = "default:chest_locked", - recipe = { - {"group:wood", "group:wood", "group:wood"}, - {"group:wood", "default:steel_ingot", "group:wood"}, - {"group:wood", "group:wood", "group:wood"}, - } -}) - -minetest.register_craft( { - type = "shapeless", - output = "default:chest_locked", - recipe = {"default:chest", "default:steel_ingot"}, -}) - -minetest.register_craft({ - output = "default:furnace", - recipe = { - {"group:stone", "group:stone", "group:stone"}, - {"group:stone", "", "group:stone"}, - {"group:stone", "group:stone", "group:stone"}, - } -}) - minetest.register_craft({ output = "default:coalblock", recipe = { @@ -139,13 +83,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:coal_lump 9", - recipe = { - {"default:coalblock"}, - } -}) - minetest.register_craft({ output = "default:steelblock", recipe = { @@ -155,13 +92,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:steel_ingot 9", - recipe = { - {"default:steelblock"}, - } -}) - minetest.register_craft({ output = "default:copperblock", recipe = { @@ -171,13 +101,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:copper_ingot 9", - recipe = { - {"default:copperblock"}, - } -}) - minetest.register_craft({ output = "default:tinblock", recipe = { @@ -187,22 +110,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:tin_ingot 9", - recipe = { - {"default:tinblock"}, - } -}) - -minetest.register_craft({ - output = "default:bronze_ingot 9", - recipe = { - {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"}, - {"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"}, - {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"}, - } -}) - minetest.register_craft({ output = "default:bronzeblock", recipe = { @@ -228,13 +135,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:gold_ingot 9", - recipe = { - {"default:goldblock"}, - } -}) - minetest.register_craft({ output = "default:diamondblock", recipe = { @@ -244,13 +144,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:diamond 9", - recipe = { - {"default:diamondblock"}, - } -}) - minetest.register_craft({ output = "default:sandstone", recipe = { @@ -355,13 +248,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:clay_lump 4", - recipe = { - {"default:clay"}, - } -}) - minetest.register_craft({ output = "default:brick", recipe = { @@ -370,29 +256,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:clay_brick 4", - recipe = { - {"default:brick"}, - } -}) - -minetest.register_craft({ - output = "default:paper", - recipe = { - {"default:papyrus", "default:papyrus", "default:papyrus"}, - } -}) - -minetest.register_craft({ - output = "default:book", - recipe = { - {"default:paper"}, - {"default:paper"}, - {"default:paper"}, - } -}) - minetest.register_craft({ output = "default:bookshelf", recipe = { @@ -429,29 +292,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:mese_crystal 9", - recipe = { - {"default:mese"}, - } -}) - -minetest.register_craft({ - output = "default:mese_crystal_fragment 9", - recipe = { - {"default:mese_crystal"}, - } -}) - -minetest.register_craft({ - output = "default:mese_crystal", - recipe = { - {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}, - {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}, - {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}, - } -}) - minetest.register_craft({ output = "default:meselamp", recipe = { @@ -469,13 +309,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:obsidian_shard 9", - recipe = { - {"default:obsidian"} - } -}) - minetest.register_craft({ output = "default:obsidian", recipe = { @@ -615,50 +448,6 @@ minetest.register_craft({ recipe = "default:desert_cobble", }) -minetest.register_craft({ - type = "cooking", - output = "default:steel_ingot", - recipe = "default:iron_lump", -}) - -minetest.register_craft({ - type = "cooking", - output = "default:copper_ingot", - recipe = "default:copper_lump", -}) - -minetest.register_craft({ - type = "cooking", - output = "default:tin_ingot", - recipe = "default:tin_lump", -}) - -minetest.register_craft({ - type = "cooking", - output = "default:gold_ingot", - recipe = "default:gold_lump", -}) - -minetest.register_craft({ - type = "cooking", - output = "default:clay_brick", - recipe = "default:clay_lump", -}) - -minetest.register_craft({ - type = "cooking", - output = "default:gold_ingot", - recipe = "default:skeleton_key", - cooktime = 5, -}) - -minetest.register_craft({ - type = "cooking", - output = "default:gold_ingot", - recipe = "default:key", - cooktime = 5, -}) - -- -- Fuels @@ -787,7 +576,6 @@ minetest.register_craft({ burntime = 7, }) - minetest.register_craft({ type = "fuel", recipe = "default:fence_aspen_wood", @@ -849,7 +637,6 @@ minetest.register_craft({ burntime = 7, }) - minetest.register_craft({ type = "fuel", recipe = "default:bush_stem", @@ -916,36 +703,12 @@ minetest.register_craft({ burntime = 60, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:torch", - burntime = 4, -}) - minetest.register_craft({ type = "fuel", recipe = "default:sign_wall_wood", burntime = 10, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:chest", - burntime = 30, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:chest_locked", - burntime = 30, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:coal_lump", - burntime = 40, -}) - minetest.register_craft({ type = "fuel", recipe = "default:coalblock", @@ -976,57 +739,8 @@ minetest.register_craft({ burntime = 2, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:paper", - burntime = 1, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:book", - burntime = 3, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:book_written", - burntime = 3, -}) - minetest.register_craft({ type = "fuel", recipe = "default:dry_shrub", burntime = 2, }) - -minetest.register_craft({ - type = "fuel", - recipe = "group:stick", - burntime = 1, -}) - - -minetest.register_craft({ - type = "fuel", - recipe = "default:pick_wood", - burntime = 6, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:shovel_wood", - burntime = 4, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:axe_wood", - burntime = 6, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:sword_wood", - burntime = 5, -}) diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index e2e92bf2..1c93eb23 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -3,19 +3,6 @@ -- support for MT game translation. local S = default.get_translator -minetest.register_craftitem("default:stick", { - description = S("Stick"), - inventory_image = "default_stick.png", - groups = {stick = 1, flammable = 2}, -}) - -minetest.register_craftitem("default:paper", { - description = S("Paper"), - inventory_image = "default_paper.png", - groups = {flammable = 3}, -}) - - local lpp = 14 -- Lines per book's page local function book_on_use(itemstack, user) local player_name = user:get_player_name() @@ -158,27 +145,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) player:set_wielded_item(stack) end) -minetest.register_craftitem("default:book", { - description = S("Book"), - inventory_image = "default_book.png", - groups = {book = 1, flammable = 3}, - on_use = book_on_use, -}) - -minetest.register_craftitem("default:book_written", { - description = S("Book with Text"), - inventory_image = "default_book_written.png", - groups = {book = 1, not_in_creative_inventory = 1, flammable = 3}, - stack_max = 1, - on_use = book_on_use, -}) - -minetest.register_craft({ - type = "shapeless", - output = "default:book_written", - recipe = {"default:book", "default:book_written"} -}) - minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) if itemstack:get_name() ~= "default:book_written" then return @@ -258,15 +224,56 @@ minetest.register_craftitem("default:skeleton_key", { end }) +-- +-- Craftitem registry +-- + +minetest.register_craftitem("default:blueberries", { + description = S("Blueberries"), + inventory_image = "default_blueberries.png", + groups = {food_blueberries = 1, food_berry = 1}, + on_use = minetest.item_eat(2), +}) + +minetest.register_craftitem("default:book", { + description = S("Book"), + inventory_image = "default_book.png", + groups = {book = 1, flammable = 3}, + on_use = book_on_use, +}) + +minetest.register_craftitem("default:book_written", { + description = S("Book with Text"), + inventory_image = "default_book_written.png", + groups = {book = 1, not_in_creative_inventory = 1, flammable = 3}, + stack_max = 1, + on_use = book_on_use, +}) + +minetest.register_craftitem("default:bronze_ingot", { + description = S("Bronze Ingot"), + inventory_image = "default_bronze_ingot.png" +}) + +minetest.register_craftitem("default:clay_brick", { + description = S("Clay Brick"), + inventory_image = "default_clay_brick.png", +}) + +minetest.register_craftitem("default:clay_lump", { + description = S("Clay Lump"), + inventory_image = "default_clay_lump.png", +}) + minetest.register_craftitem("default:coal_lump", { description = S("Coal Lump"), inventory_image = "default_coal_lump.png", groups = {coal = 1, flammable = 1} }) -minetest.register_craftitem("default:iron_lump", { - description = S("Iron Lump"), - inventory_image = "default_iron_lump.png" +minetest.register_craftitem("default:copper_ingot", { + description = S("Copper Ingot"), + inventory_image = "default_copper_ingot.png" }) minetest.register_craftitem("default:copper_lump", { @@ -274,14 +281,19 @@ minetest.register_craftitem("default:copper_lump", { inventory_image = "default_copper_lump.png" }) -minetest.register_craftitem("default:tin_lump", { - description = S("Tin Lump"), - inventory_image = "default_tin_lump.png" +minetest.register_craftitem("default:diamond", { + description = S("Diamond"), + inventory_image = "default_diamond.png", }) -minetest.register_craftitem("default:mese_crystal", { - description = S("Mese Crystal"), - inventory_image = "default_mese_crystal.png", +minetest.register_craftitem("default:flint", { + description = S("Flint"), + inventory_image = "default_flint.png" +}) + +minetest.register_craftitem("default:gold_ingot", { + description = S("Gold Ingot"), + inventory_image = "default_gold_ingot.png" }) minetest.register_craftitem("default:gold_lump", { @@ -289,14 +301,30 @@ minetest.register_craftitem("default:gold_lump", { inventory_image = "default_gold_lump.png" }) -minetest.register_craftitem("default:diamond", { - description = S("Diamond"), - inventory_image = "default_diamond.png", +minetest.register_craftitem("default:iron_lump", { + description = S("Iron Lump"), + inventory_image = "default_iron_lump.png" }) -minetest.register_craftitem("default:clay_lump", { - description = S("Clay Lump"), - inventory_image = "default_clay_lump.png", +minetest.register_craftitem("default:mese_crystal", { + description = S("Mese Crystal"), + inventory_image = "default_mese_crystal.png", +}) + +minetest.register_craftitem("default:mese_crystal_fragment", { + description = S("Mese Crystal Fragment"), + inventory_image = "default_mese_crystal_fragment.png", +}) + +minetest.register_craftitem("default:obsidian_shard", { + description = S("Obsidian Shard"), + inventory_image = "default_obsidian_shard.png", +}) + +minetest.register_craftitem("default:paper", { + description = S("Paper"), + inventory_image = "default_paper.png", + groups = {flammable = 3}, }) minetest.register_craftitem("default:steel_ingot", { @@ -304,9 +332,10 @@ minetest.register_craftitem("default:steel_ingot", { inventory_image = "default_steel_ingot.png" }) -minetest.register_craftitem("default:copper_ingot", { - description = S("Copper Ingot"), - inventory_image = "default_copper_ingot.png" +minetest.register_craftitem("default:stick", { + description = S("Stick"), + inventory_image = "default_stick.png", + groups = {stick = 1, flammable = 2}, }) minetest.register_craftitem("default:tin_ingot", { @@ -314,39 +343,224 @@ minetest.register_craftitem("default:tin_ingot", { inventory_image = "default_tin_ingot.png" }) -minetest.register_craftitem("default:bronze_ingot", { - description = S("Bronze Ingot"), - inventory_image = "default_bronze_ingot.png" +minetest.register_craftitem("default:tin_lump", { + description = S("Tin Lump"), + inventory_image = "default_tin_lump.png" }) -minetest.register_craftitem("default:gold_ingot", { - description = S("Gold Ingot"), - inventory_image = "default_gold_ingot.png" +-- +-- Crafting recipes +-- + +minetest.register_craft({ + output = "default:book", + recipe = { + {"default:paper"}, + {"default:paper"}, + {"default:paper"}, + } }) -minetest.register_craftitem("default:mese_crystal_fragment", { - description = S("Mese Crystal Fragment"), - inventory_image = "default_mese_crystal_fragment.png", +minetest.register_craft({ + type = "shapeless", + output = "default:book_written", + recipe = {"default:book", "default:book_written"} }) -minetest.register_craftitem("default:clay_brick", { - description = S("Clay Brick"), - inventory_image = "default_clay_brick.png", +minetest.register_craft({ + output = "default:bronze_ingot 9", + recipe = { + {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"}, + {"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"}, + {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"}, + } }) -minetest.register_craftitem("default:obsidian_shard", { - description = S("Obsidian Shard"), - inventory_image = "default_obsidian_shard.png", +minetest.register_craft({ + output = "default:clay_brick 4", + recipe = { + {"default:brick"}, + } }) -minetest.register_craftitem("default:flint", { - description = S("Flint"), - inventory_image = "default_flint.png" +minetest.register_craft({ + output = "default:clay_lump 4", + recipe = { + {"default:clay"}, + } }) -minetest.register_craftitem("default:blueberries", { - description = S("Blueberries"), - inventory_image = "default_blueberries.png", - groups = {food_blueberries = 1, food_berry = 1}, - on_use = minetest.item_eat(2), +minetest.register_craft({ + output = "default:coal_lump 9", + recipe = { + {"default:coalblock"}, + } +}) + +minetest.register_craft({ + output = "default:copper_ingot 9", + recipe = { + {"default:copperblock"}, + } +}) + +minetest.register_craft({ + output = "default:diamond 9", + recipe = { + {"default:diamondblock"}, + } +}) + +minetest.register_craft({ + output = "default:gold_ingot 9", + recipe = { + {"default:goldblock"}, + } +}) + +minetest.register_craft({ + output = "default:mese_crystal", + recipe = { + {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}, + {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}, + {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}, + } +}) + +minetest.register_craft({ + output = "default:mese_crystal 9", + recipe = { + {"default:mese"}, + } +}) + +minetest.register_craft({ + output = "default:mese_crystal_fragment 9", + recipe = { + {"default:mese_crystal"}, + } +}) + +minetest.register_craft({ + output = "default:obsidian_shard 9", + recipe = { + {"default:obsidian"} + } +}) + +minetest.register_craft({ + output = "default:paper", + recipe = { + {"default:papyrus", "default:papyrus", "default:papyrus"}, + } +}) + +minetest.register_craft({ + output = "default:skeleton_key", + recipe = { + {"default:gold_ingot"}, + } +}) + +minetest.register_craft({ + output = "default:steel_ingot 9", + recipe = { + {"default:steelblock"}, + } +}) + +minetest.register_craft({ + output = "default:stick 4", + recipe = { + {"group:wood"}, + } +}) + +minetest.register_craft({ + output = "default:tin_ingot 9", + recipe = { + {"default:tinblock"}, + } +}) + +-- +-- Cooking recipes +-- + +minetest.register_craft({ + type = "cooking", + output = "default:clay_brick", + recipe = "default:clay_lump", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:copper_ingot", + recipe = "default:copper_lump", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:gold_ingot", + recipe = "default:gold_lump", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:gold_ingot", + recipe = "default:key", + cooktime = 5, +}) + +minetest.register_craft({ + type = "cooking", + output = "default:gold_ingot", + recipe = "default:skeleton_key", + cooktime = 5, +}) + +minetest.register_craft({ + type = "cooking", + output = "default:steel_ingot", + recipe = "default:iron_lump", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:tin_ingot", + recipe = "default:tin_lump", +}) + +-- +-- Fuels +-- + +minetest.register_craft({ + type = "fuel", + recipe = "default:book", + burntime = 3, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:book_written", + burntime = 3, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:coal_lump", + burntime = 40, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:paper", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "group:stick", + burntime = 1, }) diff --git a/mods/default/furnace.lua b/mods/default/furnace.lua index d133a3a1..3c4ac9c8 100644 --- a/mods/default/furnace.lua +++ b/mods/default/furnace.lua @@ -352,3 +352,12 @@ minetest.register_node("default:furnace_active", { allow_metadata_inventory_move = allow_metadata_inventory_move, allow_metadata_inventory_take = allow_metadata_inventory_take, }) + +minetest.register_craft({ + output = "default:furnace", + recipe = { + {"group:stone", "group:stone", "group:stone"}, + {"group:stone", "", "group:stone"}, + {"group:stone", "group:stone", "group:stone"}, + } +}) diff --git a/mods/default/tools.lua b/mods/default/tools.lua index d6261fc3..e3c974c2 100644 --- a/mods/default/tools.lua +++ b/mods/default/tools.lua @@ -453,7 +453,6 @@ for name, mat in pairs(craft_ingreds) do }) end - minetest.register_tool("default:key", { description = S("Key"), inventory_image = "default_key.png", @@ -493,3 +492,27 @@ minetest.register_tool("default:key", { return nil end }) + +minetest.register_craft({ + type = "fuel", + recipe = "default:pick_wood", + burntime = 6, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:shovel_wood", + burntime = 4, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:axe_wood", + burntime = 6, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:sword_wood", + burntime = 5, +}) diff --git a/mods/default/torch.lua b/mods/default/torch.lua index fcdc1fec..85035a5e 100644 --- a/mods/default/torch.lua +++ b/mods/default/torch.lua @@ -134,3 +134,17 @@ minetest.register_lbm({ end end }) + +minetest.register_craft({ + output = "default:torch 4", + recipe = { + {"default:coal_lump"}, + {"group:stick"}, + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:torch", + burntime = 4, +})