接口 Resource
-
- 所有超级接口:
AutoCloseable,Closeable
- 所有已知实现类:
ResourceImpl
public interface Resource extends Closeable
A resource of binary data.The resource must be closed before disposal to avoid resource leaks.
- 另请参阅:
ResourceFactory.getResource(Identifier),ResourceManager.getAllResources(Identifier)- Mappings:
Namespace Name official adkintermediary net/minecraft/class_3298named net/minecraft/resource/Resource
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 IdentifiergetId()Returns the location of this resource.InputStreamgetInputStream()Returns the input stream of this resource.<T> TgetMetadata(ResourceMetadataReader<T> metaReader)Returns a metadata of this resource by themetaReader, ornullif no such metadata exists.StringgetResourcePackName()Returns the user-friendly name of the pack this resource is from.booleanhasMetadata()Returns if this resource has any metadata.
-
-
-
方法详细资料
-
getId
Identifier getId()
Returns the location of this resource.Within each resource pack, this location is a unique identifer for a resource; however, in a resource manager, there may be multiple resources with the same location available.
- Mappings:
Namespace Name Mixin selector official aLadk;a()Lwp;intermediary method_14483Lnet/minecraft/class_3298;method_14483()Lnet/minecraft/class_2960;named getIdLnet/minecraft/resource/Resource;getId()Lnet/minecraft/util/Identifier;
-
getInputStream
InputStream getInputStream()
Returns the input stream of this resource.This input stream is closed when this resource is closed.
- Mappings:
Namespace Name Mixin selector official bLadk;b()Ljava/io/InputStream;intermediary method_14482Lnet/minecraft/class_3298;method_14482()Ljava/io/InputStream;named getInputStreamLnet/minecraft/resource/Resource;getInputStream()Ljava/io/InputStream;
-
hasMetadata
boolean hasMetadata()
Returns if this resource has any metadata.- Mappings:
Namespace Name Mixin selector official cLadk;c()Zintermediary method_14484Lnet/minecraft/class_3298;method_14484()Znamed hasMetadataLnet/minecraft/resource/Resource;hasMetadata()Z
-
getMetadata
@Nullable <T> T getMetadata(ResourceMetadataReader<T> metaReader)
Returns a metadata of this resource by themetaReader, ornullif no such metadata exists.- 参数:
metaReader- the metadata reader- Mappings:
Namespace Name Mixin selector official aLadk;a(Lacr;)Ljava/lang/Object;intermediary method_14481Lnet/minecraft/class_3298;method_14481(Lnet/minecraft/class_3270;)Ljava/lang/Object;named getMetadataLnet/minecraft/resource/Resource;getMetadata(Lnet/minecraft/resource/metadata/ResourceMetadataReader;)Ljava/lang/Object;
-
getResourcePackName
String getResourcePackName()
Returns the user-friendly name of the pack this resource is from.- Mappings:
Namespace Name Mixin selector official dLadk;d()Ljava/lang/String;intermediary method_14480Lnet/minecraft/class_3298;method_14480()Ljava/lang/String;named getResourcePackNameLnet/minecraft/resource/Resource;getResourcePackName()Ljava/lang/String;
-
-