Class WoodTypeBuilder

java.lang.Object
net.fabricmc.fabric.api.object.builder.v1.block.type.WoodTypeBuilder

public final class WoodTypeBuilder extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.block.state.properties.WoodType
    build(net.minecraft.resources.Identifier id, net.minecraft.world.level.block.state.properties.BlockSetType setType)
    Builds a WoodType from this builder's values without registering it.
    Creates a new WoodTypeBuilder that copies all of another builder's values.
    copyOf(net.minecraft.world.level.block.state.properties.WoodType woodType)
    Creates a new WoodTypeBuilder that 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.WoodType
    register(net.minecraft.resources.Identifier id, net.minecraft.world.level.block.state.properties.BlockSetType setType)
    Builds and registers a WoodType from this builder's values.
    soundType(net.minecraft.world.level.block.SoundType soundType)
    Sets this wood type's sound type.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WoodTypeBuilder

      public WoodTypeBuilder()
  • Method Details

    • soundType

      public WoodTypeBuilder soundType(net.minecraft.world.level.block.SoundType 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

      public WoodTypeBuilder fenceGateCloseSound(net.minecraft.sounds.SoundEvent fenceGateCloseSound)
      Sets this wood type's fence gate close sound.

      Defaults to SoundEvents.FENCE_GATE_CLOSE.

      Returns:
      this builder for chaining
    • fenceGateOpenSound

      public WoodTypeBuilder fenceGateOpenSound(net.minecraft.sounds.SoundEvent fenceGateOpenSound)
      Sets this wood type's fence gate open sound.

      Defaults to SoundEvents.FENCE_GATE_OPEN.

      Returns:
      this builder for chaining
    • copyOf

      public static WoodTypeBuilder copyOf(WoodTypeBuilder builder)
      Creates a new WoodTypeBuilder that copies all of another builder's values.
      Parameters:
      builder - the WoodTypeBuilder whose 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 new WoodTypeBuilder that copies all of another wood type's values.
      Parameters:
      woodType - the WoodType whose 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 a WoodType from this builder's values.

      Alternatively, you can use build(Identifier, BlockSetType) to build without registering.
      Then WoodType.register(WoodType) can be used to register it later.

      Parameters:
      id - the id for the built WoodType
      setType - the BlockSetType for the built WoodType
      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 a WoodType from this builder's values without registering it.

      Use WoodType.register(WoodType) to register it later.
      Alternatively, you can use register(Identifier, BlockSetType) to build and register it now.

      Parameters:
      id - the id for the built WoodType
      setType - the BlockSetType for the built WoodType
      Returns:
      the built WoodType