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 packEntry, Map<ResourceLocation, FallbackResourceManager.EntryStack> resources) private static IoSupplier
<ResourceMetadata> convertToMetadata
(IoSupplier<InputStream> streamSupplier) private static Resource
createResource
(PackResources source, ResourceLocation location, IoSupplier<InputStream> streamSupplier, IoSupplier<ResourceMetadata> metadataSupplier) private IoSupplier
<ResourceMetadata> createStackMetadataFinder
(ResourceLocation location, int fallbackIndex) (package private) static ResourceLocation
getMetadataLocation
(ResourceLocation location) getResource
(ResourceLocation location) private static ResourceLocation
getResourceLocationFromMetadata
(ResourceLocation metadataResourceLocation) getResourceStack
(ResourceLocation location) private static boolean
isMetadata
(ResourceLocation location) private void
listPackResources
(FallbackResourceManager.PackEntry entry, String path, Predicate<ResourceLocation> filter, Map<ResourceLocation, FallbackResourceManager.EntryStack> output) listResources
(String path, Predicate<ResourceLocation> filter) listResourceStacks
(String path, Predicate<ResourceLocation> filter) private static ResourceMetadata
parseMetadata
(IoSupplier<InputStream> streamSupplier) void
push
(PackResources resources) void
push
(PackResources resources, Predicate<ResourceLocation> filter) void
pushFilterOnly
(String name, Predicate<ResourceLocation> filter) private void
pushInternal
(String name, PackResources resources, Predicate<ResourceLocation> filter) private static IoSupplier
<InputStream> wrapForDebug
(ResourceLocation location, PackResources packResources, IoSupplier<InputStream> stream) 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 name, @Nullable PackResources resources, @Nullable Predicate<ResourceLocation> filter) -
getNamespaces
- Specified by:
getNamespaces
in interfaceResourceManager
-
getResource
- Specified by:
getResource
in interfaceResourceProvider
-
createResource
private static Resource createResource(PackResources source, ResourceLocation location, IoSupplier<InputStream> streamSupplier, IoSupplier<ResourceMetadata> metadataSupplier) -
wrapForDebug
private static IoSupplier<InputStream> wrapForDebug(ResourceLocation location, PackResources packResources, IoSupplier<InputStream> stream) -
getResourceStack
- Specified by:
getResourceStack
in interfaceResourceManager
-
isMetadata
-
getResourceLocationFromMetadata
private static ResourceLocation getResourceLocationFromMetadata(ResourceLocation metadataResourceLocation) -
getMetadataLocation
-
listResources
public Map<ResourceLocation,Resource> listResources(String path, Predicate<ResourceLocation> filter) - Specified by:
listResources
in interfaceResourceManager
-
createStackMetadataFinder
private IoSupplier<ResourceMetadata> createStackMetadataFinder(ResourceLocation location, int fallbackIndex) -
convertToMetadata
private static IoSupplier<ResourceMetadata> convertToMetadata(IoSupplier<InputStream> streamSupplier) -
parseMetadata
private static ResourceMetadata parseMetadata(IoSupplier<InputStream> streamSupplier) throws IOException - Throws:
IOException
-
applyPackFiltersToExistingResources
private static void applyPackFiltersToExistingResources(FallbackResourceManager.PackEntry packEntry, Map<ResourceLocation, FallbackResourceManager.EntryStack> resources) -
listPackResources
private void listPackResources(FallbackResourceManager.PackEntry entry, String path, Predicate<ResourceLocation> filter, Map<ResourceLocation, FallbackResourceManager.EntryStack> output) -
listResourceStacks
public Map<ResourceLocation,List<Resource>> listResourceStacks(String path, Predicate<ResourceLocation> filter) - Specified by:
listResourceStacks
in interfaceResourceManager
-
listPacks
- Specified by:
listPacks
in interfaceResourceManager
-