UiLightmap.java

net.minecraft.client.renderer.UiLightmap

信息

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

    TODO

字段/常量

  • texture
    • 类型: DynamicTexture
    • 修饰符: private final
    • 源码定位: L11
    • 说明:

      TODO

内部类/嵌套类型

构造器

public UiLightmap() @ L13

  • 构造器名:UiLightmap
  • 源码定位:L13
  • 修饰符:public

参数:

说明:

TODO

方法

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

public GpuTextureView getTextureView() @ L19

  • 方法名:getTextureView
  • 源码定位:L19
  • 返回类型:GpuTextureView
  • 修饰符:public

参数:

说明:

TODO

public void close() @ L23

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

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class UiLightmap implements AutoCloseable {
    private final DynamicTexture texture = new DynamicTexture("UI Lightmap", 1, 1, false);
 
    public UiLightmap() {
        NativeImage pixels = this.texture.getPixels();
        pixels.setPixel(0, 0, -1);
        this.texture.upload();
    }
 
    public GpuTextureView getTextureView() {
        return this.texture.getTextureView();
    }
 
    @Override
    public void close() {
        this.texture.close();
    }
}

引用的其他类