Class WoodTypeBuilder
java.lang.Object
net.fabricmc.fabric.api.object.builder.v1.block.type.WoodTypeBuilder
This class allows easy creation of
WoodTypes.
A WoodType is used to tell the game what textures signs should use, as well as sounds for both signs and fence gates.
Regular sign textures are stored at [namespace]/textures/entity/signs/[path].png.
Hanging sign textures are stored at [namespace]/textures/entity/signs/hanging/[path].png.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.block.state.properties.WoodTypebuild(net.minecraft.resources.Identifier id, net.minecraft.world.level.block.state.properties.BlockSetType setType) Builds aWoodTypefrom this builder's values without registering it.static WoodTypeBuildercopyOf(WoodTypeBuilder builder) Creates a newWoodTypeBuilderthat copies all of another builder's values.static WoodTypeBuildercopyOf(net.minecraft.world.level.block.state.properties.WoodType woodType) Creates a newWoodTypeBuilderthat copies all of another wood type's values.fenceGateCloseSound(net.minecraft.sounds.SoundEvent fenceGateCloseSound) Sets this wood type's fence gate close sound.fenceGateOpenSound(net.minecraft.sounds.SoundEvent fenceGateOpenSound) Sets this wood type's fence gate open sound.hangingSignSoundType(net.minecraft.world.level.block.SoundType hangingSignSoundType) Sets this wood type's hanging sign sound type.net.minecraft.world.level.block.state.properties.WoodTyperegister(net.minecraft.resources.Identifier id, net.minecraft.world.level.block.state.properties.BlockSetType setType) Builds and registers aWoodTypefrom this builder's values.soundType(net.minecraft.world.level.block.SoundType soundType) Sets this wood type's sound type.
-
Constructor Details
-
WoodTypeBuilder
public WoodTypeBuilder()
-
-
Method Details
-
soundType
Sets this wood type's sound type.Defaults to
SoundType.WOOD.- Returns:
- this builder for chaining
-
hangingSignSoundType
public WoodTypeBuilder hangingSignSoundType(net.minecraft.world.level.block.SoundType hangingSignSoundType) Sets this wood type's hanging sign sound type.Defaults to
SoundType.HANGING_SIGN.- Returns:
- this builder for chaining
-
fenceGateCloseSound
Sets this wood type's fence gate close sound.Defaults to
SoundEvents.FENCE_GATE_CLOSE.- Returns:
- this builder for chaining
-
fenceGateOpenSound
Sets this wood type's fence gate open sound.Defaults to
SoundEvents.FENCE_GATE_OPEN.- Returns:
- this builder for chaining
-
copyOf
Creates a newWoodTypeBuilderthat copies all of another builder's values.- Parameters:
builder- theWoodTypeBuilderwhose values are to be copied- Returns:
- the created copy
-
copyOf
public static WoodTypeBuilder copyOf(net.minecraft.world.level.block.state.properties.WoodType woodType) Creates a newWoodTypeBuilderthat copies all of another wood type's values.- Parameters:
woodType- theWoodTypewhose values are to be copied- Returns:
- the created copy
-
register
public net.minecraft.world.level.block.state.properties.WoodType register(net.minecraft.resources.Identifier id, net.minecraft.world.level.block.state.properties.BlockSetType setType) Builds and registers aWoodTypefrom this builder's values.Alternatively, you can use
build(Identifier, BlockSetType)to build without registering.
ThenWoodType.register(WoodType)can be used to register it later.- Parameters:
id- the id for the builtWoodTypesetType- theBlockSetTypefor the builtWoodType- Returns:
- the built and registered
WoodType
-
build
public net.minecraft.world.level.block.state.properties.WoodType build(net.minecraft.resources.Identifier id, net.minecraft.world.level.block.state.properties.BlockSetType setType) Builds aWoodTypefrom this builder's values without registering it.Use
WoodType.register(WoodType)to register it later.
Alternatively, you can useregister(Identifier, BlockSetType)to build and register it now.- Parameters:
id- the id for the builtWoodTypesetType- theBlockSetTypefor the builtWoodType- Returns:
- the built
WoodType
-