Class FallbackResourceManager
java.lang.Object
net.minecraft.server.packs.resources.FallbackResourceManager
- All Implemented Interfaces:
ResourceManager
,ResourceProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record
(package private) static class
(package private) static final record
(package private) static final record
Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.ResourceManager
ResourceManager.Empty
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final org.slf4j.Logger
private final String
private final PackType
Fields inherited from interface net.minecraft.server.packs.resources.ResourceProvider
EMPTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
applyPackFiltersToExistingResources
(FallbackResourceManager.PackEntry pPackEntry, Map<ResourceLocation, FallbackResourceManager.EntryStack> pResources) private static IoSupplier
<ResourceMetadata> convertToMetadata
(IoSupplier<InputStream> pStreamSupplier) private static Resource
createResource
(PackResources pSource, ResourceLocation pLocation, IoSupplier<InputStream> pStreamSupplier, IoSupplier<ResourceMetadata> pMetadataSupplier) private IoSupplier
<ResourceMetadata> createStackMetadataFinder
(ResourceLocation pLocation, int pFallbackIndex) (package private) static ResourceLocation
getMetadataLocation
(ResourceLocation pLocation) getResource
(ResourceLocation p_215419_) private static ResourceLocation
getResourceLocationFromMetadata
(ResourceLocation pMetadataResourceLocation) getResourceStack
(ResourceLocation p_215367_) private static boolean
isMetadata
(ResourceLocation pLocation) private void
listPackResources
(FallbackResourceManager.PackEntry pEntry, String pPath, Predicate<ResourceLocation> pFilter, Map<ResourceLocation, FallbackResourceManager.EntryStack> pOutput) listResources
(String p_215413_, Predicate<ResourceLocation> p_215414_) listResourceStacks
(String p_215416_, Predicate<ResourceLocation> p_215417_) private static ResourceMetadata
parseMetadata
(IoSupplier<InputStream> pStreamSupplier) void
push
(PackResources pResources) void
push
(PackResources pResources, Predicate<ResourceLocation> pFilter) void
pushFilterOnly
(String pName, Predicate<ResourceLocation> pFilter) private void
pushInternal
(String pName, PackResources pResources, Predicate<ResourceLocation> pFilter) private static IoSupplier
<InputStream> wrapForDebug
(ResourceLocation pLocation, PackResources pPackResources, IoSupplier<InputStream> pStream) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.server.packs.resources.ResourceProvider
getResourceOrThrow, open, openAsReader
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
fallbacks
-
type
-
namespace
-
-
Constructor Details
-
FallbackResourceManager
-
-
Method Details
-
push
-
push
-
pushFilterOnly
-
pushInternal
private void pushInternal(String pName, @Nullable PackResources pResources, @Nullable Predicate<ResourceLocation> pFilter) -
getNamespaces
- Specified by:
getNamespaces
in interfaceResourceManager
-
getResource
- Specified by:
getResource
in interfaceResourceProvider
-
createResource
private static Resource createResource(PackResources pSource, ResourceLocation pLocation, IoSupplier<InputStream> pStreamSupplier, IoSupplier<ResourceMetadata> pMetadataSupplier) -
wrapForDebug
private static IoSupplier<InputStream> wrapForDebug(ResourceLocation pLocation, PackResources pPackResources, IoSupplier<InputStream> pStream) -
getResourceStack
- Specified by:
getResourceStack
in interfaceResourceManager
-
isMetadata
-
getResourceLocationFromMetadata
private static ResourceLocation getResourceLocationFromMetadata(ResourceLocation pMetadataResourceLocation) -
getMetadataLocation
-
listResources
public Map<ResourceLocation,Resource> listResources(String p_215413_, Predicate<ResourceLocation> p_215414_) - Specified by:
listResources
in interfaceResourceManager
-
createStackMetadataFinder
private IoSupplier<ResourceMetadata> createStackMetadataFinder(ResourceLocation pLocation, int pFallbackIndex) -
convertToMetadata
private static IoSupplier<ResourceMetadata> convertToMetadata(IoSupplier<InputStream> pStreamSupplier) -
parseMetadata
private static ResourceMetadata parseMetadata(IoSupplier<InputStream> pStreamSupplier) throws IOException - Throws:
IOException
-
applyPackFiltersToExistingResources
private static void applyPackFiltersToExistingResources(FallbackResourceManager.PackEntry pPackEntry, Map<ResourceLocation, FallbackResourceManager.EntryStack> pResources) -
listPackResources
private void listPackResources(FallbackResourceManager.PackEntry pEntry, String pPath, Predicate<ResourceLocation> pFilter, Map<ResourceLocation, FallbackResourceManager.EntryStack> pOutput) -
listResourceStacks
public Map<ResourceLocation,List<Resource>> listResourceStacks(String p_215416_, Predicate<ResourceLocation> p_215417_) - Specified by:
listResourceStacks
in interfaceResourceManager
-
listPacks
- Specified by:
listPacks
in interfaceResourceManager
-