BlockBuilderSlab

Link to blockbuilderslab

A special builder that allows you to create slabs.

By default, this has 3 textures, one for the top, bottom and the 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. So you need to have this mod installed if you want to use this feature.

Diese Klasse importieren

Link to diese-klasse-importieren

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.slab.BlockBuilderSlab;

Extending BlockTypeBuilder

Link to extending-blocktypebuilder

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

Name: build

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

Return Type: void

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

new BlockBuilder().withType<BlockBuilderSlab>().build("my_awesome_block");
ParameterTypeBeschreibung
Parameter
resourceLocation
Type
string
Beschreibung
The resource path to give this block

Name: withBottomTexture

Allows you to override the path of the texture that the 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 bottom texture for it.

Returns: This builder, used for method chaining
Return Type: BlockBuilderSlab

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

new BlockBuilder().withType<BlockBuilderSlab>().withBottomTexture((blockName as ResourceLocation) => new ResourceLocation(blockName.namespace, blockName.path + "_top"));
ParameterTypeBeschreibung
Parameter
bottomTexture
Type
Function<MCResourceLocation,MCResourceLocation>
Beschreibung
The function to use

Name: withBottomTexture

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

ZenScript
Copy
// BlockBuilderSlab.withBottomTexture(bottomTexture as MCResourceLocation) as BlockBuilderSlab

new BlockBuilder().withType<BlockBuilderSlab>().withBottomTexture(<resource:contenttweaker:my_awesome_slab_bottom>);
ParameterTypeBeschreibung
Parameter
bottomTexture
Type
MCResource-Standort
Beschreibung
The texture to be used for the 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 sides texture for it.

Returns: This builder, used for method chaining
Return Type: BlockBuilderSlab

ZenScript
Copy
// BlockBuilderSlab.withSideTexture(sidesTexture as Function<MCResourceLocation,MCResourceLocation>) as BlockBuilderSlab

new BlockBuilder().withType<BlockBuilderSlab>().withSideTexture((blockName as ResourceLocation) => new ResourceLocation(blockName.namespace, blockName.path + "_sides"));
ParameterTypeBeschreibung
Parameter
sidesTexture
Type
Function<MCResourceLocation,MCResourceLocation>
Beschreibung
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: BlockBuilderSlab

ZenScript
Copy
// BlockBuilderSlab.withSideTexture(sidesTexture as MCResourceLocation) as BlockBuilderSlab

new BlockBuilder().withType<BlockBuilderSlab>().withSideTexture(<resource:contenttweaker:my_awesome_slab_side>);
ParameterTypeBeschreibung
Parameter
sidesTexture
Type
MCResource-Standort
Beschreibung
The texture to be used for the sides.

Name: withTopTexture

Allows you to override the path of the texture that the top 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 top texture for it.

Returns: This builder, used for method chaining
Return Type: BlockBuilderSlab

ZenScript
Copy
// BlockBuilderSlab.withTopTexture(topTexture as Function<MCResourceLocation,MCResourceLocation>) as BlockBuilderSlab

new BlockBuilder().withType<BlockBuilderSlab>().withTopTexture((blockName as ResourceLocation) => new ResourceLocation(blockName.namespace, blockName.path + "_top"));
ParameterTypeBeschreibung
Parameter
topTexture
Type
Function<MCResourceLocation,MCResourceLocation>
Beschreibung
The function to use

Name: withTopTexture

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

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

new BlockBuilder().withType<BlockBuilderSlab>().withTopTexture(<resource:contenttweaker:my_awesome_slab_top>);
ParameterTypeBeschreibung
Parameter
topTexture
Type
MCResource-Standort
Beschreibung
The texture to be used for the sides.