LevelTargetBundle.java

net.minecraft.client.renderer.LevelTargetBundle

信息

  • 全限定名:net.minecraft.client.renderer.LevelTargetBundle
  • 类型:public class
  • 包:net.minecraft.client.renderer
  • 源码路径:src/main/java/net/minecraft/client/renderer/LevelTargetBundle.java
  • 起始行号:L12
  • 实现:PostChain.TargetBundle
  • 职责:

    TODO

字段/常量

  • MAIN_TARGET_ID

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

      TODO

  • TRANSLUCENT_TARGET_ID

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

      TODO

  • ITEM_ENTITY_TARGET_ID

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

      TODO

  • PARTICLES_TARGET_ID

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

      TODO

  • WEATHER_TARGET_ID

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

      TODO

  • CLOUDS_TARGET_ID

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

      TODO

  • ENTITY_OUTLINE_TARGET_ID

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

      TODO

  • MAIN_TARGETS

    • 类型: Set<Identifier>
    • 修饰符: public static final
    • 源码定位: L20
    • 说明:

      TODO

  • OUTLINE_TARGETS

    • 类型: Set<Identifier>
    • 修饰符: public static final
    • 源码定位: L21
    • 说明:

      TODO

  • SORTING_TARGETS

    • 类型: Set<Identifier>
    • 修饰符: public static final
    • 源码定位: L22
    • 说明:

      TODO

  • main

    • 类型: ResourceHandle<RenderTarget>
    • 修饰符: public
    • 源码定位: L25
    • 说明:

      TODO

  • translucent

    • 类型: ResourceHandle<RenderTarget>
    • 修饰符: public
    • 源码定位: L26
    • 说明:

      TODO

  • itemEntity

    • 类型: ResourceHandle<RenderTarget>
    • 修饰符: public
    • 源码定位: L27
    • 说明:

      TODO

  • particles

    • 类型: ResourceHandle<RenderTarget>
    • 修饰符: public
    • 源码定位: L28
    • 说明:

      TODO

  • weather

    • 类型: ResourceHandle<RenderTarget>
    • 修饰符: public
    • 源码定位: L29
    • 说明:

      TODO

  • clouds

    • 类型: ResourceHandle<RenderTarget>
    • 修饰符: public
    • 源码定位: L30
    • 说明:

      TODO

  • entityOutline

    • 类型: ResourceHandle<RenderTarget>
    • 修饰符: public
    • 源码定位: L31
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

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

public void replace(Identifier id, ResourceHandle<RenderTarget> handle) @ L33

  • 方法名:replace
  • 源码定位:L33
  • 返回类型:void
  • 修饰符:public

参数:

  • id: Identifier
  • handle: ResourceHandle

说明:

TODO

public ResourceHandle<RenderTarget> get(Identifier id) @ L56

  • 方法名:get
  • 源码定位:L56
  • 返回类型:ResourceHandle
  • 修饰符:public

参数:

  • id: Identifier

说明:

TODO

public void clear() @ L75

  • 方法名:clear
  • 源码定位:L75
  • 返回类型:void
  • 修饰符:public

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class LevelTargetBundle implements PostChain.TargetBundle {
    public static final Identifier MAIN_TARGET_ID = PostChain.MAIN_TARGET_ID;
    public static final Identifier TRANSLUCENT_TARGET_ID = Identifier.withDefaultNamespace("translucent");
    public static final Identifier ITEM_ENTITY_TARGET_ID = Identifier.withDefaultNamespace("item_entity");
    public static final Identifier PARTICLES_TARGET_ID = Identifier.withDefaultNamespace("particles");
    public static final Identifier WEATHER_TARGET_ID = Identifier.withDefaultNamespace("weather");
    public static final Identifier CLOUDS_TARGET_ID = Identifier.withDefaultNamespace("clouds");
    public static final Identifier ENTITY_OUTLINE_TARGET_ID = Identifier.withDefaultNamespace("entity_outline");
    public static final Set<Identifier> MAIN_TARGETS = Set.of(MAIN_TARGET_ID);
    public static final Set<Identifier> OUTLINE_TARGETS = Set.of(MAIN_TARGET_ID, ENTITY_OUTLINE_TARGET_ID);
    public static final Set<Identifier> SORTING_TARGETS = Set.of(
        MAIN_TARGET_ID, TRANSLUCENT_TARGET_ID, ITEM_ENTITY_TARGET_ID, PARTICLES_TARGET_ID, WEATHER_TARGET_ID, CLOUDS_TARGET_ID
    );
    public ResourceHandle<RenderTarget> main = ResourceHandle.invalid();
    public @Nullable ResourceHandle<RenderTarget> translucent;
    public @Nullable ResourceHandle<RenderTarget> itemEntity;
    public @Nullable ResourceHandle<RenderTarget> particles;
    public @Nullable ResourceHandle<RenderTarget> weather;
    public @Nullable ResourceHandle<RenderTarget> clouds;
    public @Nullable ResourceHandle<RenderTarget> entityOutline;
 
    @Override
    public void replace(Identifier id, ResourceHandle<RenderTarget> handle) {
        if (id.equals(MAIN_TARGET_ID)) {
            this.main = handle;
        } else if (id.equals(TRANSLUCENT_TARGET_ID)) {
            this.translucent = handle;
        } else if (id.equals(ITEM_ENTITY_TARGET_ID)) {
            this.itemEntity = handle;
        } else if (id.equals(PARTICLES_TARGET_ID)) {
            this.particles = handle;
        } else if (id.equals(WEATHER_TARGET_ID)) {
            this.weather = handle;
        } else if (id.equals(CLOUDS_TARGET_ID)) {
            this.clouds = handle;
        } else {
            if (!id.equals(ENTITY_OUTLINE_TARGET_ID)) {
                throw new IllegalArgumentException("No target with id " + id);
            }
 
            this.entityOutline = handle;
        }
    }
 
    @Override
    public @Nullable ResourceHandle<RenderTarget> get(Identifier id) {
        if (id.equals(MAIN_TARGET_ID)) {
            return this.main;
        } else if (id.equals(TRANSLUCENT_TARGET_ID)) {
            return this.translucent;
        } else if (id.equals(ITEM_ENTITY_TARGET_ID)) {
            return this.itemEntity;
        } else if (id.equals(PARTICLES_TARGET_ID)) {
            return this.particles;
        } else if (id.equals(WEATHER_TARGET_ID)) {
            return this.weather;
        } else if (id.equals(CLOUDS_TARGET_ID)) {
            return this.clouds;
        } else {
            return id.equals(ENTITY_OUTLINE_TARGET_ID) ? this.entityOutline : null;
        }
    }
 
    public void clear() {
        this.main = ResourceHandle.invalid();
        this.translucent = null;
        this.itemEntity = null;
        this.particles = null;
        this.weather = null;
        this.clouds = null;
        this.entityOutline = null;
    }
}

引用的其他类

  • RenderTarget

    • 引用位置: 参数/字段/返回值
  • ResourceHandle

    • 引用位置: 参数/字段/方法调用/返回值
    • 关联成员: ResourceHandle.invalid()
  • PostChain

    • 引用位置: 实现
  • Identifier

    • 引用位置: 参数/字段/方法调用
    • 关联成员: Identifier.withDefaultNamespace()