1
0
mirror of https://github.com/mt-mods/plantlife_modpack.git synced 2025-07-18 15:50:32 +02:00

[dryplants] Tidy code

This commit is contained in:
2020-07-23 22:45:28 +02:00
parent f661500cb3
commit d7b543f5d7
5 changed files with 22 additions and 16 deletions

View File

@ -7,12 +7,13 @@
-- Looked at code from: default
-----------------------------------------------------------------------------------------------
local random = math.random
abstract_dryplants.grow_grass = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local grass_size = math.random(1,5)
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then
minetest.swap_node(right_here, {name="default:grass_"..grass_size})
minetest.swap_node(right_here, {name="default:grass_"..random(1,5)})
end
end