Template:Crafting
此模板使用了模組:Crafting,此腳本使用Lua編寫。
更多詳情,請參閱維基百科:Lua和MediaWiki:擴展:Scribunto。
使用這個模板,你可以建立像「合成」和「合成部分」文章裡的方塊和物品的合成配方。簡單一點的可以使用{{Crafting Table}}
,除非它是你建立的表格。
預設的,表格將生成3列:名稱、材料和含有{{Crafting Table}}
的主列。你可以在表的第一個模板設定{{{showname}}}
參數為1
或0
來顯示或隱藏名稱列。為了在一張表裡顯示多個合成配方,你需要在表的第一個模板裡設定{{{head}}}
為1
,並且要在最後一個模板裡設定{{{foot}}}
為1
。
簡單的為配方的表格位置留下所有材料就可以顯示一個無形配方了。如果配方是無形的,並且使用少於5格,模板將會自動將物品排列到左下角,表示這個配方可以在物品欄區域中使用。
使用示例:
{{Crafting |head=1 |B2=Coal |B3=Stick |Output=Torch,4 }} {{Crafting |Blaze Powder |Gunpowder |Coal |Output=Fire Charge,3 }} {{Crafting |A1= Coal |B1= Coal |C1= Coal |A2= Coal |B2= Coal |C2= Coal |A3= Coal |B3= Coal |C3= Coal |Output=Block of Coal |upcoming=1.6 }} {{Crafting |name=[[镐]] |ingredients=[[木棍]]+<br />任意[[木板]]或<br />[[圆石]]或<br />[[铁锭]]或<br />[[金锭]]或<br />[[钻石]] |A1={Any Planks}; Cobblestone; Iron Ingot; Gold Ingot; Diamond |B1={Any Planks}; Cobblestone; Iron Ingot; Gold Ingot; Diamond |C1={Any Planks}; Cobblestone; Iron Ingot; Gold Ingot; Diamond |B2=Stick |B3=Stick |Output=Wooden Pickaxe; Stone Pickaxe; Iron Pickaxe; Golden Pickaxe; Diamond Pickaxe |foot=1 }}
產生:
名稱 | 材料 | 合成配方 |
---|---|---|
火把 | 煤炭 + 木棒 |
|
火焰彈 | 烈焰粉 + 火藥 + 煤炭 |
|
煤炭方塊 (1.6) |
煤炭 | |
鎬 | 木棒+ 任意木材或 鵝卵石或 鐵錠或 金錠或 鑽石 |