Template:Infobox block: Difference between revisions

Automated hex values with new system, the new system is used by default, but is overridden with data or datadec
No edit summary
 
(403 intermediate revisions by 70 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: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">[[image:{{{image|No 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|}}}{{
{{Block/row|label=Type|field={{{type|?}}}}}
  #if: {{{tool2|}}} | {{{tool2|}}}
{{#switch:{{lc:{{{type}}}}}|solid block|solid|block =
}}{{
{{Block/row|label=Requires sunlight/dirt?|field={{{dirt|?}}}}}
  #if: {{{tool3|}}} | {{{tool3|}}}
}}
}} }}
{{Block/row|label=Physics|field={{{gravity|?}}}}}
{{infobox row|label=[[minecraft:Explosion#Blast resistance|Blast resistance]]|field={{ #if: {{{tntres|}}}
{{Block/row|label=Transparency|field={{{transparent|?}}}}}
| {{{tntres}}}{{#if: {{NAMESPACE}} || {{translation category|project=0|Pages with overridden tntres}} }}
{{Block/row|label=Luminance|field={{{light|?}}}}}
| {{Blast resistance values | {{#if: {{{title|}}} | {{{title}}} | {{#titleparts: {{BASEPAGENAME}} }} }} }}
{{Block/row|label=Tool|field={{#switch:{{lc:{{{Tool}}}}}|<!---
}} }}
--->|[[file:use-pickaxe.png]]|pick|pickaxe=[[File:Use-pickaxe.png]]<!---
{{infobox row|label=[[minecraft:Breaking#Blocks by hardness|Hardness]]|field={{ #if: {{{hardness|}}}
--->|[[file:use-spade.png]]|spade|shovel=[[File:Use-spade.png]]<!--
| {{{hardness}}}{{#if: {{NAMESPACE}} || {{translation category|project=0|Pages with overridden hardness}} }}
--->|[[file:use-axe.png]]|axe=[[File:Use-axe.png]]<!--
| {{Hardness values | {{#if: {{{title|}}} | {{{title}}} | {{#titleparts: {{BASEPAGENAME}} }} }} }}
--->|n/a|none=N/A<!--
}} }}
--->|#default=?}}
{{#if: {{{durability|}}} |{{infobox row|Durability|{{{durability|}}}}}}}
}}
{{infobox row|label=[[minecraft:Light|Luminous]]|field={{ #if: {{{light|}}} | {{{light}}} {{#if: {{{lightLevel|}}} | &nbsp;({{{lightLevel}}}) }} | ? {{#if: {{NAMESPACE}} || {{translation category|project=0|Missing luminance}}}} }} }}
{{#switch:{{lc:{{{type}}}}}|fluid =
{{infobox row|label=[[minecraft:Opacity|Transparent]]|field={{ #if: {{{transparent|}}} | {{{transparent}}} | ? {{#if: {{NAMESPACE}} || {{translation category|project=0|Missing transparency}}}} }} }}
{{Block/row|label=Speed of fluid movement:|field={{{fluidspeed|?}}}}}
{{ #if: {{{waterloggable|}}} | {{infobox row|label=[[minecraft:Waterlogging|Waterloggable]]|field={{{waterloggable}}} }} }}
{{Block/row|label=Speed of walking through:|field={{{movespeed|?}}}}}
{{ #if: {{{heals|}}} | {{infobox row|label=[[minecraft:Food|Restores]]|field={{{heals}}} }} }}
}}
{{infobox row|label=[[minecraft:Flammable|Flammable]]|field={{ #if: {{{flammable|}}} | {{{flammable}}} | ?{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing flammability}}}} }} }}
{{Block/row|label=Data value{{#if:{{{data2|}}}|s|}}|field={{{data|{{#if:{{{datadec|}}}|<!--
{{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}}}} }} }} }}
 
{{#if: {{NAMESPACE}} ||
The original data values setup, used if datadec is a field
{{translation category|project=0|{{
 
  #switch: {{lc: {{{renewable|}}} }}
---->{{{datadec|?}}} <sub>dec</sub> ({{{datahex|{{dec-hex|{{{datadec|0}}}}}}}} <sub>hex</sub>)|<!--
  | yes = Renewable resources
 
  | no = Non-renewable resources
The new formatting
  | Resources with invalid renewability
 
}}}}
---->{{#if:{{{data1name|}}}|'''{{{data1name|}}}'''<br />| }}<!--
}}<noinclude>
----><sub>dec:</sub> {{{data1|35}}} <sub>hex:</sub> {{dec-hex|{{{data1|35}}} }}<br /><!--
{{documentation}}
 
<!-- Put categories/interwiki on the documentation page -->
The optional second data value in the new formatting.
</noinclude>
 
---->{{#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 =
| type =  
| gravity =
| dirt =  
| transparent =
| light =
| Tool =
| datadec =
| datahex =  
}}</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 image.png|No image.png]]
|-
| <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>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>