Replace xdecor fire by fire from Minetest Game

This commit is contained in:
Jean-Patrick Guerrero 2016-03-09 16:37:35 +01:00
parent 69bc2be4e3
commit 832534072d
4 changed files with 28 additions and 32 deletions

View File

@ -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",

View File

@ -1,7 +1,8 @@
default
doors
xpanes
bucket
doors
stairs
oresplus?
xpanes
3d_armor?
fire?
oresplus?

View File

@ -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",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 570 B