Skip to content

Commit

Permalink
Add flint and flint-and-steel
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Patrick Guerrero authored and paramat committed Mar 15, 2016
1 parent dfee51c commit 28884cc
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 3 deletions.
1 change: 1 addition & 0 deletions mods/default/README.txt
Expand Up @@ -178,6 +178,7 @@ Gambit (WTFPL):
default_diamond_block.png
default_ladder_steel.png
default_sign_wall_wood.png
default_flint.png

asl97 (WTFPL):
default_ice.png
Expand Down
6 changes: 6 additions & 0 deletions mods/default/craftitems.lua
Expand Up @@ -190,3 +190,9 @@ minetest.register_craftitem("default:obsidian_shard", {
description = "Obsidian Shard",
inventory_image = "default_obsidian_shard.png",
})

minetest.register_craftitem("default:flint", {
description = "Flint",
inventory_image = "default_flint.png"
})

8 changes: 7 additions & 1 deletion mods/default/nodes.lua
Expand Up @@ -353,9 +353,15 @@ minetest.register_node("default:gravel", {
footstep = {name = "default_gravel_footstep", gain = 0.5},
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", {
description = "Clay",
tiles = {"default_clay.png"},
Expand Down
Binary file added mods/default/textures/default_flint.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions mods/fire/README.txt
Expand Up @@ -30,3 +30,7 @@ fire_large.ogg sampled from:

fire_basic_flame_animated.png:
Muadtralk

fire_flint_steel.png
Gambit (WTFPL)

31 changes: 29 additions & 2 deletions mods/fire/init.lua
Expand Up @@ -8,7 +8,6 @@ fire = {}
-- Register flame nodes

minetest.register_node("fire:basic_flame", {
description = "Basic Flame",
drawtype = "firelike",
tiles = {
{
Expand All @@ -28,7 +27,7 @@ minetest.register_node("fire:basic_flame", {
buildable_to = true,
sunlight_propagates = true,
damage_per_second = 4,
groups = {igniter = 2, dig_immediate = 3},
groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1},
drop = "",

on_construct = function(pos)
Expand Down Expand Up @@ -71,6 +70,34 @@ minetest.register_node("fire:permanent_flame", {
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

Expand Down
Binary file added mods/fire/textures/fire_flint_steel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 28884cc

Please sign in to comment.