Package foundry.veil.api.resource
Record Class VeilResourceInfo
java.lang.Object
java.lang.Record
foundry.veil.api.resource.VeilResourceInfo
- Record Components:
location- The resource location path this resource is located atfilePath- The file path of this resourcemodResourcePath- The path to this resource in the build folder if in a dev environment- Whether this resource should appear in the resource panel
public record VeilResourceInfo(net.minecraft.server.packs.PackType packType, net.minecraft.resources.ResourceLocation location, Path filePath, @Nullable Path modResourcePath, boolean hidden)
extends Record
Information about a specific Veil resource.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionVeilResourceInfo(net.minecraft.server.packs.PackType packType, net.minecraft.resources.ResourceLocation location, Path filePath, @Nullable Path modResourcePath, boolean hidden) Creates an instance of aVeilResourceInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fileName()filePath()Returns the value of thefilePathrecord component.Optional<net.minecraft.server.packs.resources.Resource> getResource(VeilResourceManager resourceManager) net.minecraft.server.packs.resources.ResourcegetResourceOrThrow(VeilResourceManager resourceManager) final inthashCode()Returns a hash code value for this object.booleanhidden()Returns the value of thehiddenrecord component.booleanisStatic()net.minecraft.resources.ResourceLocationlocation()Returns the value of thelocationrecord component.@Nullable PathReturns the value of themodResourcePathrecord component.open(VeilResourceManager resourceManager) openAsReader(VeilResourceManager resourceManager) net.minecraft.server.packs.PackTypepackType()Returns the value of thepackTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
VeilResourceInfo
public VeilResourceInfo(net.minecraft.server.packs.PackType packType, net.minecraft.resources.ResourceLocation location, Path filePath, @Nullable @Nullable Path modResourcePath, boolean hidden) Creates an instance of aVeilResourceInforecord class.- Parameters:
packType- the value for thepackTyperecord componentlocation- the value for thelocationrecord componentfilePath- the value for thefilePathrecord componentmodResourcePath- the value for themodResourcePathrecord componenthidden- the value for thehiddenrecord component
-
-
Method Details
-
getResource
public Optional<net.minecraft.server.packs.resources.Resource> getResource(VeilResourceManager resourceManager) -
getResourceOrThrow
public net.minecraft.server.packs.resources.Resource getResourceOrThrow(VeilResourceManager resourceManager) throws FileNotFoundException - Throws:
FileNotFoundException
-
open
- Throws:
IOException
-
openAsReader
- Throws:
IOException
-
fileName
- Returns:
- The file name of this resource
-
isStatic
public boolean isStatic()- Returns:
- If this file cannot be accessed by the native file system
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
packType
public net.minecraft.server.packs.PackType packType()Returns the value of thepackTyperecord component.- Returns:
- the value of the
packTyperecord component
-
location
public net.minecraft.resources.ResourceLocation location()Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-
filePath
Returns the value of thefilePathrecord component.- Returns:
- the value of the
filePathrecord component
-
modResourcePath
Returns the value of themodResourcePathrecord component.- Returns:
- the value of the
modResourcePathrecord component
-