ClientAsset.java

net.minecraft.core.ClientAsset

信息

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

    TODO

字段/常量

内部类/嵌套类型

  • net.minecraft.core.ClientAsset.DownloadedTexture

    • 类型: record
    • 修饰符: public
    • 源码定位: L12
    • 说明:

      TODO

  • net.minecraft.core.ClientAsset.ResourceTexture

    • 类型: record
    • 修饰符: public
    • 源码定位: L19
    • 说明:

      TODO

  • net.minecraft.core.ClientAsset.Texture

    • 类型: interface
    • 修饰符: public
    • 源码定位: L30
    • 说明:

      TODO

构造器

方法

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

Identifier id() @ L10

  • 方法名:id
  • 源码定位:L10
  • 返回类型:Identifier
  • 修饰符:package-private

参数:

说明:

TODO

代码

public interface ClientAsset {
    Identifier id();
 
    public record DownloadedTexture(Identifier texturePath, String url) implements ClientAsset.Texture {
        @Override
        public Identifier id() {
            return this.texturePath;
        }
    }
 
    public record ResourceTexture(Identifier id, Identifier texturePath) implements ClientAsset.Texture {
        public static final Codec<ClientAsset.ResourceTexture> CODEC = Identifier.CODEC.xmap(ClientAsset.ResourceTexture::new, ClientAsset.ResourceTexture::id);
        public static final MapCodec<ClientAsset.ResourceTexture> DEFAULT_FIELD_CODEC = CODEC.fieldOf("asset_id");
        public static final StreamCodec<ByteBuf, ClientAsset.ResourceTexture> STREAM_CODEC = Identifier.STREAM_CODEC
            .map(ClientAsset.ResourceTexture::new, ClientAsset.ResourceTexture::id);
 
        public ResourceTexture(Identifier texture) {
            this(texture, texture.withPath(path -> "textures/" + path + ".png"));
        }
    }
 
    public interface Texture extends ClientAsset {
        Identifier texturePath();
    }
}

引用的其他类