Record Class PackOverlay
java.lang.Object
java.lang.Record
kr.toxicity.model.api.pack.PackOverlay
- Record Components:
packName- the name of the overlay (e.g., "legacy", "modern")range- the version range this overlay applies totester- a supplier to determine if this overlay should be active
- All Implemented Interfaces:
Comparable<PackOverlay>
public record PackOverlay(@NotNull String packName, @NotNull Optional<PackMeta.VersionRange> range, @NotNull BooleanSupplier tester)
extends Record
implements Comparable<PackOverlay>
Represents a resource pack overlay, allowing for version-specific resources.
Overlays are used to support multiple Minecraft versions within a single resource pack.
- Since:
- 1.15.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PackOverlayThe default overlay (base pack).static final PackOverlayThe legacy overlay (for older versions).static final PackOverlayThe modern overlay (for newer versions). -
Constructor Summary
ConstructorsConstructorDescriptionPackOverlay(@NotNull String packName, @NotNull Optional<PackMeta.VersionRange> range, @NotNull BooleanSupplier tester) Creates an instance of aPackOverlayrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull PackOverlay o) booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.@NotNull StringpackName()Returns the value of thepackNamerecord component.@NotNull PackPathGenerates the root path for this overlay.@NotNull Optional<PackMeta.VersionRange> range()Returns the value of therangerecord component.booleantest()Checks if this overlay is active.@NotNull BooleanSuppliertester()Returns the value of thetesterrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
-
LEGACY
-
MODERN
-
-
Constructor Details
-
PackOverlay
public PackOverlay(@NotNull @NotNull String packName, @NotNull @NotNull Optional<PackMeta.VersionRange> range, @NotNull @NotNull BooleanSupplier tester) Creates an instance of aPackOverlayrecord class.
-
-
Method Details
-
path
-
test
public boolean test()Checks if this overlay is active.- Returns:
- true if active, false otherwise
- Since:
- 1.15.2
-
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). -
hashCode
-
compareTo
- Specified by:
compareToin interfaceComparable<PackOverlay>
-
toString
-
packName
-
range
-
tester
-