Add disgusting gruel.

This commit is contained in:
Duane 2016-06-25 19:56:43 -05:00
parent af524bf009
commit fdd130c1a5
5 changed files with 112 additions and 2 deletions

View file

@ -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)})

View file

@ -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', ''},
},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB