From 838ad60ad085f7eabdfb60a8e531b14e424aa5d4 Mon Sep 17 00:00:00 2001 From: Pedro Gimeno Date: Sat, 19 Apr 2025 18:40:59 +0200 Subject: [PATCH] Fix dry_grass_N on dirt producing dirt_with_grass `dry_grass_N` has groups `grass` and `dry_grass`, so if the check for `grass` is done first, having dry_grass on it makes it turn into `dirt_with_grass` instead of `dirt_with_dry_grass`. Changing the order fixes this. --- mods/default/functions.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/default/functions.lua b/mods/default/functions.lua index e426415c..9d164b4b 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -645,10 +645,11 @@ minetest.register_abm({ -- Snow check is cheapest, so comes first if name == "default:snow" then minetest.set_node(pos, {name = "default:dirt_with_snow"}) - elseif minetest.get_item_group(name, "grass") ~= 0 then - minetest.set_node(pos, {name = "default:dirt_with_grass"}) + -- The group grass is also present in dry grass, so check dry grass first elseif minetest.get_item_group(name, "dry_grass") ~= 0 then minetest.set_node(pos, {name = "default:dirt_with_dry_grass"}) + elseif minetest.get_item_group(name, "grass") ~= 0 then + minetest.set_node(pos, {name = "default:dirt_with_grass"}) end end })