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 pPackEntry, Map<ResourceLocation, FallbackResourceManager.EntryStack> pResources) private static IoSupplier<ResourceMetadata> convertToMetadata(IoSupplier<InputStream> pStreamSupplier) private static ResourcecreateResource(PackResources pSource, ResourceLocation pLocation, IoSupplier<InputStream> pStreamSupplier, IoSupplier<ResourceMetadata> pMetadataSupplier) private IoSupplier<ResourceMetadata> createStackMetadataFinder(ResourceLocation pLocation, int pFallbackIndex) (package private) static ResourceLocationgetMetadataLocation(ResourceLocation pLocation) getResource(ResourceLocation pLocation) private static ResourceLocationgetResourceLocationFromMetadata(ResourceLocation pMetadataResourceLocation) getResourceStack(ResourceLocation pLocation) private static booleanisMetadata(ResourceLocation pLocation) private voidlistPackResources(FallbackResourceManager.PackEntry pEntry, String pPath, Predicate<ResourceLocation> pFilter, Map<ResourceLocation, FallbackResourceManager.EntryStack> pOutput) listResources(String pPath, Predicate<ResourceLocation> pFilter) listResourceStacks(String pPath, Predicate<ResourceLocation> pFilter) private static ResourceMetadataparseMetadata(IoSupplier<InputStream> pStreamSupplier) voidpush(PackResources pResources) voidpush(PackResources pResources, Predicate<ResourceLocation> pFilter) voidpushFilterOnly(String pName, Predicate<ResourceLocation> pFilter) private voidpushInternal(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, 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 pName, @Nullable PackResources pResources, @Nullable Predicate<ResourceLocation> pFilter) -
getNamespaces
- Specified by:
getNamespacesin interfaceResourceManager
-
getResource
- Specified by:
getResourcein 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:
getResourceStackin interfaceResourceManager
-
isMetadata
-
getResourceLocationFromMetadata
private static ResourceLocation getResourceLocationFromMetadata(ResourceLocation pMetadataResourceLocation) -
getMetadataLocation
-
listResources
public Map<ResourceLocation,Resource> listResources(String pPath, Predicate<ResourceLocation> pFilter) - Specified by:
listResourcesin 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 pPath, Predicate<ResourceLocation> pFilter) - Specified by:
listResourceStacksin interfaceResourceManager
-
listPacks
- Specified by:
listPacksin interfaceResourceManager
-