类 PathPackResources
java.lang.Object
net.minecraft.server.packs.AbstractPackResources
net.minecraftforge.resource.PathPackResources
- 所有已实现的接口:
AutoCloseable
,PackResources
,IForgePackResources
Defines a resource pack from an arbitrary Path.
This is primarily intended to support including optional resource packs inside a mod, such as to have alternative textures to use along with Programmer Art, or optional alternative recipes for compatibility ot to replace vanilla recipes.
-
嵌套类概要
从接口继承的嵌套类/接口 net.minecraft.server.packs.PackResources
PackResources.ResourceOutput
-
字段概要
字段从接口继承的字段 net.minecraft.server.packs.PackResources
METADATA_EXTENSION, PACK_META
-
构造器概要
构造器构造器说明PathPackResources
(String packId, boolean isBuiltin, Path source) Constructs a java.nio.Path-based resource pack. -
方法概要
修饰符和类型方法说明void
close()
getNamespaces
(PackType type) private static String[]
getPathFromLocation
(PackType type, ResourceLocation location) getResource
(PackType type, ResourceLocation location) @Nullable IoSupplier<InputStream>
getRootResource
(String... paths) Returns the source path containing the resource pack.void
listResources
(PackType type, String namespace, String path, PackResources.ResourceOutput resourceOutput) protected Path
Implement to return a file or folder path for the given set of path components.toString()
从类继承的方法 net.minecraft.server.packs.AbstractPackResources
getMetadataFromStream, getMetadataSection, isBuiltin, packId
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 net.minecraftforge.common.extensions.IForgePackResources
getChildren, isHidden
-
字段详细资料
-
LOGGER
private static final org.slf4j.Logger LOGGER -
source
-
-
构造器详细资料
-
PathPackResources
Constructs a java.nio.Path-based resource pack.- 参数:
packId
- the identifier of the pack. This identifier should be unique within the pack finder, preferably the name of the file or folder containing the resources.isBuiltin
- whether this pack resources should be considered builtinsource
- the root path of the pack. This needs to point to the folder that contains "assets" and/or "data", not the asset folder itself!
-
-
方法详细资料
-
getSource
Returns the source path containing the resource pack. This is used for error display.- 返回:
- the root path of the resources.
-
resolve
Implement to return a file or folder path for the given set of path components.- 参数:
paths
- One or more path strings to resolve. Can include slash-separated paths.- 返回:
- the resulting path, which may not exist.
-
getRootResource
-
listResources
public void listResources(PackType type, String namespace, String path, PackResources.ResourceOutput resourceOutput) -
getNamespaces
-
getNamespacesFromDisk
-
getResource
-
getPathFromLocation
-
close
public void close() -
toString
- 覆盖:
toString
在类中AbstractPackResources
-