Update mod to be ready with minetest 0.4.14

master
addi 2016-07-13 19:54:39 +02:00
parent ae99a007d0
commit f0d191b6a3
5 changed files with 35 additions and 33 deletions

View File

@ -1 +1,2 @@
default
fire?

View File

@ -6,9 +6,6 @@ minetest.register_node("fake_fire:fake_fire", {
paramtype = "light",
is_ground_content = true,
inventory_image = 'fake_fire.png',
wield_image = {
{name="fake_fire_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5}},
},
drawtype = "plantlike",
light_source = 14,
drop = '',
@ -16,7 +13,7 @@ minetest.register_node("fake_fire:fake_fire", {
groups = {dig_immediate=3,attached_node=1},
paramtype = "light",
walkable = false,
sounds = minetest.sound_play("fire_small", {pos=cp, loop=true}),
--sounds = minetest.sound_play("fire_small", {pos=cp, loop=true}),
on_punch = function (pos,node,puncher)
minetest.sound_play("fire_extinguish",
{pos = pos, gain = 1.0, max_hear_distance = 20,})
@ -31,8 +28,6 @@ end
n = minetest.env:get_node(pointed_thing)
if pointed_thing.type == "node" then
minetest.env:add_node(pointed_thing.above, {name="fake_fire:fake_fire"})
minetest.sound_play("",
{gain = 1.0, max_hear_distance = 20,})
end
end,
})
@ -80,43 +75,49 @@ minetest.register_tool("fake_fire:flint_and_steel", {
})
-- water and lava puts out fake fire --
minetest.register_abm({
nodenames = {"fake_fire:fake_fire"},
interval = 1,
chance = 1,
action = function(pos, node)
if minetest.env:find_node_near(pos, 1, {"default:water_source", "default:water_flowing","default:lava_source","default:lava_flowing"}) then
minetest.sound_play("fire_extinguish",
{gain = 1.0, max_hear_distance = 20,})
node.name = "air"
minetest.env:set_node(pos, node)
if minetest.get_modpath("fire") then
--override fire's flint and steel
minetest.override_item("fire:flint_and_steel", {
description = "Flint and Steel (disabled)",
on_use = function() return end,
groups={not_in_craft_guide=1, not_in_creative_inventory =1}
})
--override craft reziepe
minetest.register_craft({
output = "fake_fire:flint_and_steel",
recipe = {
{"default:flint", "default:steel_ingot"}
}
})
end
end,
-- Extinguish all flames quickly with water, snow, ice
minetest.register_abm({
nodenames = {"fake_fire:fake_fire"},
neighbors = {"group:puts_out_fire"},
interval = 3,
chance = 1,
catch_up = false,
action = function(pos, node)
minetest.remove_node(pos)
minetest.sound_play("fire_extinguish",
{pos = pos, gain = 1.0, max_hear_distance = 20,})
end,
})
minetest.register_craftitem("fake_fire:flint", {
description = "flint",
inventory_image = "flint.png",
stack_max = 99,
liquids_pointable = false,
})
minetest.register_alias("fake_fire:flint", "default:flint")
minetest.register_craft({
output = '"fake_fire:flint_and_steel" 1',
output = "fake_fire:flint_and_steel",
recipe = {
{"fake_fire:flint", ""},
{"default:flint", ""},
{"", "default:steel_ingot"},
}
})
minetest.register_craft({
output = '"fake_fire:flint" 1',
recipe = {
{"default:gravel"},
}
})
-- Thanks-

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B