mirror of
https://github.com/mt-mods/moretrees.git
synced 2024-11-15 23:10:20 +01:00
make luacheck semi sane
This commit is contained in:
parent
b3884dd59e
commit
12bcdfe57b
35
.luacheckrc
35
.luacheckrc
|
@ -1,28 +1,25 @@
|
|||
std = "lua51+minetest"
|
||||
unused_args = false
|
||||
allow_defined_top = true
|
||||
max_line_length = 999
|
||||
max_comment_line_length = 999
|
||||
|
||||
stds.minetest = {
|
||||
read_globals = {
|
||||
"minetest",
|
||||
"vector",
|
||||
"VoxelManip",
|
||||
"VoxelArea",
|
||||
"PseudoRandom",
|
||||
"ItemStack",
|
||||
"default",
|
||||
table = {
|
||||
fields = {
|
||||
"copy",
|
||||
},
|
||||
},
|
||||
"dump",
|
||||
}
|
||||
exclude_files = {".luacheckrc"}
|
||||
|
||||
|
||||
globals = {
|
||||
"minetest",
|
||||
"vector",
|
||||
"VoxelManip",
|
||||
"VoxelArea",
|
||||
"PseudoRandom",
|
||||
"ItemStack",
|
||||
"default",
|
||||
"dump",
|
||||
"moretrees",
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
string = {fields = {"split"}},
|
||||
table = {fields = {"copy", "getn"}},
|
||||
|
||||
"biome_lib",
|
||||
"stairsplus",
|
||||
"stairs",
|
||||
|
|
2
init.lua
2
init.lua
|
@ -91,7 +91,7 @@ dofile(modpath.."/node_defs.lua")
|
|||
dofile(modpath.."/date_palm.lua")
|
||||
dofile(modpath.."/cocos_palm.lua")
|
||||
dofile(modpath.."/biome_defs.lua")
|
||||
--dofile(modpath.."/saplings.lua")
|
||||
dofile(modpath.."/saplings.lua")
|
||||
dofile(modpath.."/crafts.lua")
|
||||
|
||||
-- tree spawning setup
|
||||
|
|
|
@ -463,17 +463,29 @@ for i in ipairs(moretrees.treelist) do
|
|||
sounds = default.node_sound_defaults(),
|
||||
drop = "moretrees:"..treename.."_sapling",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
|
||||
"moretrees:" ..treename.. "_sapling_ongen",
|
||||
-- minp, maxp to be checked, relative to sapling pos
|
||||
-- minp_relative.y = 1 because sapling pos has been checked
|
||||
{x = -3, y = 1, z = -3},
|
||||
{x = 3, y = 6, z = 3},
|
||||
-- maximum interval of interior volume check
|
||||
4)
|
||||
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
|
||||
"moretrees:" ..treename.. "_sapling_ongen",
|
||||
-- minp, maxp to be checked, relative to sapling pos
|
||||
-- minp_relative.y = 1 because sapling pos has been checked
|
||||
{x = -3, y = 1, z = -3},
|
||||
{x = 3, y = 6, z = 3},
|
||||
-- maximum interval of interior volume check
|
||||
4)
|
||||
|
||||
return itemstack
|
||||
end,
|
||||
return itemstack
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
minetest.get_node_timer(pos):start(2)
|
||||
end,
|
||||
on_timer = function(pos, elapsed)
|
||||
if moretrees.can_grow(pos, treename) then
|
||||
minetest.chat_send_all("can grow")
|
||||
minetest.chat_send_all("grow_" .. treename)
|
||||
--moretrees["grow_" .. treename](pos)
|
||||
else
|
||||
minetest.get_node_timer(pos):start(300)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local fruitname = nil
|
||||
|
|
|
@ -39,7 +39,12 @@ local sand_surfaces = {
|
|||
-- too cold for a palm, too... well... sandy for anything else.
|
||||
}
|
||||
|
||||
for i in ipairs(moretrees.treelist) do
|
||||
function moretrees.can_grow(pos, treename)
|
||||
minetest.chat_send_all(treename)
|
||||
return true
|
||||
end
|
||||
|
||||
--[[ for i in ipairs(moretrees.treelist) do
|
||||
local treename = moretrees.treelist[i][1]
|
||||
local tree_model = treename.."_model"
|
||||
local tree_biome = treename.."_biome"
|
||||
|
@ -81,4 +86,4 @@ for i in ipairs(moretrees.treelist) do
|
|||
grow_nodes = surfaces,
|
||||
grow_function = grow_function,
|
||||
})
|
||||
end
|
||||
end ]]
|
||||
|
|
Loading…
Reference in New Issue
Block a user