1
0
Fork 0

[mcl_comparators] fix warnings

This commit is contained in:
AFCMS 2021-05-23 11:53:05 +02:00
parent 3fbcacac3b
commit 52b1473657
1 changed files with 84 additions and 84 deletions

View File

@ -217,14 +217,14 @@ if minetest.get_modpath("screwdriver") then
end end
for _, mode in pairs{"comp", "sub"} do for _, mode in pairs{"comp", "sub"} do
for _, state in pairs{mesecon.state.on, mesecon.state.off} do for _, state in pairs{mesecon.state.on, mesecon.state.off} do
local state_str = state_strs[state] local state_str = state_strs[state]
local nodename = local nodename =
"mcl_comparators:comparator_"..state_strs[state].."_"..mode "mcl_comparators:comparator_"..state_str.."_"..mode
-- Help -- Help
local longdesc, usagehelp, use_help local longdesc, usagehelp, use_help
if state_strs[state] == "off" and mode == "comp" then if state_str == "off" and mode == "comp" then
longdesc = S("Redstone comparators are multi-purpose redstone components.").."\n".. longdesc = S("Redstone comparators are multi-purpose redstone components.").."\n"..
S("They can transmit a redstone signal, detect whether a block contains any items and compare multiple signals.") S("They can transmit a redstone signal, detect whether a block contains any items and compare multiple signals.")
@ -245,9 +245,9 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
_doc_items_longdesc = longdesc, _doc_items_longdesc = longdesc,
_doc_items_usagehelp = usagehelp, _doc_items_usagehelp = usagehelp,
drawtype = "nodebox", drawtype = "nodebox",
tiles = get_tiles(state_strs[state], mode), tiles = get_tiles(state_str, mode),
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
wield_image = "mcl_comparators_off.png", --wield_image = "mcl_comparators_off.png",
walkable = true, walkable = true,
selection_box = collision_box, selection_box = collision_box,
collision_box = collision_box, collision_box = collision_box,
@ -263,7 +263,7 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
drop = 'mcl_comparators:comparator_off_comp', drop = 'mcl_comparators:comparator_off_comp',
on_construct = update_self, on_construct = update_self,
on_rightclick = on_rightclick =
make_rightclick_handler(state_strs[state], mode), make_rightclick_handler(state_str, mode),
comparator_mode = mode, comparator_mode = mode,
comparator_onstate = "mcl_comparators:comparator_on_"..mode, comparator_onstate = "mcl_comparators:comparator_on_"..mode,
comparator_offstate = "mcl_comparators:comparator_off_"..mode, comparator_offstate = "mcl_comparators:comparator_off_"..mode,
@ -287,7 +287,7 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
else else
nodedef.groups = table.copy(nodedef.groups) nodedef.groups = table.copy(nodedef.groups)
nodedef.groups.not_in_creative_inventory = 1 nodedef.groups.not_in_creative_inventory = 1
local extra_desc = {} --local extra_desc = {}
if mode == "sub" or state == mesecon.state.on then if mode == "sub" or state == mesecon.state.on then
nodedef.inventory_image = nil nodedef.inventory_image = nil
end end
@ -304,7 +304,7 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
minetest.register_node(nodename, nodedef) minetest.register_node(nodename, nodedef)
mcl_wip.register_wip_item(nodename) mcl_wip.register_wip_item(nodename)
end end
end end
-- Register recipies -- Register recipies