BlockBuilderStairs

Link to blockbuilderstairs

A special Block Builder that allows you to create stairs.

Stairs will have not one but three textures that you will need to supply: One for the top, one for the bottom and one for the sides. By default these textures will use your blockname as name, suffixed by _top, _bottom 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
Copy
import mods.contenttweaker.block.stairs.BlockBuilderStairs;

Extending BlockTypeBuilder

Link to extending-blocktypebuilder

BlockBuilderStairs extends BlockTypeBuilder. That means all methods available in BlockTypeBuilder are also available in BlockBuilderStairs

Name: build

Instructs CoT to actually build whatever this builder is supposed to be building.

Return Type: void

ZenScript
Copy
// BlockBuilderStairs.build(resourceLocation as string) as void

new BlockBuilder().withType<BlockBuilderStairs>().build("my_awesome_block");
ПараметрТипОписание
Параметр
resourceLocation
Тип
string
Описание
The resource path to give this block

Link to withBottomTexture

Name: withBottomTexture

Allows you to override the path of the texture that the bottom side 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: BlockBuilderStairs

ZenScript
Copy
// BlockBuilderStairs.withBottomTexture(bottomTexture as Function<MCResourceLocation,MCResourceLocation>) as BlockBuilderStairs

new BlockBuilder().withType<BlockBuilderStairs>().withBottomTexture((blockName as ResourceLocation) => new ResourceLocation(blockName.namespace, blockName.path + "_bottom"));
ПараметрТипОписание
Параметр
bottomTexture
Тип
Function<MCResourceLocation,MCResourceLocation>
Описание
The function to use

Link to withBottomTexture

Name: withBottomTexture

Allows you to override the path of the texture that the bottom side 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: BlockBuilderStairs

ZenScript
Copy
BlockBuilderStairs.withBottomTexture(bottomTexture as MCResourceLocation) as BlockBuilderStairs
ПараметрТипОписание
Параметр
bottomTexture
Тип
Расположение MCResource-ресурсов
Описание
The texture to be used for the bottom side

Link to withSidesTexture

Name: withSidesTexture

Allows you to override the path of the texture that the sides 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: BlockBuilderStairs

ZenScript
Copy
// BlockBuilderStairs.withSidesTexture(sidesTexture as Function<MCResourceLocation,MCResourceLocation>) as BlockBuilderStairs

new BlockBuilder().withType<BlockBuilderStairs>().withSidesTexture((blockName as ResourceLocation) => new ResourceLocation(blockName.namespace, blockName.path + "_sides"));
ПараметрТипОписание
Параметр
sidesTexture
Тип
Function<MCResourceLocation,MCResourceLocation>
Описание
The function to use

Link to withSidesTexture

Name: withSidesTexture

Allows you to override the path of the texture that the sides 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: BlockBuilderStairs

ZenScript
Copy
BlockBuilderStairs.withSidesTexture(sidesTexture as MCResourceLocation) as BlockBuilderStairs
ПараметрТипОписание
Параметр
sidesTexture
Тип
Расположение MCResource-ресурсов
Описание
The texture to be used for the sides

Name: withTopTexture

Allows you to override the path of the texture that the top side 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: BlockBuilderStairs

ZenScript
Copy
BlockBuilderStairs.withTopTexture(topTexture as Function<MCResourceLocation,MCResourceLocation>) as BlockBuilderStairs
ПараметрТипОписание
Параметр
topTexture
Тип
Function<MCResourceLocation,MCResourceLocation>
Описание
The function to use

Name: withTopTexture

Allows you to override the path of the texture that the top side 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: BlockBuilderStairs

ZenScript
Copy
// BlockBuilderStairs.withTopTexture(topTexture as MCResourceLocation) as BlockBuilderStairs

new BlockBuilder().withType<BlockBuilderStairs>().withTopTexture(<resource:contenttweaker:my_awesome_stairs_top>);
ПараметрТипОписание
Параметр
topTexture
Тип
Расположение MCResource-ресурсов
Описание
The texture to be used for the top side