From 768fcfe8194d9eaa6296acb439213c426ccf41cc Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 9 Oct 2016 19:54:56 +0200 Subject: [PATCH] Don't set paramtype="light" by default, unless it's expectable to propagate light. --- handlers/registration.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/handlers/registration.lua b/handlers/registration.lua index 6b7ab1f..680c202 100644 --- a/handlers/registration.lua +++ b/handlers/registration.lua @@ -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 -- 2.44.0