AmbientSounds.java

net.minecraft.world.attribute.AmbientSounds

信息

  • 全限定名:net.minecraft.world.attribute.AmbientSounds
  • 类型:public record
  • 包:net.minecraft.world.attribute
  • 源码路径:src/main/java/net/minecraft/world/attribute/AmbientSounds.java
  • 起始行号:L11
  • 职责:

    TODO

字段/常量

  • EMPTY

    • 类型: AmbientSounds
    • 修饰符: public static final
    • 源码定位: L12
    • 说明:

      TODO

  • LEGACY_CAVE_SETTINGS

    • 类型: AmbientSounds
    • 修饰符: public static final
    • 源码定位: L13
    • 说明:

      TODO

  • CODEC

    • 类型: Codec<AmbientSounds>
    • 修饰符: public static final
    • 源码定位: L16
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

下面的方法块按源码顺序生成。

代码

public record AmbientSounds(Optional<Holder<SoundEvent>> loop, Optional<AmbientMoodSettings> mood, List<AmbientAdditionsSettings> additions) {
    public static final AmbientSounds EMPTY = new AmbientSounds(Optional.empty(), Optional.empty(), List.of());
    public static final AmbientSounds LEGACY_CAVE_SETTINGS = new AmbientSounds(
        Optional.empty(), Optional.of(AmbientMoodSettings.LEGACY_CAVE_SETTINGS), List.of()
    );
    public static final Codec<AmbientSounds> CODEC = RecordCodecBuilder.create(
        i -> i.group(
                SoundEvent.CODEC.optionalFieldOf("loop").forGetter(AmbientSounds::loop),
                AmbientMoodSettings.CODEC.optionalFieldOf("mood").forGetter(AmbientSounds::mood),
                ExtraCodecs.compactListCodec(AmbientAdditionsSettings.CODEC).optionalFieldOf("additions", List.of()).forGetter(AmbientSounds::additions)
            )
            .apply(i, AmbientSounds::new)
    );
}

引用的其他类

  • ExtraCodecs
    • 引用位置: 方法调用
    • 关联成员: ExtraCodecs.compactListCodec()