From d9a61e826aeb2f88c8c139888462b680eeec522e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 10 Mar 2017 20:01:45 +0100 Subject: [PATCH] Add opaque group --- GROUPS.md | 3 ++- mods/CORE/mcl_autogroup/init.lua | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/GROUPS.md b/GROUPS.md index 00ebd742d..99ea6823a 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -67,7 +67,8 @@ Please read to learn how digging times ### Declarative groups These groups are used mostly for informational purposes -* `solid=1`: Solid block (automatically assigned) +* `solid=1`: Solid full-cube block (automatically assigned) +* `opaque=1`: Opaque block (automatically assigned) * `not_solid=1`: Block is sold (only assign this group for nodes which are automatically detected as “solid” in error * `water=1`: Water * `lava=1`: Lava diff --git a/mods/CORE/mcl_autogroup/init.lua b/mods/CORE/mcl_autogroup/init.lua index 63ddec9e5..aeea1751a 100644 --- a/mods/CORE/mcl_autogroup/init.lua +++ b/mods/CORE/mcl_autogroup/init.lua @@ -82,6 +82,11 @@ local overwrite = function() newgroups.solid = 1 groups_changed = true end + -- Automatically assign the “opaque” group for opaque nodes + if not (ndef.paramtype == "light" or ndef.sunlight_propagates) then + newgroups.opaque = 1 + groups_changed = true + end local function calculate_group(hardness, material, diggroup, newgroups, actual_rating, expected_rating) local time, validity_factor