summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2015-11-13 15:09:00 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2015-11-13 15:09:00 +0000
commitedef04429e1c410b5ff16eab9424228d3b5fbd2b (patch)
tree916a89188d61d029613e0189a4470feeb276d8e3
parent2b73fc385b9ebc2e2dc5e79ca00657ec9e93c68c (diff)
Have dirt_with_dry_grass spread like ethereal grasses
-rw-r--r--dirt.lua17
1 files changed, 13 insertions, 4 deletions
diff --git a/dirt.lua b/dirt.lua
index a19635e..62792a5 100644
--- a/dirt.lua
+++ b/dirt.lua
@@ -94,6 +94,11 @@ minetest.register_abm({
end
})
+-- make dirt with dry grass spreads like ethereal grasses
+minetest.override_item("default:dirt_with_dry_grass", {
+ groups = {crumbly = 3, soil = 1, ethereal_grass = 1},
+})
+
-- if grass devoid of light, change to dirt
minetest.register_abm({
nodenames = {"group:ethereal_grass"},
@@ -101,11 +106,15 @@ minetest.register_abm({
chance = 20,
catch_up = false,
action = function(pos, node)
- local name = minetest.get_node({x = pos.x, y =pos.y + 1, z = pos.z}).name
+ local name = minetest.get_node({
+ x = pos.x,
+ y = pos.y + 1,
+ z = pos.z
+ }).name
local nodedef = minetest.registered_nodes[name]
- if name ~= "ignore" and nodedef
- and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light")
- and nodedef.liquidtype == "none") then
+ if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or
+ nodedef.paramtype == "light") and
+ nodedef.liquidtype == "none") then
minetest.set_node(pos, {name = "default:dirt"})
end
end