小无编辑摘要 |
小无编辑摘要 |
||
第39行: | 第39行: | ||
if args['tagpage'] == '1' or args['tagpage'] == 'y' or args['tagpage'] == 'true' then |
if args['tagpage'] == '1' or args['tagpage'] == 'y' or args['tagpage'] == 'true' then |
||
for i,v in ipairs(all['tag_ori'][objtype][id]) do |
for i,v in ipairs(all['tag_ori'][objtype][id]) do |
||
− | if string.find(v,'#') then |
+ | if string.find(v,'#') == 1 then |
table.insert(outtable, |
table.insert(outtable, |
||
--[[#blocks flowers|#flowers]] |
--[[#blocks flowers|#flowers]] |
2021年5月12日 (三) 16:01的版本
local p = {}
local all = mw.loadData('Module:Sandbox/Tag/All')
function p.main(f)
local args = f
if f == mw.getCurrentFrame() then
args = f:getParent().args
end
--'blocks','items','entity_types','fluids','game_events'
local objtype
if args[1] == 'block' or args[1] == 'blocks' then
objtype='blocks'
end
if args[1] == 'item' or args[1] == 'items' then
objtype='items'
end
if args[1] == 'entity_type' or args[1] == 'entity_types' or args[1] == 'entity'then
objtype='entity_types'
end
if args[1] == 'fluid' or args[1] == 'fluids' then
objtype='fluids'
end
if args[1] == 'game_event' or args[1] == 'game_events' then
objtype='game_events'
end
if not args[1] or args[1] == '' then
return '空标签类型'
end
local outtable = {}
local id = args[2]
if args['tagpage'] == '1' or args['tagpage'] == 'y' or args['tagpage'] == 'true' then
for i,v in ipairs(all['tag_ori'][objtype][id]) do
if string.find(v,'#') == 1 then
table.insert(outtable,
--[[#blocks flowers|#flowers]]
table.concat({
'[[#',
objtype,
' ',
string.sub(v,11),
'|#',
string.sub(v,11),
']]'
})
)
else
table.insert(outtable,string.sub(v,10))
end
end
else
for i,v in ipairs(all['ID'][objtype][id]) do
table.insert(outtable,v)
end
return table.concat(outtable,',')
end
end
return p