Don't set paramtype="light" by default, unless it's expectable to propagate light.

This commit is contained in:
Tim 2016-10-09 19:54:56 +02:00
parent 480e55ed89
commit 768fcfe819

View File

@ -43,8 +43,10 @@ local default_can_dig = function(pos)
end end
function xdecor.register(name, def) function xdecor.register(name, def)
def.drawtype = def.drawtype or (def.node_box and "nodebox") def.drawtype = def.drawtype
def.paramtype = def.paramtype or "light" or (def.mesh and "mesh")
or (def.node_box and "nodebox")
def.sounds = def.sounds or default.node_sound_defaults() def.sounds = def.sounds or default.node_sound_defaults()
if not (def.drawtype == "normal" or def.drawtype == "signlike" or if not (def.drawtype == "normal" or def.drawtype == "signlike" or
@ -53,11 +55,18 @@ function xdecor.register(name, def)
def.paramtype2 = def.paramtype2 or "facedir" def.paramtype2 = def.paramtype2 or "facedir"
end end
if def.drawtype == "plantlike" or def.drawtype == "torchlike" or if def.sunlight_propagates ~= false and
def.drawtype == "signlike" or def.drawtype == "fencelike" then (def.drawtype == "plantlike" or def.drawtype == "torchlike" or
def.drawtype == "signlike" or def.drawtype == "fencelike") then
def.sunlight_propagates = true def.sunlight_propagates = true
end end
if not def.paramtype and
(def.light_source or def.sunlight_propagates or
def.drawtype == "nodebox" or def.drawtype == "mesh") then
def.paramtype = "light"
end
local infotext = def.infotext local infotext = def.infotext
local inventory = def.inventory local inventory = def.inventory
def.inventory = nil def.inventory = nil