Class FallbackResourceManager
java.lang.Object
net.minecraft.server.packs.resources.FallbackResourceManager
- All Implemented Interfaces:
ResourceManager, ResourceProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordprivate static classprivate static final recordprivate static final recordNested classes/interfaces inherited from interface ResourceManager
ResourceManager.Empty -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate final Stringprivate final PackTypeFields inherited from interface ResourceProvider
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidapplyPackFiltersToExistingResources(FallbackResourceManager.PackEntry entry, Map<Identifier, FallbackResourceManager.EntryStack> foundResources) private static IoSupplier<ResourceMetadata> convertToMetadata(IoSupplier<InputStream> input) private static ResourcecreateResource(PackResources source, Identifier location, IoSupplier<InputStream> resource, IoSupplier<ResourceMetadata> metadata) private IoSupplier<ResourceMetadata> createStackMetadataFinder(Identifier location, int finalPackIndex) private static IdentifiergetIdentifierFromMetadata(Identifier identifier) private static IdentifiergetMetadataLocation(Identifier identifier) getResource(Identifier location) getResourceStack(Identifier location) private static booleanisMetadata(Identifier location) private voidlistPackResources(FallbackResourceManager.PackEntry entry, String directory, Predicate<Identifier> filter, Map<Identifier, FallbackResourceManager.EntryStack> foundResources) listResources(String directory, Predicate<Identifier> filter) listResourceStacks(String directory, Predicate<Identifier> filter) private static ResourceMetadataparseMetadata(IoSupplier<InputStream> input) voidpush(PackResources pack) voidpush(PackResources pack, Predicate<Identifier> filter) voidpushFilterOnly(String name, Predicate<Identifier> filter) private voidpushInternal(String name, @Nullable PackResources pack, @Nullable Predicate<Identifier> contentFilter) private static IoSupplier<InputStream> wrapForDebug(Identifier location, PackResources source, IoSupplier<InputStream> resource) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResourceProvider
getResourceOrThrow, open, openAsReader
-
Field Details
-
LOGGER
private 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 pack, @Nullable Predicate<Identifier> contentFilter) -
getNamespaces
- Specified by:
getNamespacesin interfaceResourceManager
-
getResource
- Specified by:
getResourcein interfaceResourceProvider
-
createResource
private static Resource createResource(PackResources source, Identifier location, IoSupplier<InputStream> resource, IoSupplier<ResourceMetadata> metadata) -
wrapForDebug
private static IoSupplier<InputStream> wrapForDebug(Identifier location, PackResources source, IoSupplier<InputStream> resource) -
getResourceStack
- Specified by:
getResourceStackin interfaceResourceManager
-
isMetadata
-
getIdentifierFromMetadata
-
getMetadataLocation
-
listResources
- Specified by:
listResourcesin interfaceResourceManager
-
createStackMetadataFinder
private IoSupplier<ResourceMetadata> createStackMetadataFinder(Identifier location, int finalPackIndex) -
convertToMetadata
-
parseMetadata
- Throws:
IOException
-
applyPackFiltersToExistingResources
private static void applyPackFiltersToExistingResources(FallbackResourceManager.PackEntry entry, Map<Identifier, FallbackResourceManager.EntryStack> foundResources) -
listPackResources
private void listPackResources(FallbackResourceManager.PackEntry entry, String directory, Predicate<Identifier> filter, Map<Identifier, FallbackResourceManager.EntryStack> foundResources) -
listResourceStacks
public Map<Identifier, List<Resource>> listResourceStacks(String directory, Predicate<Identifier> filter) - Specified by:
listResourceStacksin interfaceResourceManager
-
listPacks
- Specified by:
listPacksin interfaceResourceManager
-