diff --git a/deco_rocks.lua b/deco_rocks.lua index fefb061..1e7f207 100644 --- a/deco_rocks.lua +++ b/deco_rocks.lua @@ -42,7 +42,7 @@ for grid_count = 1,6 do selection_box = { type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, }, - groups = {stone=1, oddly_breakable_by_hand=3}, + groups = {stone=1, oddly_breakable_by_hand=3, dig_immediate = 3}, drop = "fun_caves:small_rocks", sounds = default.node_sound_stone_defaults(), }) @@ -80,7 +80,7 @@ minetest.register_node("fun_caves:small_rocks", { selection_box = { type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, }, - groups = {stone=1, oddly_breakable_by_hand=3}, + groups = {stone=1, oddly_breakable_by_hand=3, dig_immediate = 3}, sounds = default.node_sound_stone_defaults(), after_place_node = function(pos, placer, itemstack, pointed_thing) minetest.set_node(pos, {name = "fun_caves:small_rocks"..math.random(6)}) diff --git a/fungal_tree.lua b/fungal_tree.lua index 388a39d..e3f3e58 100644 --- a/fungal_tree.lua +++ b/fungal_tree.lua @@ -121,3 +121,113 @@ minetest.register_craft({ {"flowers:mushroom_brown"} } }) + +minetest.register_craftitem("fun_caves:disgusting_gruel", { + description = "Disgusting Gruel", + drawtype = "plantlike", + paramtype = "light", + tiles = {"fun_caves_disgusting_gruel.png"}, + inventory_image = "fun_caves_disgusting_gruel.png", + on_use = minetest.item_eat(2), + groups = {dig_immediate = 3}, +}) + +minetest.register_craftitem("fun_caves:disgusting_gruel_raw", { + description = "Bowl Of Gluey Paste", + drawtype = "plantlike", + paramtype = "light", + tiles = {"fun_caves_disgusting_gruel_raw.png"}, + inventory_image = "fun_caves_disgusting_gruel_raw.png", + groups = {dig_immediate = 3}, +}) + +minetest.register_craft({ + type = "cooking", + output = "fun_caves:disgusting_gruel", + recipe = 'fun_caves:disgusting_gruel_raw', + cooktime = 2, +}) + +minetest.register_craft({ + output = "fun_caves:disgusting_gruel_raw", + type = 'shapeless', + recipe = { + 'fun_caves:dry_fiber', + 'group:water_bucket', + 'group:bowl', + }, +}) + +-- complicated function to keep from wasting water... +--minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) +-- if itemstack:get_name() ~= "fun_caves:disgusting_gruel_raw" then +-- return +-- end +-- +-- local bucket +-- local index +-- for i = 1, player:get_inventory():get_size("craft") do +-- if (old_craft_grid[i]:get_name()):find('^bucket') then +-- bucket = old_craft_grid[i] +-- index = i +-- end +-- end +-- if not bucket then +-- return +-- end +-- +-- local data = minetest.deserialize(bucket:get_metadata()) +-- if not data then +-- data = {} +-- end +-- if not data.gruels then +-- data.gruels = 20 +-- end +-- data.gruels = data.gruels - 1 +-- if data.gruels > 0 then +-- bucket:set_metadata(minetest.serialize(data)) +-- craft_inv:set_stack("craft", index, bucket) +-- else +-- craft_inv:set_stack("craft", index, 'bucket:bucket_empty') +-- end +--end) + +-- less complicated function to keep from wasting water... +-- Just return the bucket and don't worry about it. +minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) + if itemstack:get_name() ~= "fun_caves:disgusting_gruel_raw" then + return + end + + local bucket + local index + for i = 1, player:get_inventory():get_size("craft") do + if (old_craft_grid[i]:get_name()):find('^bucket') then + bucket = old_craft_grid[i] + index = i + end + end + if not bucket then + return + end + + craft_inv:set_stack("craft", index, bucket) +end) + +minetest.register_craftitem("fun_caves:wooden_bowl", { + description = "Wooden Bowl", + drawtype = "plantlike", + paramtype = "light", + tiles = {"fun_caves_wooden_bowl.png"}, + inventory_image = "fun_caves_wooden_bowl.png", + groups = {bowl = 1, dig_immediate = 3}, +}) + +minetest.register_craft({ + output = 'fun_caves:wooden_bowl 20', + recipe = { + {'', '', ''}, + {'group:wood', '', 'group:wood'}, + {'', 'group:wood', ''}, + }, +}) diff --git a/textures/fun_caves_disgusting_gruel.png b/textures/fun_caves_disgusting_gruel.png new file mode 100644 index 0000000..4fa0f5d Binary files /dev/null and b/textures/fun_caves_disgusting_gruel.png differ diff --git a/textures/fun_caves_disgusting_gruel_raw.png b/textures/fun_caves_disgusting_gruel_raw.png new file mode 100644 index 0000000..202f501 Binary files /dev/null and b/textures/fun_caves_disgusting_gruel_raw.png differ diff --git a/textures/fun_caves_wooden_bowl.png b/textures/fun_caves_wooden_bowl.png new file mode 100644 index 0000000..5169fdf Binary files /dev/null and b/textures/fun_caves_wooden_bowl.png differ