Record Class FileToIdConverter
java.lang.Object
java.lang.Record
net.minecraft.resources.FileToIdConverter
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFileToIdConverter(String prefix, String extension) Creates an instance of aFileToIdConverterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theextensionrecord component.booleanfileToId(Identifier file) final inthashCode()Returns a hash code value for this object.idToFile(Identifier id) static FileToIdConverterlistMatchingResources(ResourceManager manager) listMatchingResourcesFromNamespace(ResourceManager manager, String namespace) List all resources under the given namespace which match this converterlistMatchingResourceStacksFromNamespace(ResourceManager manager, String namespace) List all resource stacks under the given namespace which match this converterprefix()Returns the value of theprefixrecord component.static FileToIdConverterregistry(ResourceKey<? extends Registry<?>> registry) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
prefix
The field for theprefixrecord component. -
extension
The field for theextensionrecord component.
-
-
Constructor Details
-
FileToIdConverter
-
-
Method Details
-
json
-
registry
-
idToFile
-
fileToId
-
extensionMatches
-
listMatchingResources
-
listMatchingResourceStacks
-
listMatchingResourcesFromNamespace
public Map<Identifier, Resource> listMatchingResourcesFromNamespace(ResourceManager manager, String namespace) List all resources under the given namespace which match this converter- Parameters:
manager- The resource manager to collect the resources fromnamespace- The namespace to search under- Returns:
- All resources from the given namespace which match this converter
-
listMatchingResourceStacksFromNamespace
public Map<Identifier, List<Resource>> listMatchingResourceStacksFromNamespace(ResourceManager manager, String namespace) List all resource stacks under the given namespace which match this converter- Parameters:
manager- The resource manager to collect the resources fromnamespace- The namespace to search under- Returns:
- All resource stacks from the given namespace which match this converter
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
prefix
Returns the value of theprefixrecord component.- Returns:
- the value of the
prefixrecord component
-
extension
Returns the value of theextensionrecord component.- Returns:
- the value of the
extensionrecord component
-