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 recordNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.ResourceManager
ResourceManager.Empty -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final org.slf4j.Loggerprivate final Stringprivate final PackTypeFields inherited from interface net.minecraft.server.packs.resources.ResourceProvider
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidapplyPackFiltersToExistingResources(FallbackResourceManager.PackEntry packEntry, Map<ResourceLocation, FallbackResourceManager.EntryStack> resources) private static IoSupplier<ResourceMetadata> convertToMetadata(IoSupplier<InputStream> streamSupplier) private static ResourcecreateResource(PackResources source, ResourceLocation location, IoSupplier<InputStream> streamSupplier, IoSupplier<ResourceMetadata> metadataSupplier) private IoSupplier<ResourceMetadata> createStackMetadataFinder(ResourceLocation location, int fallbackIndex) (package private) static ResourceLocationgetMetadataLocation(ResourceLocation location) getResource(ResourceLocation location) private static ResourceLocationgetResourceLocationFromMetadata(ResourceLocation metadataResourceLocation) getResourceStack(ResourceLocation location) private static booleanisMetadata(ResourceLocation location) private voidlistPackResources(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 ResourceMetadataparseMetadata(IoSupplier<InputStream> streamSupplier) voidpush(PackResources resources) voidpush(PackResources resources, Predicate<ResourceLocation> filter) voidpushFilterOnly(String name, Predicate<ResourceLocation> filter) private voidpushInternal(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, waitMethods 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:
getNamespacesin interfaceResourceManager
-
getResource
- Specified by:
getResourcein 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:
getResourceStackin interfaceResourceManager
-
isMetadata
-
getResourceLocationFromMetadata
private static ResourceLocation getResourceLocationFromMetadata(ResourceLocation metadataResourceLocation) -
getMetadataLocation
-
listResources
public Map<ResourceLocation,Resource> listResources(String path, Predicate<ResourceLocation> filter) - Specified by:
listResourcesin 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:
listResourceStacksin interfaceResourceManager
-
listPacks
- Specified by:
listPacksin interfaceResourceManager
-