From d6e84e586b5a0c905f9d4df312bb405118738598 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Thu, 19 Oct 2017 19:53:22 -0600 Subject: [PATCH] group updates and simplecrafting_lib recipe support --- plants.lua | 2 +- plants/cooking.lua | 38 +++++++++++++++++++------------------- plants/plump_helmet.lua | 12 ++++++------ plants/sweet_pod.lua | 23 ++++++++++++++++++----- trees/blood_thorn.lua | 4 ++-- trees/tunnel_tube.lua | 2 +- 6 files changed, 47 insertions(+), 34 deletions(-) diff --git a/plants.lua b/plants.lua index 37ca073..81280a8 100644 --- a/plants.lua +++ b/plants.lua @@ -136,7 +136,7 @@ dfcaverns.register_seed = function(name, description, image, stage_one, grow_tim wield_image = image, drawtype = "signlike", paramtype2 = "wallmounted", - groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 2, dfcaverns_cookable = 1}, + groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 2, dfcaverns_cookable = 1, digtron_on_place=1}, _dfcaverns_next_stage = stage_one, _dfcaverns_next_stage_time = grow_time, paramtype = "light", diff --git a/plants/cooking.lua b/plants/cooking.lua index dbdaf73..a528186 100644 --- a/plants/cooking.lua +++ b/plants/cooking.lua @@ -27,25 +27,6 @@ local register_cooking_recipes = function(prefix, item, name, returns) on_use = minetest.item_eat(8), groups = {food = 8}, }) - - minetest.register_craft({ - type = "shapeless", - output = "dfcaverns:"..item.."_biscuit", - recipe = {"group:dfcaverns_cookable", prefix..":"..item}, - replacements = returns - }) - minetest.register_craft({ - type = "shapeless", - output = "dfcaverns:"..item.."_stew", - recipe = {"group:dfcaverns_cookable", "group:dfcaverns_cookable", prefix..":"..item}, - replacements = returns - }) - minetest.register_craft({ - type = "shapeless", - output = "dfcaverns:"..item.."_roast", - recipe = {"group:dfcaverns_cookable", "group:dfcaverns_cookable", "group:dfcaverns_cookable", prefix..":"..item}, - replacements = returns - }) if minetest.get_modpath("simplecrafting_lib") then simplecrafting_lib.register("cooking", { @@ -78,6 +59,25 @@ local register_cooking_recipes = function(prefix, item, name, returns) }, cooktime = 15.0, }) + else + minetest.register_craft({ + type = "shapeless", + output = "dfcaverns:"..item.."_biscuit", + recipe = {"group:dfcaverns_cookable", prefix..":"..item}, + replacements = returns + }) + minetest.register_craft({ + type = "shapeless", + output = "dfcaverns:"..item.."_stew", + recipe = {"group:dfcaverns_cookable", "group:dfcaverns_cookable", prefix..":"..item}, + replacements = returns + }) + minetest.register_craft({ + type = "shapeless", + output = "dfcaverns:"..item.."_roast", + recipe = {"group:dfcaverns_cookable", "group:dfcaverns_cookable", "group:dfcaverns_cookable", prefix..":"..item}, + replacements = returns + }) end end diff --git a/plants/plump_helmet.lua b/plants/plump_helmet.lua index 1c82ad3..821c83b 100644 --- a/plants/plump_helmet.lua +++ b/plants/plump_helmet.lua @@ -64,7 +64,7 @@ minetest.register_node("dfcaverns:plump_helmet_spawn", { tiles = { "dfcaverns_plump_helmet_cap.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1}, + groups = {snappy = 3, flammable = 2, plant = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, digtron_on_place=1}, _dfcaverns_next_stage = "dfcaverns:plump_helmet_1", _dfcaverns_next_stage_time = plump_helmet_grow_time, drawtype = "nodebox", @@ -96,7 +96,7 @@ minetest.register_node("dfcaverns:plump_helmet_1", { "dfcaverns_plump_helmet_cap.png", "dfcaverns_plump_helmet_cap.png^[lowpart:5:dfcaverns_plump_helmet_stem.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 1}, + groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 1, digtron_on_place=1}, _dfcaverns_next_stage = "dfcaverns:plump_helmet_2", _dfcaverns_next_stage_time = plump_helmet_grow_time, drawtype = "nodebox", @@ -132,7 +132,7 @@ minetest.register_node("dfcaverns:plump_helmet_2", { "dfcaverns_plump_helmet_cap.png", "dfcaverns_plump_helmet_cap.png^[lowpart:15:dfcaverns_plump_helmet_stem.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 2}, + groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 2, digtron_on_place=1}, _dfcaverns_next_stage = "dfcaverns:plump_helmet_3", _dfcaverns_next_stage_time = plump_helmet_grow_time, drawtype = "nodebox", @@ -166,7 +166,7 @@ minetest.register_node("dfcaverns:plump_helmet_3", { "dfcaverns_plump_helmet_cap.png", "dfcaverns_plump_helmet_cap.png^[lowpart:35:dfcaverns_plump_helmet_stem.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 3}, + groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 3, digtron_on_place=1}, _dfcaverns_next_stage = "dfcaverns:plump_helmet_4", _dfcaverns_next_stage_time = plump_helmet_grow_time, drawtype = "nodebox", @@ -200,7 +200,7 @@ minetest.register_node("dfcaverns:plump_helmet_4", { "dfcaverns_plump_helmet_cap.png", "dfcaverns_plump_helmet_cap.png^[lowpart:40:dfcaverns_plump_helmet_stem.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 4}, + groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 4, digtron_on_place=1}, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -251,7 +251,7 @@ minetest.register_node("dfcaverns:plump_helmet_4_picked", { "dfcaverns_plump_helmet_cap.png", "dfcaverns_plump_helmet_cap.png^[lowpart:40:dfcaverns_plump_helmet_stem.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 4}, + groups = {snappy = 3, flammable = 2, plant = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1, food = 4, digtron_on_place=1}, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", diff --git a/plants/sweet_pod.lua b/plants/sweet_pod.lua index e80f44c..1330854 100644 --- a/plants/sweet_pod.lua +++ b/plants/sweet_pod.lua @@ -207,11 +207,24 @@ if minetest.get_modpath("bucket") then S("Dwarven Syrup Bucket") ) - minetest.register_craft({ - type = "shapeless", - output = "dfcaverns:dwarven_syrup_bucket", - recipe = {"bucket:bucket_empty", "dfcaverns:sugar", "dfcaverns:sugar", "dfcaverns:sugar"}, - }) + if minetest.get_modpath("simplecrafting_lib") then + simplecrafting_lib.register("cooking", { + input = { + ["bucket:bucket_empty"] = 1, + ["dfcaverns:sugar"] = 3, + }, + output = { + ["dfcaverns:dwarven_syrup_bucket"] = 1, + }, + cooktime = 5.0, + }) + else + minetest.register_craft({ + type = "shapeless", + output = "dfcaverns:dwarven_syrup_bucket", + recipe = {"bucket:bucket_empty", "dfcaverns:sugar", "dfcaverns:sugar", "dfcaverns:sugar"}, + }) + end if minetest.get_modpath("dynamic_liquid") then dynamic_liquid.liquid_abm("dfcaverns:dwarven_syrup_source", "dfcaverns:dwarven_syrup_flowing", 5) diff --git a/trees/blood_thorn.lua b/trees/blood_thorn.lua index d13e669..184cdaf 100644 --- a/trees/blood_thorn.lua +++ b/trees/blood_thorn.lua @@ -36,7 +36,7 @@ minetest.register_node("dfcaverns:blood_thorn", { "dfcaverns_blood_thorn_side.png", "dfcaverns_blood_thorn_side.png", "dfcaverns_blood_thorn_side.png", "dfcaverns_blood_thorn_side.png"}, paramtype2 = "facedir", paramtype = "light", - groups = {choppy = 3, flammable = 2, light_sensitive_fungus = 11}, + groups = {choppy = 3, tree = 1, flammable = 2, light_sensitive_fungus = 11}, _dfcaverns_dead_node = "dfcaverns:blood_thorn_dead", sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node, @@ -50,7 +50,7 @@ minetest.register_node("dfcaverns:blood_thorn_dead", { tiles = {"dfcaverns_blood_thorn_top.png^[multiply:#804000", "dfcaverns_blood_thorn_top.png^[multiply:#804000", "dfcaverns_blood_thorn_side.png^[multiply:#804000"}, paramtype2 = "facedir", - groups = {choppy = 3, flammable = 2}, + groups = {choppy = 3, tree = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node, after_dig_node = blood_thorn_after_dig, diff --git a/trees/tunnel_tube.lua b/trees/tunnel_tube.lua index aaab841..64c32ec 100644 --- a/trees/tunnel_tube.lua +++ b/trees/tunnel_tube.lua @@ -18,7 +18,7 @@ minetest.register_node("dfcaverns:tunnel_tube", { paramtype2 = "facedir", drawtype = "nodebox", paramtype = "light", - groups = {choppy = 3, oddly_breakable_by_hand=1, flammable = 2}, + groups = {choppy = 3, tree = 1, oddly_breakable_by_hand=1, flammable = 2}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node,