Add luacheck (#1)
parent
2eed378e10
commit
4ac2019e5a
|
@ -0,0 +1,11 @@
|
|||
on: [push, pull_request]
|
||||
name: Check & Release
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: lint
|
||||
uses: Roang-zero1/factorio-mod-luacheck@master
|
||||
with:
|
||||
luacheckrc_url: https://raw.githubusercontent.com/BlockySurvival/redtrees/master/.luacheckrc
|
|
@ -0,0 +1,24 @@
|
|||
unused_args = false
|
||||
allow_defined_top = true
|
||||
max_line_length = 999
|
||||
|
||||
ignore = {
|
||||
"can_grow",
|
||||
"x",
|
||||
"y",
|
||||
"z",
|
||||
}
|
||||
|
||||
globals = {
|
||||
"minetest"
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
string = {fields = {"split", "trim"}},
|
||||
table = {fields = {"copy", "getn"}},
|
||||
|
||||
"VoxelArea", "biome_lib",
|
||||
"intllib", "default", "doors",
|
||||
|
||||
"stairs", "bonemeal",
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
# redtrees
|
||||
|
||||
[![](https://github.com/BlockySurvival/redtrees/workflows/Check%20&%20Release/badge.svg)](https://github.com/BlockySurvival/redtrees/actions)
|
||||
|
||||
Originally: https://forum.minetest.net/viewtopic.php?f=11&t=13102
|
||||
|
||||
More currently: https://notabug.org/Piezo_/minetest_madman_server/src/master/redtrees
|
||||
|
|
|
@ -34,7 +34,7 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
|
|||
[minetest.get_content_id("default:grass_4")] = true,
|
||||
[minetest.get_content_id("default:grass_5")] = true,
|
||||
}
|
||||
|
||||
|
||||
--TRUNK!!! EXCITEMENT!!!
|
||||
for y_dist = 0, height - 1 do
|
||||
local vi = a:index(x, y + y_dist, z)
|
||||
|
@ -57,13 +57,13 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for _,vi in pairs({ --Add a small ring of leaves at the bottom of the canopy, for more realism.
|
||||
a:index(x + 1, y + height - (size + 1), z),
|
||||
a:index(x - 1, y + height - (size + 1), z),
|
||||
a:index(x, y + height - (size + 1), z + 1),
|
||||
a:index(x, y + height - (size + 1), z - 1)
|
||||
|
||||
|
||||
}) do
|
||||
if data[vi] == c_air or data[vi] == c_ignore or grow_over[data[vi]]then
|
||||
data[vi] = leaves_cid
|
||||
|
|
|
@ -34,7 +34,7 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
|
|||
[minetest.get_content_id("default:grass_4")] = true,
|
||||
[minetest.get_content_id("default:grass_5")] = true,
|
||||
}
|
||||
|
||||
|
||||
--TRUNK!!! EXCITEMENT!!!
|
||||
for y_dist = 0, height - 1 do
|
||||
local vi = a:index(x, y + y_dist, z)
|
||||
|
@ -57,13 +57,13 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for _,vi in pairs({ --Add a small ring of leaves at the bottom of the canopy, for more realism.
|
||||
a:index(x + 1, y + height - (size + 1), z),
|
||||
a:index(x - 1, y + height - (size + 1), z),
|
||||
a:index(x, y + height - (size + 1), z + 1),
|
||||
a:index(x, y + height - (size + 1), z - 1)
|
||||
|
||||
|
||||
}) do
|
||||
if data[vi] == c_air or data[vi] == c_ignore or grow_over[data[vi]]then
|
||||
data[vi] = leaves_cid
|
||||
|
|
Loading…
Reference in New Issue