only check buildable_to if not in creative

This commit is contained in:
BuckarooBanzay 2020-06-16 13:01:08 +02:00
parent 3a701cf3e1
commit 28fbb7e168

@ -91,20 +91,21 @@ function digibuilder.digiline_effector(pos, _, channel, msg)
return
end
-- check if node is buildable to
if not node_def.buildable_to then
digilines.receptor_send(pos, digibuilder.digiline_rules, set_channel, {
pos = msg.pos,
error = true,
message = "Can't build on that position!"
})
return
end
local is_creative = meta:get_int("creative") == 1
local inv = meta:get_inventory()
if not is_creative then
-- check if node is buildable to
if not node_def.buildable_to then
digilines.receptor_send(pos, digibuilder.digiline_rules, set_channel, {
pos = msg.pos,
error = true,
message = "Can't build on that position!"
})
return
end
-- check if node is in inventory
if not inv:contains_item("main", msg.name) then
digilines.receptor_send(pos, digibuilder.digiline_rules, set_channel, {