mirror of
https://github.com/minetest-mods/moreores.git
synced 2024-12-29 11:40:21 +01:00
Add a Luacheck configuration file and tweak code style
This commit is contained in:
parent
fe7d656235
commit
876630c70d
30
.luacheckrc
Normal file
30
.luacheckrc
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
std = "lua51+minetest"
|
||||||
|
unused_args = false
|
||||||
|
allow_defined_top = true
|
||||||
|
max_line_length = 90
|
||||||
|
|
||||||
|
stds.minetest = {
|
||||||
|
read_globals = {
|
||||||
|
"DIR_DELIM",
|
||||||
|
"minetest",
|
||||||
|
"core",
|
||||||
|
"dump",
|
||||||
|
"vector",
|
||||||
|
"nodeupdate",
|
||||||
|
"VoxelManip",
|
||||||
|
"VoxelArea",
|
||||||
|
"PseudoRandom",
|
||||||
|
"ItemStack",
|
||||||
|
"default",
|
||||||
|
table = {
|
||||||
|
fields = {
|
||||||
|
"copy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
read_globals = {
|
||||||
|
"intllib",
|
||||||
|
"mg",
|
||||||
|
}
|
23
init.lua
23
init.lua
@ -88,7 +88,11 @@ local function get_recipe(c, name)
|
|||||||
return {{c, c, c}, {c, c, c}, {c, c, c}}
|
return {{c, c, c}, {c, c, c}, {c, c, c}}
|
||||||
end
|
end
|
||||||
if name == "lockedchest" then
|
if name == "lockedchest" then
|
||||||
return {{"group:wood", "group:wood", "group:wood"}, {"group:wood", c, "group:wood"}, {"group:wood", "group:wood", "group:wood"}}
|
return {
|
||||||
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
|
{"group:wood", c, "group:wood"},
|
||||||
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -100,7 +104,6 @@ local function add_ore(modname, description, mineral_name, oredef)
|
|||||||
local item_base = tool_base .. mineral_name
|
local item_base = tool_base .. mineral_name
|
||||||
local ingot = item_base .. "_ingot"
|
local ingot = item_base .. "_ingot"
|
||||||
local lump_item = item_base .. "_lump"
|
local lump_item = item_base .. "_lump"
|
||||||
local ingotcraft = ingot
|
|
||||||
|
|
||||||
if oredef.makes.ore then
|
if oredef.makes.ore then
|
||||||
minetest.register_node(modname .. ":mineral_" .. mineral_name, {
|
minetest.register_node(modname .. ":mineral_" .. mineral_name, {
|
||||||
@ -242,7 +245,8 @@ local oredefs = {
|
|||||||
silver = {
|
silver = {
|
||||||
description = "Silver",
|
description = "Silver",
|
||||||
makes = {ore = true, block = true, lump = true, ingot = true, chest = true},
|
makes = {ore = true, block = true, lump = true, ingot = true, chest = true},
|
||||||
oredef = {clust_scarcity = moreores.silver_chunk_size * moreores.silver_chunk_size * moreores.silver_chunk_size,
|
oredef = {
|
||||||
|
clust_scarcity = moreores.silver_chunk_size ^ 3,
|
||||||
clust_num_ores = moreores.silver_ore_per_chunk,
|
clust_num_ores = moreores.silver_ore_per_chunk,
|
||||||
clust_size = moreores.silver_chunk_size,
|
clust_size = moreores.silver_chunk_size,
|
||||||
y_min = moreores.silver_min_depth,
|
y_min = moreores.silver_min_depth,
|
||||||
@ -274,7 +278,8 @@ local oredefs = {
|
|||||||
mithril = {
|
mithril = {
|
||||||
description = "Mithril",
|
description = "Mithril",
|
||||||
makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
|
makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
|
||||||
oredef = {clust_scarcity = moreores.mithril_chunk_size * moreores.mithril_chunk_size * moreores.mithril_chunk_size,
|
oredef = {
|
||||||
|
clust_scarcity = moreores.mithril_chunk_size ^ 3,
|
||||||
clust_num_ores = moreores.mithril_ore_per_chunk,
|
clust_num_ores = moreores.mithril_ore_per_chunk,
|
||||||
clust_size = moreores.mithril_chunk_size,
|
clust_size = moreores.mithril_chunk_size,
|
||||||
y_min = moreores.mithril_min_depth,
|
y_min = moreores.mithril_min_depth,
|
||||||
@ -309,7 +314,8 @@ if not default_tin then
|
|||||||
oredefs.tin = {
|
oredefs.tin = {
|
||||||
description = "Tin",
|
description = "Tin",
|
||||||
makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
|
makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
|
||||||
oredef = {clust_scarcity = moreores.tin_chunk_size * moreores.tin_chunk_size * moreores.tin_chunk_size,
|
oredef = {
|
||||||
|
clust_scarcity = moreores.tin_chunk_size ^ 3,
|
||||||
clust_num_ores = moreores.tin_ore_per_chunk,
|
clust_num_ores = moreores.tin_ore_per_chunk,
|
||||||
clust_size = moreores.tin_chunk_size,
|
clust_size = moreores.tin_chunk_size,
|
||||||
y_min = moreores.tin_min_depth,
|
y_min = moreores.tin_min_depth,
|
||||||
@ -355,7 +361,12 @@ end
|
|||||||
minetest.register_node("moreores:copper_rail", {
|
minetest.register_node("moreores:copper_rail", {
|
||||||
description = S("Copper Rail"),
|
description = S("Copper Rail"),
|
||||||
drawtype = "raillike",
|
drawtype = "raillike",
|
||||||
tiles = {"moreores_copper_rail.png", "moreores_copper_rail_curved.png", "moreores_copper_rail_t_junction.png", "moreores_copper_rail_crossing.png"},
|
tiles = {
|
||||||
|
"moreores_copper_rail.png",
|
||||||
|
"moreores_copper_rail_curved.png",
|
||||||
|
"moreores_copper_rail_t_junction.png",
|
||||||
|
"moreores_copper_rail_crossing.png",
|
||||||
|
},
|
||||||
inventory_image = "moreores_copper_rail.png",
|
inventory_image = "moreores_copper_rail.png",
|
||||||
wield_image = "moreores_copper_rail.png",
|
wield_image = "moreores_copper_rail.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
|
Loading…
Reference in New Issue
Block a user