]> git.lizzy.rs Git - xdecor.git/commitdiff
Don't set paramtype="light" by default, unless it's expectable to propagate light.
authorTim <t4im@users.noreply.github.com>
Sun, 9 Oct 2016 17:54:56 +0000 (19:54 +0200)
committerTim <t4im@users.noreply.github.com>
Tue, 11 Oct 2016 00:13:58 +0000 (02:13 +0200)
handlers/registration.lua

index 6b7ab1ff8d5211e8bdafcf8080ba2117f6b8e272..680c202abed747fd9454ea4669af5f45fae99972 100644 (file)
@@ -43,8 +43,10 @@ local default_can_dig = function(pos)
 end
 
 function xdecor.register(name, def)
-       def.drawtype = def.drawtype or (def.node_box and "nodebox")
-       def.paramtype = def.paramtype or "light"
+       def.drawtype = def.drawtype
+               or (def.mesh and "mesh")
+               or (def.node_box and "nodebox")
+
        def.sounds = def.sounds or default.node_sound_defaults()
 
        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"
        end
 
-       if def.drawtype == "plantlike" or def.drawtype == "torchlike" or
-                       def.drawtype == "signlike" or def.drawtype == "fencelike" then
+       if def.sunlight_propagates ~= false and
+                       (def.drawtype == "plantlike" or def.drawtype == "torchlike" or
+                       def.drawtype == "signlike" or def.drawtype == "fencelike") then
                def.sunlight_propagates = true
        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 inventory = def.inventory
        def.inventory = nil