EnvironmentAttributeReader.java

net.minecraft.world.attribute.EnvironmentAttributeReader

信息

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

    TODO

字段/常量

  • EMPTY
    • 类型: EnvironmentAttributeReader
    • 修饰符: public public
    • 源码定位: L10
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

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

<Value> Value getDimensionValue(EnvironmentAttribute<Value> attribute) @ L22

  • 方法名:getDimensionValue
  • 源码定位:L22
  • 返回类型: Value
  • 修饰符:package-private

参数:

  • attribute: EnvironmentAttribute

说明:

TODO

default <Value> Value getValue(EnvironmentAttribute<Value> attribute, BlockPos pos) @ L24

  • 方法名:getValue
  • 源码定位:L24
  • 返回类型: Value
  • 修饰符:default

参数:

  • attribute: EnvironmentAttribute
  • pos: BlockPos

说明:

TODO

default <Value> Value getValue(EnvironmentAttribute<Value> attribute, Vec3 pos) @ L28

  • 方法名:getValue
  • 源码定位:L28
  • 返回类型: Value
  • 修饰符:default

参数:

  • attribute: EnvironmentAttribute
  • pos: Vec3

说明:

TODO

<Value> Value getValue(EnvironmentAttribute<Value> attribute, Vec3 pos, SpatialAttributeInterpolator biomeInterpolator) @ L32

  • 方法名:getValue
  • 源码定位:L32
  • 返回类型: Value
  • 修饰符:package-private

参数:

  • attribute: EnvironmentAttribute
  • pos: Vec3
  • biomeInterpolator: SpatialAttributeInterpolator

说明:

TODO

default <Value> Value getValue(LootContext context, EnvironmentAttribute<Value> attribute) @ L34

  • 方法名:getValue
  • 源码定位:L34
  • 返回类型: Value
  • 修饰符:default

参数:

  • context: LootContext
  • attribute: EnvironmentAttribute

说明:

TODO

代码

public interface EnvironmentAttributeReader {
    EnvironmentAttributeReader EMPTY = new EnvironmentAttributeReader() {
        @Override
        public <Value> Value getDimensionValue(EnvironmentAttribute<Value> attribute) {
            return attribute.defaultValue();
        }
 
        @Override
        public <Value> Value getValue(EnvironmentAttribute<Value> attribute, Vec3 pos, @Nullable SpatialAttributeInterpolator biomeInterpolator) {
            return attribute.defaultValue();
        }
    };
 
    <Value> Value getDimensionValue(EnvironmentAttribute<Value> attribute);
 
    default <Value> Value getValue(EnvironmentAttribute<Value> attribute, BlockPos pos) {
        return this.getValue(attribute, Vec3.atCenterOf(pos));
    }
 
    default <Value> Value getValue(EnvironmentAttribute<Value> attribute, Vec3 pos) {
        return this.getValue(attribute, pos, null);
    }
 
    <Value> Value getValue(EnvironmentAttribute<Value> attribute, Vec3 pos, @Nullable SpatialAttributeInterpolator biomeInterpolator);
 
    default <Value> Value getValue(LootContext context, EnvironmentAttribute<Value> attribute) {
        return attribute.isPositional() ? this.getValue(attribute, context.getParameter(LootContextParams.ORIGIN)) : this.getDimensionValue(attribute);
    }
}

引用的其他类