- 致编者:请牢记我们的域名wiki.mcbe-dev.net!
- 致编者:欢迎加入本Wiki的官方交流QQ群或Discord服务器!
- 基岩版1.19.31现已发布!(了解更多)
- Inner Core现已支持Xbox模组联机!(了解更多)
- 如果您是第一次来到本Wiki,欢迎注册一个账户
- 点击顶部的“编辑”或“编辑源代码”按钮即可编辑当前页面
- 请知悉:在不登录时也可以编辑和新建页面,但是您当前的IP地址会记录在编辑历史中
Module:Development versions
来自Minecraft基岩版开发Wiki
local p = {}
p.list = function( f )
local args = f:getParent().args
local title = mw.title.getCurrentTitle().rootText
local version = args[1] or title
if not version:find('版') and not version:find('启动器') then
version = 'Java版' .. version
end
f:callParserFunction ( '#dplvar:set', 'parentVersion', version )
local categories = args.categories or '实验性快照,快照,预发布版,发布候选,测试版'
local devVersions = {}
for category in mw.text.gsplit( categories, '%s*,%s*' ) do
table.insert( devVersions,
f:callParserFunction( '#dpl:', {
category = version .. '' .. category,
format = ',|%PAGE%',
ordermethod = 'sortkey',
debug = '1'
} )
)
end
devVersions = mw.text.trim( table.concat( devVersions ), '%s|' )
local edition = version:match( '^.-版' )
local content = {}
local brokenPages = {}
for page in mw.text.gsplit( devVersions, '|' ) do
local devVersion = page
if edition then
devVersion = page:gsub( '^' .. edition, '' )
elseif version:find('启动器') then
devVersion = page:gsub( '启动器', '' )
devVersion = devVersion:gsub( "x", "''x''" )
devVersion = devVersion:gsub( "''x''''x''", "''xx''" )
end
local wikitext = mw.title.new( page ):getContent()
if wikitext:match( '<onlyinclude>' ) and wikitext:match( '</onlyinclude>' ) then
table.insert( content, '<onlyinclude>=[[' .. page .. '|' .. (devVersion:gsub('Manual:','',1)) .. ']]=</onlyinclude>' .. wikitext )
else
table.insert( brokenPages, '"[[' .. page .. ']]"' )
end
end
if #brokenPages > 0 then
error( mw.text.listToText( brokenPages ) .. '缺失<onlyinclude>', 0 )
return
end
content = table.concat( content )
:gsub( '^.-<onlyinclude>%s*', '\n' )
:gsub( '%s*</onlyinclude>.-<onlyinclude>%s*', '\n' )
:gsub( '%s*</onlyinclude>.*$', '\n' )
:gsub( '\n(=+ *[^\n]+ *=+)', '\n=%1=' )
return f:preprocess( mw.text.trim( content ) )
end
return p