Template:Infobox block: Difference between revisions

No edit summary
No edit summary
 
(354 intermediate revisions by 66 users not shown)
Line 1: Line 1:
<table class="infobox" cellpadding="4" style="width: 22em;  font-size: 90%; float:right; border: 1px solid #AAAAAA;  margin-left:0.5em">
{{#invoke:infobox|infobox
<tr>
| invimage = title
  <td align="center"  colspan=2 bgcolor="#CCCCCC" style="font-size:120%; font-weight: bold;">{{{name|{{BASEPAGENAME}}}}}</td>
| rows =
</tr>
{{#if: {{{rarity|}}} | {{infobox row|class=list-style-none|label=[[minecraft:Rarity|Rarity color]]|field={{ucfirst:{{{rarity|}}}}} }} | }}
<tr valign="top">
{{#if: {{{renewable|}}} | {{infobox row|label=[[minecraft:Renewable resource|Renewable]]|field={{{renewable}}} }} }}
  <td align="center" colspan="2">[[File:{{{image|No block image.png}}}|150px|center]]</td>
{{#if: {{{stackable|}}} | {{infobox row|label=Stackable|field={{{stackable}}} {{#if: {{{maxStack|}}} | &nbsp;({{{maxStack}}}) }} }} |<!-- {{{stackable}}} not provided => --->{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing stackability}}}} }}
</tr>
{{infobox row|label=Tool{{ #if: {{{tool2|}}} | s }}|class=pixel-image|field={{{tool|}}}{{
{{#if:{{{image2|}}}|<tr valign="top"><td align="center" colspan="2">[[File:{{{image2}}}|150px|center]]</td></tr>}}
  #if: {{{tool2|}}} | {{{tool2|}}}
{{#if:{{{invimage|}}}|<tr valign="top"><td align="center" colspan="2">[[File:{{{invimage}}}|36px|center]]</td></tr>}}
}}{{
{{#if:{{{invimage2|}}}|<tr valign="top"><td align="center" colspan="2">[[File:{{{invimage2}}}|36px|center]]</td></tr>}}
  #if: {{{tool3|}}} | {{{tool3|}}}
{{Block/row2|label=Type|field={{{type|?}}}}}
}} }}
{{Block/row|label=Requirements|field={{#switch:{{lc:{{{dirt}}}}}|yes=Sunlight and dirt|no=None|sand=Sunlight and sand|#default={{{dirt|?}}}}}}}
{{infobox row|label=[[minecraft:Explosion#Blast resistance|Blast resistance]]|field={{ #if: {{{tntres|}}}
{{Block/row2|label=Physics|field={{{gravity|?}}}}}
| {{{tntres}}}{{#if: {{NAMESPACE}} || {{translation category|project=0|Pages with overridden tntres}} }}
{{Block/row|label=Transparency|field={{{transparent|?}}}}}
| {{Blast resistance values | {{#if: {{{title|}}} | {{{title}}} | {{#titleparts: {{BASEPAGENAME}} }} }} }}
{{Block/row2|label=Luminance|field={{{light|?}}}}}
}} }}
{{Block/row|label=Tool{{#if:{{{tool2|}}}|s}}|field={{#switch:{{lc:{{{tool|{{{Tool}}}}}}}}<!--
{{infobox row|label=[[minecraft:Breaking#Blocks by hardness|Hardness]]|field={{ #if: {{{hardness|}}}
-->|pick|pickaxe=[[File:Use-pickaxe.png|28px|link=Tools#Pickaxe|Pickaxe]]<!--
| {{{hardness}}}{{#if: {{NAMESPACE}} || {{translation category|project=0|Pages with overridden hardness}} }}
-->|spade|shovel=[[File:Use-spade.png|28px|link=Tools#Shovel|Shovel]]<!--
| {{Hardness values | {{#if: {{{title|}}} | {{{title}}} | {{#titleparts: {{BASEPAGENAME}} }} }} }}
-->|axe=[[File:Use-axe.png|28px|link=Tools#Axe|Axe]]<!--
}} }}
-->|hoe=[[File:Use-hoe.png|28px|link=Tools#Hoe|Hoe]]<!--
{{#if: {{{durability|}}} |{{infobox row|Durability|{{{durability|}}}}}}}
-->|bucket|pail=[[File:use-bucket.png|28px|link=Tools#Bucket|Bucket]]<!--
{{infobox row|label=[[minecraft:Light|Luminous]]|field={{ #if: {{{light|}}} | {{{light}}} {{#if: {{{lightLevel|}}} | &nbsp;({{{lightLevel}}}) }} | ? {{#if: {{NAMESPACE}} || {{translation category|project=0|Missing luminance}}}} }} }}
-->|n/a|none=[[File:notool.png|28px|link=Tools|No tool]]<!--
{{infobox row|label=[[minecraft:Opacity|Transparent]]|field={{ #if: {{{transparent|}}} | {{{transparent}}} | ? {{#if: {{NAMESPACE}} || {{translation category|project=0|Missing transparency}}}} }} }}
-->|unknown|unknowntool|unknown tool|?=[[File:Unknowntool.png|28px|link=Tools|Unknown]]<!--
{{ #if: {{{waterloggable|}}} | {{infobox row|label=[[minecraft:Waterlogging|Waterloggable]]|field={{{waterloggable}}} }} }}
-->|all|alltools|any|anytool=Any tool<!--
{{ #if: {{{heals|}}} | {{infobox row|label=[[minecraft:Food|Restores]]|field={{{heals}}} }} }}
-->|#default=?}}<!--
{{infobox row|label=[[minecraft:Flammable|Flammable]]|field={{ #if: {{{flammable|}}} | {{{flammable}}} | ?{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing flammability}}}} }} }}
-->{{#if:{{{tool2|}}}|{{#switch:{{lc:{{{tool2}}}}}<!--
{{infobox row|label=Catches fire from [https://minecraft.wiki/w/Lava Lava]|field={{ #if: {{{lavasusceptible|}}} | {{{lavasusceptible}}} | ?{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing lava susceptibility}}}} }} }} }}
-->|pick|pickaxe=[[File:Use-pickaxe.png|28px|link=Tools#Pickaxe|Pickaxe]]<!--
{{#if: {{NAMESPACE}} ||
-->|spade|shovel=[[File:Use-spade.png|28px|link=Tools#Shovel|Shovel]]<!--
{{translation category|project=0|{{
-->|axe=[[File:Use-axe.png|28px|link=Tools#Axe|Axe]]<!--
  #switch: {{lc: {{{renewable|}}} }}
-->|hoe=[[File:Use-hoe.png|28px|link=Tools#Hoe|Hoe]]<!--
  | yes = Renewable resources
-->|unknown|unknowntool|unknown tool|?=[[File:Unknowntool.png|28px|link=Tools|Unknown]]}}}}}}
  | no = Non-renewable resources
{{Block/row2|label=Stackable|field={{{stackable|?}}}}}
  | Resources with invalid renewability
{{#switch:{{lc:{{{type}}}}}|fluid =
}}}}
{{Block/row|label=Speed of fluid movement|field={{{fluidspeed|?}}}}}
}}<noinclude>
{{Block/row2|label=Speed of walking through|field={{{movespeed|?}}}}}
{{documentation}}
}}
<!-- Put categories/interwiki on the documentation page -->
{{Block/row|label=Data value{{#if:{{{data2|}}}|s|}}|field={{{data|{{#if:{{{datadec|}}}|<!--
</noinclude>
 
---->{{#if:{{{data1name|}}}|'''{{{data1name|}}}'''<br />| }}<!--
---->|<sub>dec:</sub> {{{data1|00}}} <sub>hex:</sub> {{dec-hex|{{{data1|00}}} }}<br /><!--
 
The optional second data value.
 
---->{{#if:{{{data2|}}}|<!--
------>{{#if:{{{data2name|}}}|'''{{{data2name|}}}'''<br />| }}<!--
------><sub>dec:</sub> {{{data2}}} <sub>hex:</sub> {{dec-hex|{{{data2}}} }}<!--
---->|}}<!--
-->}} }}} }}
</table><noinclude><!---
--->
==Documentation==
'''These usage notes will not be included in articles bearing this template.'''
 
This template provides a uniform design for block pages.
<pre>
{{Block
| name =
| image =
| image2 =  
| invimage =
| invimage2 =
| type =  
| gravity =  
| dirt =
| transparent =
| light =
| tool =
| stackable =
| datadec =
| datahex =
| fluidspeed =
| movespeed =
}}</pre>
 
{| class=grid
! Parameter
! Function
! Default value
|-
| <code>name</code> || Name of the block || <code><nowiki>{{BASEPAGENAME}}</nowiki></code>
|-
| <code>image</code> || Image of the block (should be approx. 150x150px) || [[:File:No block image.png|No block image.png]]
|-
| <code>image2</code> || Second image for two-state blocks (also approx. 150x150px) || none
|-
| <code>invimage</code> || Image for object in inventory (should be approx. 36x36px) || none
|-
 
| <code>invimage2</code> || Second image for two-state objects in inventory (should be approx. 36x36px) || none
|-
| <code>type</code> || Type(solid block, solid, block, or fluid) || ?
|-
| <code>gravity</code> || Affected by gravity? || ?
|-
| <code>dirt</code> || Requires sunlight/dirt? || ?
|-
| <code>transparent</code> || Allows light to pass through? || ?
|-
| <code>light</code> || Emits Light? || ?
|-
| <code>tool</code> || Tool to use || ?
|-
| <code>stackable</code> || Stackable || ?
|-
| <code>datadec</code> || Decimal Data Value || ?
|-
| <code>datahex</code> || Hexadecimal Data Value || ?
|-
| <code>data</code> || Data Value (overrides dec and hex values) || <code>datadec</code> and <code>datahex</code>
|}
[[Category:Templates]]</noinclude>
<includeonly>{{#ifeq:{{NAMESPACE}}|{{ns:0}}|[[Category:Blocks]]}}</includeonly>