diff --git a/craftitems.lua b/craftitems.lua index 7f94971..f4e3100 100644 --- a/craftitems.lua +++ b/craftitems.lua @@ -12,7 +12,7 @@ minetest.register_craftitem("xdecor:bowl_soup", { stack_max = 1, on_use = function(itemstack, user) itemstack:replace("xdecor:bowl 1") - if minetest.get_modpath("hunger") then + if rawget(_G, "hunger") then minetest.item_eat(20) else user:set_hp(20) @@ -21,25 +21,27 @@ minetest.register_craftitem("xdecor:bowl_soup", { end }) -minetest.register_tool("xdecor:flint_steel", { - description = "Flint & Steel", - inventory_image = "xdecor_flint_steel.png", - on_use = function(itemstack, user, pointed_thing) - local player = user:get_player_name() - local pt = pointed_thing +if rawget(_G, "fire") then + minetest.register_tool("xdecor:flint_steel", { + description = "Flint & Steel", + inventory_image = "xdecor_flint_steel.png", + on_use = function(itemstack, user, pointed_thing) + local player = 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) then - minetest.set_node(pt.above, {name="xdecor:fire"}) - else - minetest.chat_send_player(player, "[!] This area is protected") + if pt.type == "node" and minetest.get_node(pt.above).name == "air" then + if not minetest.is_protected(pt.above, player) then + minetest.set_node(pt.above, {name="fire:basic_flame"}) + else + minetest.chat_send_player(player, "[!] This area is protected") + end end - end - itemstack:add_wear(1000) - return itemstack - end -}) + itemstack:add_wear(2000) + return itemstack + end + }) +end minetest.register_tool("xdecor:hammer", { description = "Hammer", diff --git a/depends.txt b/depends.txt index 1310bf4..4a8075c 100644 --- a/depends.txt +++ b/depends.txt @@ -1,7 +1,8 @@ default -doors -xpanes bucket +doors stairs -oresplus? +xpanes 3d_armor? +fire? +oresplus? diff --git a/nodes.lua b/nodes.lua index 6277be3..cb02fa0 100644 --- a/nodes.lua +++ b/nodes.lua @@ -297,18 +297,11 @@ minetest.register_on_joinplayer(function(player) inv:set_size("enderchest", 8*4) end) -xdecor.register("fire", { - description = "Fancy Fire", - drawtype = "plantlike", - light_source = 14, - walkable = false, - tiles = {{ name = "xdecor_fire_anim.png", - animation = {type="vertical_frames", length=1.5 }}}, - damage_per_second = 4, - drop = "", - selection_box = xdecor.pixelbox(16, {{4, 0, 4, 8, 3, 8}}), - groups = {dig_immediate=3, hot=3, not_in_creative_inventory=1} -}) +if rawget(_G, "fire") then + minetest.register_alias("xdecor:fire", "fire:basic_flame") +else + minetest.register_alias("xdecor:fire", "air") +end xdecor.register("ivy", { description = "Ivy", diff --git a/textures/xdecor_fire_anim.png b/textures/xdecor_fire_anim.png deleted file mode 100644 index b3b43f6..0000000 Binary files a/textures/xdecor_fire_anim.png and /dev/null differ