forked from nalc/homedecor_modpack
Merge pull request #21 from Zeg9/signs
In creative mode, don't remove fences and signs from inventory when you place them
This commit is contained in:
commit
e9520f42e4
|
@ -180,7 +180,10 @@ minetest.register_node(":default:sign_wall", {
|
||||||
z = above.z + sign_info.delta.z}, "signs:text")
|
z = above.z + sign_info.delta.z}, "signs:text")
|
||||||
text:setyaw(sign_info.yaw)
|
text:setyaw(sign_info.yaw)
|
||||||
|
|
||||||
itemstack:take_item()
|
|
||||||
|
if not homedecor_expect_infinite_stacks then
|
||||||
|
itemstack:take_item()
|
||||||
|
end
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -429,13 +432,17 @@ function homedecor_register_fence_with_sign(fencename, fencewithsignname)
|
||||||
elseif (not homedecor_node_is_owned(pointed_thing.under, placer))
|
elseif (not homedecor_node_is_owned(pointed_thing.under, placer))
|
||||||
and def_under.buildable_to then
|
and def_under.buildable_to then
|
||||||
minetest.env:add_node(pointed_thing.under, {name = fencename, param2 = fdir})
|
minetest.env:add_node(pointed_thing.under, {name = fencename, param2 = fdir})
|
||||||
itemstack:take_item()
|
if not homedecor_expect_infinite_stacks then
|
||||||
|
itemstack:take_item()
|
||||||
|
end
|
||||||
placer:set_wielded_item(itemstack)
|
placer:set_wielded_item(itemstack)
|
||||||
return itemstack
|
return itemstack
|
||||||
elseif (not homedecor_node_is_owned(pointed_thing.above, placer))
|
elseif (not homedecor_node_is_owned(pointed_thing.above, placer))
|
||||||
and def_above.buildable_to then
|
and def_above.buildable_to then
|
||||||
minetest.env:add_node(pointed_thing.above, {name = fencename, param2 = fdir})
|
minetest.env:add_node(pointed_thing.above, {name = fencename, param2 = fdir})
|
||||||
itemstack:take_item()
|
if not homedecor_expect_infinite_stacks then
|
||||||
|
itemstack:take_item()
|
||||||
|
end
|
||||||
placer:set_wielded_item(itemstack)
|
placer:set_wielded_item(itemstack)
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user