BlockBuilderPillarRotatable
Link to blockbuilderpillarrotatable
A special Block Builder that allows you to create blocks that can be rotated in the same way as logs can.
This means that it has one texture for the top and bottom and one texture for the sides. By default these sides' locations are the block's name, followed by and either _end
or sides
. As with most things here, sample images are generated for you by default, though.
This class was added by a mod with mod-id contenttweaker
. Так что если вы хотите использовать эту функцию, вам нужно установить этот мод.
Импорт класса
Link to импорт-класса
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport mods.contenttweaker.block.pillar.BlockBuilderPillarRotatable;
Extending BlockTypeBuilder
Link to extending-blocktypebuilder
BlockBuilderPillarRotatable extends BlockTypeBuilder. That means all methods available in BlockTypeBuilder are also available in BlockBuilderPillarRotatable
Методы
Link to методы
Name: build
Instructs CoT to actually build whatever this builder is supposed to be building.
Return Type: void
ZenScript Copy// BlockBuilderPillarRotatable.build(resourceLocation as string) as void
new BlockBuilder().withType<BlockBuilderPillarRotatable>().build("my_awesome_block");
Параметр | Тип | Описание |
---|---|---|
Параметр resourceLocation | Тип string | Описание The resource path to give this block |
Name: withEndTexture
Allows you to override the path of the texture that the end sides (top/bottom) should use. If that texture's namespace is in the namespace of CoT or any of its addons (that support it) then the image will be created by default. Uses a function that takes the block's name as input and returns the end texture for it.
Returns: This builder, used for method chaining
Return Type: BlockBuilderPillarRotatable
ZenScript Copy// BlockBuilderPillarRotatable.withEndTexture(endTexture as Function<MCResourceLocation,MCResourceLocation>) as BlockBuilderPillarRotatable
new BlockBuilder().withType<BlockBuilderPillarRotatable>().withEndTexture((blockName as ResourceLocation) => new ResourceLocation(blockName.namespace, blockName.path + "_end"));
Параметр | Тип | Описание |
---|---|---|
Параметр endTexture | Тип Function<MCResourceLocation,MCResourceLocation> | Описание The function to use |
Name: withEndTexture
Allows you to override the path of the texture that the end sides (top/bottom) should use. If that texture's namespace is in the namespace of CoT or any of its addons (that support it) then the image will be created by default.
Returns: This builder, used for method chaining
Return Type: BlockBuilderPillarRotatable
ZenScript Copy// BlockBuilderPillarRotatable.withEndTexture(endTexture as MCResourceLocation) as BlockBuilderPillarRotatable
new BlockBuilder().withType<BlockBuilderPillarRotatable>().withEndTexture(<resource:contenttweaker:my_awesome_pillar_end>);
Параметр | Тип | Описание |
---|---|---|
Параметр endTexture | Тип Расположение MCResource-ресурсов | Описание The texture to be used for the end sides. |
Name: withSideTexture
Allows you to override the path of the texture that the sides (everything but top/bottom) should use. If that texture's namespace is in the namespace of CoT or any of its addons (that support it) then the image will be created by default. Uses a function that takes the block's name as input and returns the side texture for it.
Returns: This builder, used for method chaining
Return Type: BlockBuilderPillarRotatable
ZenScript Copy// BlockBuilderPillarRotatable.withSideTexture(sidesTexture as Function<MCResourceLocation,MCResourceLocation>) as BlockBuilderPillarRotatable
new BlockBuilder().withType<BlockBuilderPillarRotatable>().withSideTexture((blockName as ResourceLocation) => new ResourceLocation(blockName.namespace, blockName.path + "_sides"));
Параметр | Тип | Описание |
---|---|---|
Параметр sidesTexture | Тип Function<MCResourceLocation,MCResourceLocation> | Описание The function to use |
Name: withSideTexture
Allows you to override the path of the texture that the sides (everything but top/bottom) should use. If that texture's namespace is in the namespace of CoT or any of its addons (that support it) then the image will be created by default.
Returns: This builder, used for method chaining
Return Type: BlockBuilderPillarRotatable
ZenScript Copy// BlockBuilderPillarRotatable.withSideTexture(sidesTexture as MCResourceLocation) as BlockBuilderPillarRotatable
new BlockBuilder().withType<BlockBuilderPillarRotatable>().withSideTexture(<resource:contenttweaker:my_awesome_pillar_side>);
Параметр | Тип | Описание |
---|---|---|
Параметр sidesTexture | Тип Расположение MCResource-ресурсов | Описание The texture to be used for the sides. |