Record Class PackContentType
java.lang.Object
java.lang.Record
net.darkhax.openloader.common.impl.packs.PackContentType
- Record Components:
data- If the pack contains data.resources- If the pack contains data.
Determines the type of contents held by a given pack. A pack may contain data, resources, both, or neither.
-
Constructor Summary
ConstructorsConstructorDescriptionPackContentType(boolean data, boolean resources) Creates an instance of aPackContentTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleandata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.static PackContentTypeDetermines the content types of a given file.final inthashCode()Returns a hash code value for this object.booleanisFor(net.minecraft.server.packs.PackType type) Checks if the pack contains content for a given pack type.booleanReturns the value of theresourcesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
isFor
public boolean isFor(net.minecraft.server.packs.PackType type) Checks if the pack contains content for a given pack type. For example if the pack contains resource pack files, or data pack files.- Parameters:
type- The pack type to check for.- Returns:
- If the pack contains contents for the given pack type.
-
from
Determines the content types of a given file.- Parameters:
filePath- The path to the pack file.- Returns:
- The content types of the pack.
-
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. All components in this record class are compared with '=='. -
data
public boolean data()Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
resources
public boolean resources()Returns the value of theresourcesrecord component.- Returns:
- the value of the
resourcesrecord component
-