diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2018-05-21 16:34:46 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2018-05-21 16:34:46 +0100 |
commit | 8702aff2396dbdc9af2eaf73d7e57f9c51b36b1b (patch) | |
tree | dadc8b8f115e7700ead767316785ca6331790ea8 /dirt.lua | |
parent | d9de5c5d9081ba998edd02afed61c21cdafefaac (diff) |
replace 'ethereal:green_dirt' with 'default:dirt_with_grass'
Diffstat (limited to 'dirt.lua')
-rw-r--r-- | dirt.lua | 42 |
1 files changed, 7 insertions, 35 deletions
@@ -4,26 +4,6 @@ local S = ethereal.intllib -- override default dirt (to stop caves cutting away dirt) minetest.override_item("default:dirt", {is_ground_content = ethereal.cavedirt}) ---[[ green dirt -minetest.register_node("ethereal:green_dirt", { - description = S("Green Dirt"), - tiles = { - "default_grass.png", - "default_dirt.png", - "default_dirt.png^default_grass_side.png" - }, - is_ground_content = ethereal.cavedirt, - groups = {crumbly = 3, soil = 1, ethereal_grass = 1}, - soil = { - base = "ethereal:green_dirt", - dry = "farming:soil", - wet = "farming:soil_wet" - }, - drop = "default:dirt", - sounds = default.node_sound_dirt_defaults({ - footstep = {name = "default_grass_footstep", gain = 0.25}, - }), -})]] minetest.register_alias("ethereal:green_dirt", "default:dirt_with_grass") -- dry dirt @@ -80,7 +60,7 @@ dirts = { "ethereal:bamboo_dirt", "ethereal:jungle_dirt", "ethereal:grove_dirt", "ethereal:prairie_dirt", "ethereal:cold_dirt", "ethereal:crystal_dirt", "ethereal:mushroom_dirt", "ethereal:fiery_dirt", "ethereal:gray_dirt", - "default:dirt_with_grass", "default:dirt_with_dry_grass", "ethereal:green_dirt", + "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:dirt_with_snow", "default:dirt_with_dry_grass", "default:dirt_with_rainforest_litter" } @@ -88,17 +68,17 @@ dirts = { -- check surrounding grass and change dirt to same colour local grass_spread = function(pos, node) - -- not enough light local above = {x = pos.x, y = pos.y + 1, z = pos.z} + -- not enough light if (minetest.get_node_light(above) or 0) < 13 then return end - -- water above grass local name = minetest.get_node(above).name local def = minetest.registered_nodes[name] + -- water above grass if name == "ignore" or not def or def.liquidtype ~= "none" then return end @@ -108,10 +88,7 @@ local grass_spread = function(pos, node) -- find all default and ethereal grasses in area around dirt local positions, grasses = minetest.find_nodes_in_area( {x = pos.x - 1, y = pos.y - 2, z = pos.z - 1}, - {x = pos.x + 1, y = pos.y + 2, z = pos.z + 1}, --- {"group:ethereal_grass", "default:dirt_with_grass", --- "default:dirt_with_dry_grass", "default:dirt_with_snow"}) - dirts) + {x = pos.x + 1, y = pos.y + 2, z = pos.z + 1}, dirts) -- count new grass nodes for n = 1, #dirts do @@ -129,11 +106,6 @@ local grass_spread = function(pos, node) return end - -- change default green grass to ethereal green grass - if curr_type == "default:dirt_with_grass" then - curr_type = "ethereal:green_dirt" - end - minetest.swap_node(pos, {name = curr_type}) end @@ -296,18 +268,18 @@ for _, ab in pairs(minetest.registered_abms) do local node2 = ab.nodenames and ab.nodenames[2] or "" local neigh = ab.neighbors and ab.neighbors[1] or "" - -- find dirt to grass abm and replace with spread function + -- find 'dirt to grass abm' and replace with spread function if label == "Grass spread" or (node1 == "default:dirt" and neigh == "default:dirt_with_grass") then --ab.interval = 2 --ab.chance = 1 - ab.nodenames = {"default:dirt_with_grass", "default:dirt"} + ab.nodenames = {"default:dirt"} ab.neighbors = {"air"} ab.action = grass_spread - -- find grass devoid of light to dirt abm and change to devoid function + -- find 'grass devoid of light to dirt' abm and change to devoid function elseif label == "Grass covered" or (node1 == "default:dirt_with_grass" and node2 == "default:dirt_with_dry_grass") then |