mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2024-12-23 00:20:17 +01:00
rework a bit to work better with minetest_game 0.4.16
eliminates flint and steel (aliased to mt_game fire:flint_and_steel) eliminates fake_fire:fake_fire (aliased to mt_game fire:permanent_flame) mt_game already provides a "fake" fire in the form of a "permanent flame", strike a coal block with flint/steel to get it. modifies default ice block so that it can be "ignited" (ice fire on top) with mt_game flint/steel Fire mod must be enabled. However, fire damage is NOT required.
This commit is contained in:
parent
d7a4054dda
commit
9d2704c0c2
@ -66,43 +66,36 @@ local function stop_smoke(pos)
|
|||||||
this_spawner_meta:set_int("sound", nil)
|
this_spawner_meta:set_int("sound", nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- FLAME TYPES
|
minetest.register_node("fake_fire:ice_fire", {
|
||||||
local flame_types = {
|
inventory_image = "ice_fire_inv.png",
|
||||||
{ "fake", S("Fake fire") },
|
description = desc,
|
||||||
{ "ice", S("Ice fire") },
|
drawtype = "plantlike",
|
||||||
}
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {dig_immediate=3, not_in_creative_inventory=1},
|
||||||
|
sunlight_propagates = true,
|
||||||
|
buildable_to = true,
|
||||||
|
walkable = false,
|
||||||
|
light_source = 14,
|
||||||
|
waving = 1,
|
||||||
|
tiles = {
|
||||||
|
{name="ice_fire_animated.png", animation={type="vertical_frames",
|
||||||
|
aspect_w=16, aspect_h=16, length=1.5}},
|
||||||
|
},
|
||||||
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
|
start_smoke(pos, node, clicker)
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
on_destruct = function (pos)
|
||||||
|
stop_smoke(pos)
|
||||||
|
minetest.sound_play("fire_extinguish", {
|
||||||
|
pos = pos, max_hear_distance = 5
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
drop = ""
|
||||||
|
})
|
||||||
|
|
||||||
for _, f in ipairs(flame_types) do
|
minetest.register_alias("fake_fire:fake_fire", "fire:permanent_flame")
|
||||||
local name, desc = unpack(f)
|
|
||||||
minetest.register_node("fake_fire:"..name.."_fire", {
|
|
||||||
inventory_image = name.."_fire_inv.png",
|
|
||||||
description = desc,
|
|
||||||
drawtype = "plantlike",
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
groups = {dig_immediate=3, not_in_creative_inventory=1},
|
|
||||||
sunlight_propagates = true,
|
|
||||||
buildable_to = true,
|
|
||||||
walkable = false,
|
|
||||||
light_source = 14,
|
|
||||||
waving = 1,
|
|
||||||
tiles = {
|
|
||||||
{name=name.."_fire_animated.png", animation={type="vertical_frames",
|
|
||||||
aspect_w=16, aspect_h=16, length=1.5}},
|
|
||||||
},
|
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
|
||||||
start_smoke(pos, node, clicker)
|
|
||||||
return itemstack
|
|
||||||
end,
|
|
||||||
on_destruct = function (pos)
|
|
||||||
stop_smoke(pos)
|
|
||||||
minetest.sound_play("fire_extinguish", {
|
|
||||||
pos = pos, max_hear_distance = 5
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
drop = ""
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_node("fake_fire:fancy_fire", {
|
minetest.register_node("fake_fire:fancy_fire", {
|
||||||
inventory_image = "fancy_fire_inv.png",
|
inventory_image = "fancy_fire_inv.png",
|
||||||
@ -190,43 +183,18 @@ for _, mat in ipairs(materials) do
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- FLINT and STEEL
|
minetest.register_alias("fake_fire:flint_and_steel", "fire:flint_and_steel")
|
||||||
minetest.register_tool("fake_fire:flint_and_steel", {
|
|
||||||
description = S("Flint and steel"),
|
|
||||||
inventory_image = "flint_and_steel.png",
|
|
||||||
liquids_pointable = false,
|
|
||||||
stack_max = 1,
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 1.0,
|
|
||||||
max_drop_level=0,
|
|
||||||
groupcaps={flamable = {uses=65, maxlevel=1}}
|
|
||||||
},
|
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
|
||||||
if pointed_thing.type == "node" and minetest.get_node(pointed_thing.above).name == "air" then
|
|
||||||
if not minetest.is_protected(pointed_thing.above, user:get_player_name()) then
|
|
||||||
if string.find(minetest.get_node(pointed_thing.under).name, "ice") then
|
|
||||||
minetest.set_node(pointed_thing.above, {name="fake_fire:ice_fire"})
|
|
||||||
else
|
|
||||||
minetest.set_node(pointed_thing.above, {name="fake_fire:fake_fire"})
|
|
||||||
end
|
|
||||||
else
|
|
||||||
minetest.chat_send_player(user:get_player_name(), S("This area is protected!"))
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
itemstack:add_wear(65535/65)
|
minetest.override_item("default:ice", {
|
||||||
return itemstack
|
on_ignite = function(pos, igniter)
|
||||||
|
local flame_pos = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||||
|
if minetest.get_node(flame_pos).name == "air" then
|
||||||
|
minetest.set_node(flame_pos, {name = "fake_fire:ice_fire"})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- CRAFTS
|
-- CRAFTS
|
||||||
minetest.register_craft({
|
|
||||||
type = "shapeless",
|
|
||||||
output = 'fake_fire:flint_and_steel',
|
|
||||||
recipe = {"default:obsidian_shard", "default:steel_ingot"}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
|
Loading…
Reference in New Issue
Block a user