Skip to content
Snippets Groups Projects
Commit 306c0257 authored by TenPlus1's avatar TenPlus1
Browse files

Code tweak and tidy

parent a3a39342
No related branches found
No related tags found
No related merge requests found
......@@ -170,14 +170,14 @@ local function growth(pointed_thing)
local stage = ""
-- grow registered crops
for _, row in pairs(crops) do
for n = 1, #crops do
if string.find(node.name, row[1]) then
if string.find(node.name, crops[n][1]) then
stage = tonumber( node.name:split("_")[2] )
stage = math.min(stage + math.random(1, 4), row[2])
stage = math.min(stage + math.random(1, 4), crops[n][2])
minetest.set_node(pos, {name = row[1] .. stage})
minetest.set_node(pos, {name = crops[n][1] .. stage})
return
......
......@@ -108,13 +108,13 @@ minetest.register_abm({
"group:ethereal_grass")
-- count new grass nodes
for _,p in pairs(dirts) do
for n = 1, #dirts do
num = grasses[p] or 0
num = grasses[dirts[n]] or 0
if num > curr_max then
curr_max = num
curr_type = p
curr_type = dirts[n]
end
end
......
......@@ -41,20 +41,22 @@ minetest.register_craft({
})
-- X pattern craft recipes (5x 'a' in X pattern gives 5 of 'b')
for _,items in pairs({
local cheat = {
{"default:cobble", "default:gravel"},
{"default:gravel", "default:dirt"},
{"default:dirt", "default:sand"},
{"default:ice", "default:snow"},
{"ethereal:dry_dirt", "default:desert_sand"},
}) do
local a, b = unpack(items)
}
for n = 1, #cheat do
minetest.register_craft({
output = b.." 5",
output = cheat[n][2] .. " 5",
recipe = {
{a, "", a},
{"", a, ""},
{a, "", a},
{cheat[n][1], "", cheat[n][1]},
{"", cheat[n][1], ""},
{cheat[n][1], "", cheat[n][1]},
}
})
end
......
-- Flowers spread over all types of soil
minetest.register_abm({
nodenames = {"group:flora"},
......
--[[
Minetest Ethereal Mod (17th May 2016)
Minetest Ethereal Mod (5th June 2016)
Created by ChinChow
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment