diff options
author | h-v-smacker <hans-von-smacker+github@gmail.com> | 2018-05-07 16:11:08 +0300 |
---|---|---|
committer | h-v-smacker <hans-von-smacker+github@gmail.com> | 2018-05-07 16:11:08 +0300 |
commit | d14339069d6cee29ad74e7d9fd50c69b6fb2b4ec (patch) | |
tree | 51a4f0f1d0cc17aa6bd76ec742137e4ebf29f037 /init.lua | |
parent | fc4a6a44ebfff75cbdf0a4b62b63d7b8b5f7eacc (diff) | |
parent | dd422b609164b338c4a68166b78a1d7d2d9e5250 (diff) |
merge upstream
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 30 |
1 files changed, 19 insertions, 11 deletions
@@ -295,61 +295,68 @@ end function bonemeal:add_deco(list)
for l = 1, #list do
-
+
for n = 1, #deco do
-- update existing entry
if list[l][1] == deco[n][1] then
-
+
-- adding grass types
for _,extra in ipairs(list[l][2]) do
+
if extra ~= "" then
+
for __,entry in ipairs(deco[n][2]) do
+
if extra == entry then
extra = false
break
end
end
end
+
if extra then
table.insert(deco[n][2], extra)
end
end
-
+
-- adding decoration types
for _,extra in ipairs(list[l][3]) do
+
if extra ~= "" then
+
for __,entry in ipairs(deco[n][3]) do
+
if extra == entry then
extra = false
break
end
end
end
+
if extra then
table.insert(deco[n][3], extra)
end
end
-
+
list[l] = false
break
end
-
end
-
+
if list[l] then
table.insert(deco, list[l])
end
-
end
end
+
-- definitively set a decration scheme
-- this function will either add a new entry as is, or replace the existing one
function bonemeal:set_deco(list)
for l = 1, #list do
-
+
for n = 1, #deco do
-- replace existing entry
@@ -360,14 +367,14 @@ function bonemeal:set_deco(list) break
end
end
-
+
if list[l] then
table.insert(deco, list[l])
end
-
end
end
+
-- global on_use function for bonemeal
function bonemeal:on_use(pos, strength, node)
@@ -455,6 +462,7 @@ minetest.register_craftitem("bonemeal:mulch", { end,
})
+
-- bonemeal (strength 2)
minetest.register_craftitem("bonemeal:bonemeal", {
description = S("Bone Meal"),
@@ -588,4 +596,4 @@ local path = minetest.get_modpath("bonemeal") dofile(path .. "/mods.lua")
dofile(path .. "/lucky_block.lua")
-print (S("[bonemeal] loaded"))
+print (S("[bonemeal] loaded"))
\ No newline at end of file |