Template:Crafting table: Difference between revisions

From BTA-Mirror
imported>Ttv pedro270707
mNo edit summary
imported>Ttv pedro270707
mNo edit summary
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:crafting-table-index|{{#expr:{{#var:crafting-table-index|0}}+1}}}}{{#vardefine:type|{{{type|{{#var:type|workbench}}}}}}}<!--
<includeonly>{{#vardefine:crafting-table-index|{{#expr:{{#var:crafting-table-index|0}}+1}}}}{{#vardefine:type|{{{type|{{#var:type|workbench}}}}}}}<!--


-->{{#ifeq: {{#var:crafting-table|}} | y | | {{#vardefine:crafting-table|y}}<table class="wikitable sortable">
-->{{#ifeq: {{#var:crafting-table|}} | y | | {{#vardefine:crafting-table|y}}<table class="wikitable sortable mw-collapsible">
<tr>{{#ifeq: {{bl|{{{name|}}}|string=y}} | n | {{#vardefine:name|n}} | <th>Name</th>{{#vardefine:name|y}}}}{{#ifeq: {{bl|{{{ingredients|}}}|string=y}} | n | {{#vardefine:ingredients|n}} | <th>Ingredients</th>{{#vardefine:ingredients|y}}}}<th class="unsortable">Crafting recipe</th>{{#ifeq: {{bl|{{{showdescription|}}}}} | y | <th class="unsortable">Description</th>{{#vardefine:showdescription|y}}}}</tr>}}
<tr>{{#ifeq: {{bl|{{{name|y}}}|string=y}} | n | {{#vardefine:name|n}} | <th>Name</th>{{#vardefine:name|y}}}}{{#ifeq: {{bl|{{{ingredients|}}}|string=y}} | n | {{#vardefine:ingredients|n}} | <th>Ingredients</th>{{#vardefine:ingredients|y}}}}<th class="unsortable">Crafting recipe</th>{{#ifeq: {{bl|{{{description|}}}|string=y}} | n | | {{#if: {{{description|}}} | <th class="unsortable">Description</th>{{#vardefine:showdescription|y}}}}</tr>}} }}<!--


<tr>{{#ifeq: {{#var:name|}} | n | |
-->{{#vardefine:name-str|{{bl|{{{name|y}}}|string=y}}}}<!--
<th>'''{{#ifexist: {{{RESULT|}}} | {{#ifeq: {{{RESULT|}}} | {{FULLPAGENAME}} | {{{RESULT|}}} | [[{{{RESULT|}}}]]}} | {{{RESULT|}}} }}'''</th>
}}


{{#ifeq: {{#var:ingredients|}} | n | |  
--><tr>{{#ifeq: {{#var:name|}} | n | |
<td>{{#switch: {{#var:type|workbench}}
{{#if: {{{RESULT|}}}
| workbench = {{#fornumargs: argnum | argval |
| <th>'''{{#ifeq: {{#var:name-str|}} | y |  
      {{#ifeq: {{#var:item-{{#var:argval}}-{{#var:crafting-table-index|0}}|}} | y | | {{#ifeq: {{#var:first-ingredient|}} | y | &nbsp;+<br> | {{#vardefine:first-ingredient|y}} }}'''{{#ifexist: {{#var:argval}} | {{#ifeq: {{#var:argval}} | {{FULLPAGENAME}} | {{#var:argval}} | [[{{#var:argval}}]]}} | {{#var:argval}} }}'''{{#vardefine:item-{{#var:argval}}-{{#var:crafting-table-index|0}}|y}} }}
{{#vardefine:item|{{#arraydefine:item|{{{RESULT|}}}|,}}{{#arrayindex:item|0}}}}
{{Crafting table/Process item link|{{#var:item}}}}
{{#vardefine:item|}}
| {{#var:name-str|}}
}}'''</th> <!-- If name is not a boolean, it displays the text in the name parameter instead -->
| <th>''Nothing''</th>
}}
}}
| furnace | blast-furnace = '''{{#ifexist: {{{input|}}} | {{#ifeq: {{{input|}}} | {{FULLPAGENAME}} | {{{input|}}} | [[{{{input|}}}]]}} | {{{input|}}} }}
}}<!--
}}</td>
 
}}<td style="padding: 0; display: flex; justify-content: center; border: none;">{{#switch: {{#var:type|workbench}}
-->{{#ifeq: {{#var:ingredients|}} | n | |
{{#ifeq: {{bl|{{{ingredients|y}}}|string=y}} | y
| <td>{{#ifeq: {{#fornumargs: argnum | argval | {{#var:argval|}}}}{{{input|}}} | | ''Nothing''
| {{#switch: {{#var:type|workbench}}
| workbench | inventory = {{#fornumargs: argnum | argval |
{{#arraydefine:items|{{#var:argval}}|;}}
{{#vardefine:items-length|{{#expr: 0{{#arrayprint:items||@@@@|
{{#vardefine:item|{{#arraydefine:item|@@@@|,}}{{#arrayindex:item|0}}}}
{{#ifeq: {{#var:item-{{#var:item}}-{{#var:crafting-table-index|0}}}} | y | | +1}}
}}
}}
}}<!--
 
--> {{#ifeq: {{#var:first-ingredients|}} | y |
{{#ifeq: {{#var:items-length|0}} | 0 | | &nbsp;+<br> }}
| {{#vardefine:first-ingredients|y}}
}}<!--
--> {{#vardefine:first-table-item|y}}<!--
--> {{#arrayprint:items||@@@@|<!--
--> {{#vardefine:item|{{#arraydefine:item|@@@@|,}}{{#arrayindex:item|0}}}}<!--
 
--> {{#ifeq: {{#var:item-{{#var:item}}-{{#var:crafting-table-index|0}}}} | y |
| {{#if: {{#var:first-table-item|}} | {{#vardefine:first-table-item|}} | &nbsp;or<br>}}
'''{{Crafting table/Process item link|{{#var:item}}}}'''
{{#vardefine:item-{{#var:item}}-{{#var:crafting-table-index|0}}|y}}
}}{{#vardefine:item|}}{{#arrayreset:item}}}}{{#vardefine:items-length|}}
}}
| furnace | blast-furnace =
{{#vardefine:item|{{#arraydefine:item|{{{input|}}}|,}}{{#arrayindex:item|0}}}}<!--
--> '''{{Crafting table/Process item link|{{#var:item}}}}'''<!--
--> {{#vardefine:item|}}
}}
}}</td>
| <td>{{{ingredients|}}}</td><!--
--> }}
}}<td style="padding: 0; text-align: center;">{{#switch: {{#var:type|workbench}}
| workbench = {{Crafting|1={{{1|}}}|2={{{2|}}}|3={{{3|}}}|4={{{4|}}}|5={{{5|}}}|6={{{6|}}}|7={{{7|}}}|8={{{8|}}}|9={{{9|}}}|RESULT={{{RESULT|}}}|shapeless={{{shapeless|}}}}}
| workbench = {{Crafting|1={{{1|}}}|2={{{2|}}}|3={{{3|}}}|4={{{4|}}}|5={{{5|}}}|6={{{6|}}}|7={{{7|}}}|8={{{8|}}}|9={{{9|}}}|RESULT={{{RESULT|}}}|shapeless={{{shapeless|}}}}}
| furnace = {{Crafting/Furnace|input={{{input|}}}|fuel={{{fuel|}}}|RESULT={{{RESULT|}}}|blast furnace=n}}
| furnace = {{Crafting/Furnace|input={{{input|}}}|fuel={{{fuel|}}}|RESULT={{{RESULT|}}}|blast furnace=n}}
| blast-furnace = {{Crafting/Furnace|input={{{input|}}}|fuel={{{fuel|}}}|RESULT={{{RESULT|}}}|blast furnace=y}}
| blast-furnace = {{Crafting/Furnace|input={{{input|}}}|fuel={{{fuel|}}}|RESULT={{{RESULT|}}}|blast furnace=y}}
}}</td>
| inventory= {{Crafting/Inventory|1={{{1|}}}|2={{{2|}}}|3={{{3|}}}|4={{{4|}}}|RESULT={{{RESULT|}}}|shapeless={{{shapeless|}}}}}
 
}}</td><!--
{{#ifeq: {{#var:showdescription|}} | y | <td>{{{description|}}}</td> | }}


</tr>
-->{{#ifeq: {{#var:showdescription|}} | y | {{#ifeq: {{bl|{{{description|}}}}} | y | <td></td> | <td>{{{description|}}}</td> }} | }}<!--
{{#vardefine:first-ingredient|}}{{#ifeq: {{bl|{{{foot|}}}}} | y | </table>{{#vardefine:crafting-table|}}{{#vardefine:name|}}{{#vardefine:ingredients|}}{{#vardefine:showdescription|}} | }}</includeonly><noinclude>
{{Crafting table
|type=workbench
|1=Steel Ingot
|2=Steel Ingot
|3=Steel Ingot
|4=Iron Ingot
|5=Iron Ingot
|6=Iron Ingot
|7=Iron Ingot
|8=Iron Ingot
|9=Iron Ingot
|RESULT=Block of Iron
|showdescription=y
|description=Description!
|name=n
}}
{{Crafting table
|type=workbench
|1=Steel Ingot
|2=Steel Ingot
|3=Steel Ingot
|4=Iron Ingot
|5=Iron Ingot
|6=Iron Ingot
|7=Iron Ingot
|8=Iron Ingot
|9=Iron Ingot
|RESULT=Block of Iron
|name=y
|foot=y
}}


{{Crafting table
--></tr>
|type=blast-furnace
{{#vardefine:first-ingredients|}}{{#ifeq: {{bl|{{{foot|}}}}} | y | </table>{{#vardefine:crafting-table|}}{{#vardefine:name|}}{{#vardefine:ingredients|}}{{#vardefine:showdescription|}} | }}</includeonly><noinclude>
|input=Iron Ingot
{{Documentation}}
|fuel=Iron Ingot
<!-- Put categories on the documentation page -->
|RESULT=Block of Iron
}}
{{Crafting table
|input=Iron Ingot
|fuel=Iron Ingot
|RESULT=Block of Iron
|foot=y
}}
</noinclude>
</noinclude>

Latest revision as of 19:37, 31 March 2023

[view | edit | history | purge]Documentation

This template generates a {{Crafting}} table. Each row contains an item's recipe.

Arguments[edit source]

Argument Default value Note
type workbench Sets the recipe's type. Valid values are workbench, inventory, furnace and blast-furnace.
1 Nothing The first slot from left to right, top to bottom. Only works if type is set to either workbench or inventory.
2 Nothing The second slot from left to right, top to bottom. Only works if type is set to either workbench or inventory.
3 Nothing The third slot from left to right, top to bottom. Only works if type is set to either workbench or inventory.
4 Nothing The fourth slot from left to right, top to bottom. Only works if type is set to either workbench or inventory.
5 Nothing The fifth slot from left to right, top to bottom. Only works if type is set to workbench.
6 Nothing The sixth slot from left to right, top to bottom. Only works if type is set to workbench.
7 Nothing The seventh slot from left to right, top to bottom. Only works if type is set to workbench.
8 Nothing The eighth slot from left to right, top to bottom. Only works if type is set to workbench.
9 Nothing The ninth slot from left to right, top to bottom. Only works if type is set to workbench.
shapeless n Defines if the recipe is shapeless. Note that this means that any arrangement of the items works, not that a specific arrangement can go anywhere in the crafting grid. Only works if type is set to either workbench or inventory.
input Nothing The input slot. Only works if type is set to either furnace or blast-furnace.
fuel Default fuel items The fuel slot. Only works if type is set to either furnace or blast-furnace. Its default value will be based on the type of furnace.
RESULT Nothing The result of the crafting recipe.
name y Defines if the name of the result will be shown. Can either be set to a boolean (y or n) or to a value to be displayed.
ingredients y Defines if the ingredients used in the recipe will be shown. Can either be set to a boolean (y or n) or to a value to be displayed.
foot n Should be set to y at the last row of the table.

Usage[edit source]

Code Output
{{Crafting table|1=Block of Diamond|RESULT=Diamond,9|foot=y}}
NameIngredientsCrafting recipe
DiamondBlock of Diamond
9
{{Crafting table|type=inventory|1=Block of Diamond|RESULT=Diamond,9|foot=y}}
NameIngredientsCrafting recipe
DiamondBlock of Diamond
9
{{Crafting table|type=furnace|input=Stone Diamond Ore|RESULT=Diamond|foot=y}}
NameIngredientsCrafting recipe
DiamondStone Diamond Ore
{{Crafting table|type=blast-furnace|input=Iron Ingot|RESULT=Crude Steel|foot=y}}
NameIngredientsCrafting recipe
Crude SteelIron Ingot

{{Crafting table
|type=workbench
|1=String
|2=Cloth
|3=Cloth
|4=String
|5=Leather
|6=Leather
|8=Leather
|9=Leather
|RESULT=Empty Quiver
|foot=y
}}

NameIngredientsCrafting recipe
Empty QuiverString +
Cloth +
Leather

{{Crafting table
|type=blast-furnace
|input=Iron Ingot
|RESULT=Crude Steel
}}
{{Crafting table
|type=furnace
|input=Stone Coal Ore
|RESULT=Coal
|foot=y
}}

NameIngredientsCrafting recipe
Crude SteelIron Ingot
CoalStone Coal Ore
[view | edit | history | purge]The above documentation is transcluded from Template:Crafting table/doc.