1
0
Fork 0

fix many codestyle issues

This commit is contained in:
AFCMS 2021-04-16 13:35:03 +02:00
parent 3dd490ed6b
commit 1a58b0c510
13 changed files with 38 additions and 45 deletions

View File

@ -67,7 +67,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
local pos = pointed_thing.under local pos = pointed_thing.under
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
if minetest.registered_nodes[node.name] ~= nil then if minetest.registered_nodes[node.name] ~= nil then
local nodedef = minetest.registered_nodes[node.name] --local nodedef = minetest.registered_nodes[node.name]
if(node.name == "ignore") then if(node.name == "ignore") then
show_message(username, "error_ignore") show_message(username, "error_ignore")
elseif doc.entry_exists("nodes", node.name) then elseif doc.entry_exists("nodes", node.name) then

View File

@ -1269,7 +1269,6 @@ local function gather_descs()
if type(def._doc_items_hidden) == "boolean" then if type(def._doc_items_hidden) == "boolean" then
hidden = def._doc_items_hidden hidden = def._doc_items_hidden
end end
local custom_image
name = scrub_newlines(name) name = scrub_newlines(name)
local infotable = { local infotable = {
name = name, name = name,

View File

@ -33,7 +33,6 @@ local fmt, find, gmatch, match, sub, split, lower =
local min, max, floor, ceil = math.min, math.max, math.floor, math.ceil local min, max, floor, ceil = math.min, math.max, math.floor, math.ceil
local pairs, next, unpack = pairs, next, unpack local pairs, next, unpack = pairs, next, unpack
local vec_add, vec_mul = vector.add, vector.multiply
local DEFAULT_SIZE = 10 local DEFAULT_SIZE = 10
local MIN_LIMIT, MAX_LIMIT = 10, 12 local MIN_LIMIT, MAX_LIMIT = 10, 12
@ -1001,7 +1000,7 @@ else
end end
end) end)
local function on_use(user) --[[local function on_use(user)
local name = user:get_player_name() local name = user:get_player_name()
if next(recipe_filters) then if next(recipe_filters) then
@ -1011,7 +1010,7 @@ else
end end
show_formspec(name, "mcl_craftguide", make_formspec(name)) show_formspec(name, "mcl_craftguide", make_formspec(name))
end end]]
end end
@ -1098,7 +1097,6 @@ if progressive_mode then
local name = player:get_player_name() local name = player:get_player_name()
init_data(name) init_data(name)
local meta = player:get_meta() local meta = player:get_meta()
local name = player:get_player_name()
local data = player_data[name] local data = player_data[name]
data.inv_items = deserialize(meta:get_string("inv_items")) or {} data.inv_items = deserialize(meta:get_string("inv_items")) or {}
@ -1144,7 +1142,7 @@ else
end end
function mcl_craftguide.show(name) function mcl_craftguide.show(name)
local player = minetest.get_player_by_name(name) local player = get_player_by_name(name)
if next(recipe_filters) then if next(recipe_filters) then
local data = player_data[name] local data = player_data[name]
data.items_raw = get_filtered_items(player) data.items_raw = get_filtered_items(player)

View File

@ -62,7 +62,6 @@ end)
-- nodes which have flower placement rules -- nodes which have flower placement rules
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
local datastring = ""
if def.groups.place_flowerlike == 1 then if def.groups.place_flowerlike == 1 then
return S("This plant can only grow on grass blocks and dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher.") return S("This plant can only grow on grass blocks and dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher.")
elseif def.groups.place_flowerlike == 2 then elseif def.groups.place_flowerlike == 2 then
@ -130,7 +129,7 @@ end)
-- Armor -- Armor
doc.sub.items.register_factoid(nil, "use", function(itemstring, def) doc.sub.items.register_factoid(nil, "use", function(itemstring, def)
local def = minetest.registered_items[itemstring] --local def = minetest.registered_items[itemstring]
local s = "" local s = ""
local head = minetest.get_item_group(itemstring, "armor_head") local head = minetest.get_item_group(itemstring, "armor_head")
local torso = minetest.get_item_group(itemstring, "armor_torso") local torso = minetest.get_item_group(itemstring, "armor_torso")
@ -173,7 +172,6 @@ end)
doc.sub.items.register_factoid(nil, "groups", function(itemstring, def) doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
if def._repair_material then if def._repair_material then
local mdef = minetest.registered_items[def._repair_material] local mdef = minetest.registered_items[def._repair_material]
local desc
if mdef and mdef.description and mdef.description ~= "" then if mdef and mdef.description and mdef.description ~= "" then
return S("This item can be repaired at an anvil with: @1.", mdef.description) return S("This item can be repaired at an anvil with: @1.", mdef.description)
elseif def._repair_material == "group:wood" then elseif def._repair_material == "group:wood" then

View File

@ -233,7 +233,7 @@ if minetest.get_modpath("mcl_farming") then
local wear = mcl_autogroup.get_wear(toolname, "shearsy") local wear = mcl_autogroup.get_wear(toolname, "shearsy")
itemstack:add_wear(wear) itemstack:add_wear(wear)
end end
minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above}, true) minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = pointed_thing.above}, true)
local dir = vector.subtract(pointed_thing.under, pointed_thing.above) local dir = vector.subtract(pointed_thing.under, pointed_thing.above)
local param2 = minetest.dir_to_facedir(dir) local param2 = minetest.dir_to_facedir(dir)
minetest.swap_node(pointed_thing.under, {name="mcl_farming:pumpkin_face", param2 = param2}) minetest.swap_node(pointed_thing.under, {name="mcl_farming:pumpkin_face", param2 = param2})

View File

@ -157,7 +157,6 @@ screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses)
if should_rotate and new_param2 ~= node.param2 then if should_rotate and new_param2 ~= node.param2 then
node.param2 = new_param2 node.param2 = new_param2
minetest.swap_node(pos, node) minetest.swap_node(pos, node)
minetest.check_for_falling(pos) minetest.check_for_falling(pos)
if ndef.after_rotate then if ndef.after_rotate then
ndef.after_rotate(vector.new(pos)) ndef.after_rotate(vector.new(pos))

View File

@ -142,7 +142,7 @@ function xpanes.register_pane(name, def)
tiles = {def.textures[3], def.textures[2], def.textures[1]}, tiles = {def.textures[3], def.textures[2], def.textures[1]},
use_texture_alpha = def.use_texture_alpha, use_texture_alpha = def.use_texture_alpha,
groups = groups, groups = groups,
drop = "xpanes:" .. name .. "_flat", drop = drop,
sounds = def.sounds, sounds = def.sounds,
node_box = { node_box = {
type = "connected", type = "connected",
@ -153,7 +153,6 @@ function xpanes.register_pane(name, def)
connect_right = {{1/32, -1/2, -1/32, 1/2, 1/2, 1/32}}, connect_right = {{1/32, -1/2, -1/32, 1/2, 1/2, 1/32}},
}, },
connects_to = {"group:pane", "group:stone", "group:glass", "group:wood", "group:tree"}, connects_to = {"group:pane", "group:stone", "group:glass", "group:wood", "group:tree"},
drop = drop,
_mcl_blast_resistance = def._mcl_blast_resistance, _mcl_blast_resistance = def._mcl_blast_resistance,
_mcl_hardness = def._mcl_hardness, _mcl_hardness = def._mcl_hardness,
_mcl_silk_touch_drop = def._mcl_silk_touch_drop and {"xpanes:" .. name .. "_flat"}, _mcl_silk_touch_drop = def._mcl_silk_touch_drop and {"xpanes:" .. name .. "_flat"},

View File

@ -3973,7 +3973,7 @@ if mg_name ~= "singlenode" then
if deco_id_chorus_plant then if deco_id_chorus_plant then
mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed) mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object("gennotify") local gennotify = minetest.get_mapgen_object("gennotify")
local poslist = {} --local poslist = {}
for _, pos in ipairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do for _, pos in ipairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do
local realpos = { x = pos.x, y = pos.y + 1, z = pos.z } local realpos = { x = pos.x, y = pos.y + 1, z = pos.z }
mcl_end.grow_chorus_plant(realpos) mcl_end.grow_chorus_plant(realpos)

View File

@ -85,7 +85,7 @@ if mg_name ~= "singlenode" then
if blockseed % 77 ~= 17 then return end if blockseed % 77 ~= 17 then return end
-- needed for manual and automated settlement building -- needed for manual and automated settlement building
-- don't build settlements on (too) uneven terrain -- don't build settlements on (too) uneven terrain
local heightmap = minetest.get_mapgen_object("heightmap") --local heightmap = minetest.get_mapgen_object("heightmap")
local height_difference = settlements.evaluate_heightmap() local height_difference = settlements.evaluate_heightmap()
if height_difference > max_height_difference then return end if height_difference > max_height_difference then return end

View File

@ -126,7 +126,7 @@ function settlements.fill_chest(pos, pr)
-- fill chest -- fill chest
local inv = minetest.get_inventory( {type="node", pos=pos} ) local inv = minetest.get_inventory( {type="node", pos=pos} )
local function get_treasures(pr) local function get_treasures(prand)
local loottable = {{ local loottable = {{
stacks_min = 3, stacks_min = 3,
stacks_max = 8, stacks_max = 8,
@ -150,7 +150,7 @@ function settlements.fill_chest(pos, pr)
{ itemstring = "mobs_mc:diamond_horse_armor", weight = 1 }, { itemstring = "mobs_mc:diamond_horse_armor", weight = 1 },
} }
}} }}
local items = mcl_loot.get_multi_loot(loottable, pr) local items = mcl_loot.get_multi_loot(loottable, prand)
return items return items
end end