Merge remote-tracking branch 'origin/bonfire_and_furnace'
This commit is contained in:
commit
31b9f0a0c4
Binary file not shown.
@ -1,12 +1,5 @@
|
||||
bonfire = {}
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bonfire:self',
|
||||
recipe = {
|
||||
{'default:stick','default:stick','default:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
bonfire.formspec =
|
||||
"invsize[8,9;]"..
|
||||
"image[0,2;1,1;default_furnace_fire_bg.png]"..
|
||||
@ -37,6 +30,7 @@ minetest.register_node("bonfire:self", {
|
||||
{-0.5,-0.5,-0.5,0.5,-0.45,0.5},
|
||||
},
|
||||
},
|
||||
drop = "",
|
||||
groups = {crumbly=3, oddly_breakable_by_hand=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_construct = function(pos)
|
||||
@ -230,4 +224,4 @@ minetest.register_abm({
|
||||
stack:take_item()
|
||||
inv:set_stack("fuel", 1, stack)
|
||||
end,
|
||||
})
|
||||
})
|
||||
|
@ -307,6 +307,14 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sticks',
|
||||
recipe = {
|
||||
{'default:stick', ''},
|
||||
{'', 'default:stick'},
|
||||
},
|
||||
})
|
||||
|
||||
--
|
||||
-- Crafting (tool repair)
|
||||
--
|
||||
@ -1124,6 +1132,34 @@ minetest.register_craftitem("default:scorched_stuff", {
|
||||
inventory_image = "default_scorched_stuff.png",
|
||||
})
|
||||
|
||||
minetest.register_tool("default:sticks", {
|
||||
description = "Sticks",
|
||||
inventory_image = "default_sticks.png",
|
||||
on_use = function(item, user, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
local objects = minetest.env:get_objects_inside_radius(pointed_thing.above, 0.5)
|
||||
local n = 0
|
||||
for _, v in ipairs(objects) do
|
||||
if not v:is_player() and v:get_luaentity() and v:get_luaentity().name == "__builtin:item" then
|
||||
if ItemStack(v:get_luaentity().itemstring):get_name() == "default:stick" then
|
||||
n = n + ItemStack(v:get_luaentity().itemstring):get_count()*2
|
||||
v:remove()
|
||||
elseif ItemStack(v:get_luaentity().itemstring):get_name() == "default:leaves" then
|
||||
n = n + ItemStack(v:get_luaentity().itemstring):get_count()
|
||||
v:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
if n >= 10 then
|
||||
minetest.env:set_node(pointed_thing.above, {name = "bonfire:self"})
|
||||
end
|
||||
item:add_wear(65535/10)
|
||||
return item
|
||||
end,
|
||||
})
|
||||
|
||||
--
|
||||
-- Falling stuff
|
||||
--
|
||||
@ -1282,4 +1318,4 @@ function on_punchnode(p, node)
|
||||
end
|
||||
minetest.register_on_punchnode(on_punchnode)
|
||||
|
||||
-- END
|
||||
-- END
|
||||
|
BIN
mods/default/textures/default_sticks.png
Normal file
BIN
mods/default/textures/default_sticks.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 297 B |
Binary file not shown.
Before Width: | Height: | Size: 85 KiB |
Loading…
x
Reference in New Issue
Block a user