小 (机器人:整理源码) |
|||
第106行: | 第106行: | ||
* {{tl|:Materials/blocks row}} |
* {{tl|:Materials/blocks row}} |
||
− | |||
[[Category:表格模板]] |
[[Category:表格模板]] |
||
}} |
}} |
||
<noinclude> |
<noinclude> |
||
⚫ | |||
</noinclude> |
</noinclude> |
||
+ | |||
⚫ |
2018年11月14日 (三) 03:52的版本
此模板使用了Module:Materials row,此脚本使用Lua编写。
更多详情,请参阅维基百科:Lua和MediaWiki:扩展:Scribunto。
This template is used to create the rows for the table containing the material properties on Materials.
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. The name comes from MCP. | 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"
- defaults
nonsolid
- defaults
|adventureExempt=
to 1 - defaults
|solid=
,|blocklight=
and|blockmove=
to 0
- defaults
portal
- defaults
|solid=
,|blocklight=
and|blockmove=
to 0
- defaults
liquid
- defaults
|replace=
to 1 - defaults
|solid=
,|blocklight=
and|blockmove=
to 0
- defaults
cobweb
- defaults
|blockmove=
to 1
- defaults
The parameter |piston=
can be set to determine the interaction when a piston pushes the block. Options are as follows:
pushed
- pushes the block, defaultreplace
- breaks the block being pushedblocked
- stops the piston from extending
Code
The parameters generally correspond to the actual structure of the code. With reference to MCP 9.10:
|subclass=
refers to actual subclasses of theMaterial
class. Names mostly match, but "nonsolid" isMaterialLogic
, while "cobweb" is the inline class used for theweb
material.|liquid=
refers to theisLiquid()
method.|solid=
refers to theisSolid()
method.|blocklight=
refers to theblocksLight()
method.|blockmove=
refers to theblocksMovement()
method.|opaque=
refers to thesetTranslucent()
andisOpaque()
methods.|tool=
refers to thesetRequiresTool()
andisToolNotRequired()
methods.|burn=
refers to thesetBurning()
andgetCanBurn()
methods.|replace=
refers to thesetReplaceable()
andisReplaceable()
methods.|adventureExempt=
refers to thesetAdventureModeExempt()
method.|piston=
refers to thesetNoPushMobility()
,setImmovableMobility()
, andgetMaterialMobility()
methods.
See also
{{:Materials/blocks row}}