Minecraft Wiki

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

了解更多

Minecraft Wiki
(以“....”为内容创建页面)
 
无编辑摘要
(未显示6个用户的9个中间版本)
第1行: 第1行:
  +
<includeonly>{{#invoke: Materials row | properties }}</includeonly><noinclude>
....
 
  +
{{documentation|content=
  +
{{lua|Materials row}}
  +
该模板用于创建材料属性表,以展示各个[[材料]]的特征。
  +
  +
== Usage ==
  +
  +
The parameter is set to the title to display in the first column.
  +
  +
The parameter {{p|rgb}} contains three color values separated by commas to display as a colored cell and text. It should be set based on the material's map color. If unset, it defaults to a white color and the text "None"
  +
  +
=== Properties ===
  +
  +
The table contains the following properties. They are set to 1 for true, and 0 for false.
  +
{{pipe escape|
  +
{| class{{=}}"wikitable"
  +
! Name
  +
! Subclass only?
  +
! Description
  +
! Default
  +
|-
  +
| {{p|liquid}}
  +
| {{tc|no|yes}}
  +
| The block allows the player to swim.
  +
| 0
  +
|-
  +
| {{p|solid}}
  +
| {{tc|no|yes}}
  +
| This block allows block dependent blocks to be placed on it, and is considered when spawning various structures.
  +
| 1
  +
|-
  +
| {{p|blocklight}}
  +
| {{tc|no|yes}}
  +
| This block reduces the level of light passing through it (often blocking it entirely).
  +
| 1
  +
|-
  +
| {{p|blockmove}}
  +
| {{tc|no|yes}}
  +
| This block prevents movement through it, and usually suffocates entities inside of it.
  +
| 1
  +
|-
  +
| {{p|opaque}}
  +
| {{tc|yes|no}}
  +
| This block cannot be seen through.
  +
| {{p|blockmove}}
  +
|-
  +
| {{p|tool}}
  +
| {{tc|yes|no}}
  +
| This block requires a tool to give a drop.
  +
| 0
  +
|-
  +
| {{p|burn}}
  +
| {{tc|yes|no}}
  +
| This block can become lit from lava.
  +
| 0
  +
|-
  +
| {{p|replace}}
  +
| {{tc|yes|no}}
  +
| This block will be replaced from {{control|using}} another block on it.
  +
| 0
  +
|-
  +
| {{p|adventureExempt}}
  +
| {{tc|yes|no}}
  +
| Does not seem to be used anywhere in Minecraft, and is not displayed in the table.
  +
| 0
  +
|}
  +
}}
  +
  +
Subclasses can also be set using {{p|subclass}} for to change the defaults based on coded subclasses. Values include:
  +
* <code>liquid</code>
  +
** defaults {{p|liquid}} and {{p|replace}} to 1
  +
** defaults {{p|blockmove}} and {{p|solid}} to 0
  +
** defaults {{p|piston}} to "replace"
  +
* <code>nonsolid</code>
  +
** defaults {{p|adventureExempt}} to 1
  +
** defaults {{p|solid}}, {{p|blocklight}} and {{p|blockmove}} to 0
  +
* <code>portal</code>
  +
** defaults {{p|solid}}, {{p|blocklight}} and {{p|blockmove}} to 0
  +
* <code>liquid</code>
  +
** defaults {{p|replace}} to 1
  +
** defaults {{p|solid}}, {{p|blocklight}} and {{p|blockmove}} to 0
  +
* <code>cobweb</code>
  +
** defaults {{p|blockmove}} to 1
  +
  +
The parameter {{p|piston}} can be set to determine the interaction when a piston pushes the block. Options are as follows:
  +
* <code>pushed</code> - pushes the block, default
  +
* <code>replace</code> - breaks the block being pushed
  +
* <code>blocked</code> - stops the piston from extending
  +
  +
== Code ==
  +
  +
The parameters generally correspond to the actual structure of the code.
  +
* {{p|subclass}} refers to actual subclasses of the <code>Material</code> class. Names mostly match, but "nonsolid" is <code>MaterialLogic</code>, while "cobweb" is the inline class used for the <code>web</code> material.
  +
* {{p|liquid}} refers to the <code>isLiquid()</code> method.
  +
* {{p|solid}} refers to the <code>isSolid()</code> method.
  +
* {{p|blocklight}} refers to the <code>blocksLight()</code> method.
  +
* {{p|blockmove}} refers to the <code>blocksMovement()</code> method.
  +
* {{p|opaque}} refers to the <code>setTranslucent()</code> and <code>isOpaque()</code> methods.
  +
* {{p|tool}} refers to the <code>setRequiresTool()</code> and <code>isToolNotRequired()</code> methods.
  +
* {{p|burn}} refers to the <code>setBurning()</code> and <code>getCanBurn()</code> methods.
  +
* {{p|replace}} refers to the <code>setReplaceable()</code> and <code>isReplaceable()</code> methods.
  +
* {{p|adventureExempt}} refers to the <code>setAdventureModeExempt()</code> method.
  +
* {{p|piston}} refers to the <code>setNoPushMobility()</code>, <code>setImmovableMobility()</code>, and <code>getMaterialMobility()</code> methods.
  +
  +
[[Category:表格模板]]
  +
}}
  +
<noinclude>
  +
[[en:Materials/properties row]]
  +
</noinclude>

2020年6月1日 (一) 03:43的版本

[编辑 | 历史 | 清除缓存]文档页面
Lua logo

此模板使用了Module:Materials row,此脚本使用Lua编写。
更多详情,请参阅维基百科:LuaMediaWiki:扩展:Scribunto

该模板用于创建材料属性表,以展示各个材料的特征。

Usage

The parameter is set to the title to display in the first column.

The parameter |rgb= contains three color values separated by commas to display as a colored cell and text. It should be set based on the material's map color. If unset, it defaults to a white color and the text "None"

Properties

The table contains the following properties. They are set to 1 for true, and 0 for false.

Name Subclass only? Description Default
|liquid= Yes The block allows the player to swim. 0
|solid= Yes This block allows block dependent blocks to be placed on it, and is considered when spawning various structures. 1
|blocklight= Yes This block reduces the level of light passing through it (often blocking it entirely). 1
|blockmove= Yes This block prevents movement through it, and usually suffocates entities inside of it. 1
|opaque= No This block cannot be seen through. |blockmove=
|tool= No This block requires a tool to give a drop. 0
|burn= No This block can become lit from lava. 0
|replace= No This block will be replaced from using another block on it. 0
|adventureExempt= No Does not seem to be used anywhere in Minecraft, and is not displayed in the table. 0

Subclasses can also be set using |subclass= for to change the defaults based on coded subclasses. Values include:

  • liquid
    • defaults |liquid= and |replace= to 1
    • defaults |blockmove= and |solid= to 0
    • defaults |piston= to "replace"
  • nonsolid
    • defaults |adventureExempt= to 1
    • defaults |solid=, |blocklight= and |blockmove= to 0
  • portal
    • defaults |solid=, |blocklight= and |blockmove= to 0
  • liquid
    • defaults |replace= to 1
    • defaults |solid=, |blocklight= and |blockmove= to 0
  • cobweb
    • defaults |blockmove= to 1

The parameter |piston= can be set to determine the interaction when a piston pushes the block. Options are as follows:

  • pushed - pushes the block, default
  • replace - breaks the block being pushed
  • blocked - stops the piston from extending

Code

The parameters generally correspond to the actual structure of the code.

  • |subclass= refers to actual subclasses of the Material class. Names mostly match, but "nonsolid" is MaterialLogic, while "cobweb" is the inline class used for the web material.
  • |liquid= refers to the isLiquid() method.
  • |solid= refers to the isSolid() method.
  • |blocklight= refers to the blocksLight() method.
  • |blockmove= refers to the blocksMovement() method.
  • |opaque= refers to the setTranslucent() and isOpaque() methods.
  • |tool= refers to the setRequiresTool() and isToolNotRequired() methods.
  • |burn= refers to the setBurning() and getCanBurn() methods.
  • |replace= refers to the setReplaceable() and isReplaceable() methods.
  • |adventureExempt= refers to the setAdventureModeExempt() method.
  • |piston= refers to the setNoPushMobility(), setImmovableMobility(), and getMaterialMobility() methods.