- 致编者:请牢记我们的域名wiki.mcbe-dev.net!
- 致编者:欢迎加入本Wiki的官方交流QQ群或Discord服务器!
- 基岩版1.19.31现已发布!(了解更多)
- Inner Core现已支持Xbox模组联机!(了解更多)
- 如果您是第一次来到本Wiki,欢迎注册一个账户
- 点击顶部的“编辑”或“编辑源代码”按钮即可编辑当前页面
- 请知悉:在不登录时也可以编辑和新建页面,但是您当前的IP地址会记录在编辑历史中
Module:Internal version
来自Minecraft基岩版开发Wiki
local p = {}
local data = require('Module:Internal_version/Versions')
local branches = {
main = '主版本',
j = 'J版本',
demo = '演示版本',
trial = '试玩版本',
edu = '教育版',
fire = 'Fire OS',
gear = 'Gear VR',
lite = 'Lite版',
}
function p.internal_version(f)
local args = f
if f == mw.getCurrentFrame() then
args = require('Module:ProcessArgs').merge(true)
end
local version = mw.text.trim(args[1] or '')
local packages = data.info.versions[version]
local category = ''
local value = {}
if packages then
for _, group in ipairs(data.groups) do
local sum = 0
for _, _packages in pairs(packages[group.key]) do
if (not _packages.isEmpty) then
sum = sum + 1
end
end
for branch, _packages in pairs(packages[group.key]) do
if _packages[1] then
table.sort(_packages)
if (sum > 1) then
table.insert(value, "'''" .. group.name .. "'''(" .. branches[branch] .. "):")
else
table.insert(value, "'''" .. group.name .. "''':")
end
for ___, internal in ipairs(_packages) do
local packageInfo = data.info[group.key][branch][internal]
if group.key == 'android' then
local abi = packageInfo.abi
local api = packageInfo.targetSdkVersion or packageInfo.minSdkVersion
if abi and api then
table.insert(value, internal .. '(' .. abi .. ',' .. api .. ')')
else
table.insert(value, internal)
end
elseif group.key == 'ios' then
table.insert(value, internal)
end
end
end
end
end
value = table.concat(value, '<br>')
else
value = '[[模块:Internal version/Versions|—]]'
local title = mw.title.getCurrentTitle()
if not args.nocat and title.namespace == 0 and not title.isSubpage then
category = '[[Category:未知内部版本号]]'
end
end
return value .. category
end
function p.table(f)
local args = f
if f == mw.getCurrentFrame() then
args = require('Module:ProcessArgs').merge(true)
end
local html = {}
for _, group in ipairs(data.groups) do
local include = true
if #args ~= 0 then
include = false
for __, name in ipairs(args) do
if name == group.name then
include = true
break
end
end
end
if include then
table.insert(html, '===' .. group.name .. '===\n')
table.insert(html, "<table class='wikitable sortable jquery-tablesorter'>\n")
table.insert(html, '<tr>')
table.insert(html, '<th>版本</th>')
table.insert(html, '<th>分类</th>')
table.insert(html, '<th>修订版本</th>')
if group.key == 'android' then
table.insert(html, '<th>最低API级别</th>')
table.insert(html, '<th>目标API级别</th>')
table.insert(html, '<th>ABI</th>')
end
table.insert(html, '<th>内部版本号</th>')
table.insert(html, '</tr>\n')
for _, versionName in ipairs(data.info.order) do
local packages = data.info.versions[versionName]
for _, branch in ipairs(data.branches[group.key]) do
if packages[group.key][branch][1] then
local row = {}
table.insert(row, '<tr>')
table.insert(row, '<td rowspan="' .. #packages[group.key][branch] .. '">[[' .. versionName .. ']]</td>')
table.sort(packages[group.key][branch])
for index, internal in ipairs(packages[group.key][branch]) do
if index ~= 1 then
table.insert(row, '</tr>\n<tr>')
end
local packageInfo = data.info[group.key][branch][internal]
table.insert(row, '<td>' .. (branches[branch] or branch) .. '</td>')
table.insert(row, '<td>' .. packageInfo.revision .. '</td>')
if group.key == 'android' then
table.insert(row, '<td>' .. packageInfo.minSdkVersion .. '</td>')
table.insert(row, '<td>' .. packageInfo.targetSdkVersion .. '</td>')
table.insert(row, '<td>' .. packageInfo.abi .. '</td>')
table.insert(row, '<td>' .. packageInfo.versionCode .. '</td>')
elseif group.key == 'ios' then
table.insert(row, '<td>' .. packageInfo.versionID .. '</td>')
end
end
table.insert(row, '</tr>\n')
table.insert(html, table.concat(row))
end
end
end
table.insert(html, '</table>\n')
end
end
return table.concat(html)
end
return p