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 to
tester - 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 Details

    • DEFAULT

      public static final PackOverlay DEFAULT
      The default overlay (base pack).
      Since:
      1.15.2
    • LEGACY

      public static final PackOverlay LEGACY
      The legacy overlay (for older versions).
      Since:
      1.15.2
    • MODERN

      public static final PackOverlay MODERN
      The modern overlay (for newer versions).
      Since:
      1.15.2
  • Constructor Details

    • PackOverlay

      public PackOverlay(@NotNull @NotNull String packName, @NotNull @NotNull Optional<PackMeta.VersionRange> range, @NotNull @NotNull BooleanSupplier tester)
      Creates an instance of a PackOverlay record class.
      Parameters:
      packName - the value for the packName record component
      range - the value for the range record component
      tester - the value for the tester record component
  • Method Details

    • path

      @NotNull public @NotNull PackPath path(@NotNull @NotNull String namespace)
      Generates the root path for this overlay.
      Parameters:
      namespace - the namespace prefix
      Returns:
      the pack path
      Since:
      1.15.2
    • test

      public boolean test()
      Checks if this overlay is active.
      Returns:
      true if active, false otherwise
      Since:
      1.15.2
    • equals

      public boolean equals(Object o)
      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 Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • compareTo

      public int compareTo(@NotNull @NotNull PackOverlay o)
      Specified by:
      compareTo in interface Comparable<PackOverlay>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • packName

      @NotNull public @NotNull String packName()
      Returns the value of the packName record component.
      Returns:
      the value of the packName record component
    • range

      @NotNull public @NotNull Optional<PackMeta.VersionRange> range()
      Returns the value of the range record component.
      Returns:
      the value of the range record component
    • tester

      @NotNull public @NotNull BooleanSupplier tester()
      Returns the value of the tester record component.
      Returns:
      the value of the tester record component