diff --git a/GROUPS.md b/GROUPS.md index 00ebd742de..99ea6823a4 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 63ddec9e5f..aeea1751a8 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