Add flint and flint-and-steel

This commit is contained in:
Jean-Patrick Guerrero 2016-03-11 18:27:22 +01:00 committed by paramat
parent dfee51c21e
commit 28884cc784
7 changed files with 47 additions and 3 deletions

View File

@ -178,6 +178,7 @@ Gambit (WTFPL):
default_diamond_block.png default_diamond_block.png
default_ladder_steel.png default_ladder_steel.png
default_sign_wall_wood.png default_sign_wall_wood.png
default_flint.png
asl97 (WTFPL): asl97 (WTFPL):
default_ice.png default_ice.png

View File

@ -190,3 +190,9 @@ minetest.register_craftitem("default:obsidian_shard", {
description = "Obsidian Shard", description = "Obsidian Shard",
inventory_image = "default_obsidian_shard.png", inventory_image = "default_obsidian_shard.png",
}) })
minetest.register_craftitem("default:flint", {
description = "Flint",
inventory_image = "default_flint.png"
})

View File

@ -353,9 +353,15 @@ minetest.register_node("default:gravel", {
footstep = {name = "default_gravel_footstep", gain = 0.5}, footstep = {name = "default_gravel_footstep", gain = 0.5},
dug = {name = "default_gravel_footstep", gain = 1.0}, dug = {name = "default_gravel_footstep", gain = 1.0},
}), }),
drop = {
max_items = 1,
items = {
{items = {'default:flint'}, rarity = 16},
{items = {'default:gravel'}}
}
}
}) })
minetest.register_node("default:clay", { minetest.register_node("default:clay", {
description = "Clay", description = "Clay",
tiles = {"default_clay.png"}, tiles = {"default_clay.png"},

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -30,3 +30,7 @@ fire_large.ogg sampled from:
fire_basic_flame_animated.png: fire_basic_flame_animated.png:
Muadtralk Muadtralk
fire_flint_steel.png
Gambit (WTFPL)

View File

@ -8,7 +8,6 @@ fire = {}
-- Register flame nodes -- Register flame nodes
minetest.register_node("fire:basic_flame", { minetest.register_node("fire:basic_flame", {
description = "Basic Flame",
drawtype = "firelike", drawtype = "firelike",
tiles = { tiles = {
{ {
@ -28,7 +27,7 @@ minetest.register_node("fire:basic_flame", {
buildable_to = true, buildable_to = true,
sunlight_propagates = true, sunlight_propagates = true,
damage_per_second = 4, damage_per_second = 4,
groups = {igniter = 2, dig_immediate = 3}, groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1},
drop = "", drop = "",
on_construct = function(pos) on_construct = function(pos)
@ -71,6 +70,34 @@ minetest.register_node("fire:permanent_flame", {
end, end,
}) })
minetest.register_tool("fire:flint_and_steel", {
description = "Flint and Steel",
inventory_image = "fire_flint_steel.png",
on_use = function(itemstack, user, pointed_thing)
local player_name = user:get_player_name()
local pt = pointed_thing
if pt.type == "node" and minetest.get_node(pt.above).name == "air" then
if not minetest.is_protected(pt.above, player_name) then
minetest.set_node(pt.above, {name="fire:basic_flame"})
else
minetest.chat_send_player(player_name, "This area is protected")
end
end
if not minetest.setting_getbool("creative_mode") then
itemstack:add_wear(1000)
return itemstack
end
end
})
minetest.register_craft({
output = "fire:flint_and_steel",
recipe = {
{"default:flint", "default:steel_ingot"}
}
})
-- Get sound area of position -- Get sound area of position

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB