IMaterialDefinition
Link to imaterialdefinition
An IMaterialDefinition object represents a material definition in the game. A Material Definition is needed if you want to create a new block.
导入相关包
Link to 导入相关包
It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.
import mods.contenttweaker.BlockMaterial;
Calling an IMaterialDefinition object
Link to calling-an-imaterialdefinition-object
You can get such an object using the Block Material Bracket Handler:
<blockmaterial:wood>
不带参数的 ZenGetters/ZenMethods
Link to 不带参数的-zengetterszenmethods
ZenGetter | ZenMethod | 返回值类型 |
---|---|---|
ZenGetter blocksLight | ZenMethod blocksLight() | 返回值类型 bool |
ZenGetter blocksMovement #是否可移动 | ZenMethod blocksMovement() | 返回值类型 bool |
ZenGetter canBurn | ZenMethod getCanBurn() | 返回值类型 bool |
ZenGetter mobilityFlag | ZenMethod getMobilityFlag() | 返回值类型 PushReaction |
ZenGetter liquid | ZenMethod isLiquid() | 返回值类型 bool |
ZenGetter opaque | ZenMethod isOpaque() | 返回值类型 bool |
ZenGetter replaceable | ZenMethod isReplaceable() | 返回值类型 bool |
ZenGetter solid | ZenMethod isSolid() | 返回值类型 bool |
ZenGetter toolNotRequired | ZenMethod isToolNotRequired() | 返回值类型 bool |
Compare two BlockMaterials
Link to compare-two-blockmaterials
You can use the ==
operator to see if two MaterialDefinitions are equal
ZenScript Copyif(materialA == materialB)
print("success!");