Minecraft Wiki

除另有声明,转载时均必须注明出处若簡繁轉換出錯,請以遊戲內為準请勇于扩充与修正内容有兴趣逛逛我们的微博沟通交流,欢迎到社区专页需要协助,请在告示板留言

了解更多

Minecraft Wiki
无编辑摘要
无编辑摘要
第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的版本

使用文档请见Template:GameTag/doc

数据模块

  • data:正式版数据模块。
  • snap:快照数据模块。
  • TagType:标签类型配置模块。

数据模块可通过脚本生成(下载:不含实验性内容含实验性内容),使用方法请参阅说明文档

报错分类

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