Record Class Settings

java.lang.Object
java.lang.Record
dev.despical.pixelpainter.config.Settings
Record Components:
maxHeight - maximum output block rows
maxBlocks - maximum output pixel area
maxSourcePixels - maximum input image area before decode
maxFileBytes - maximum source or download byte count
blocksPerTick - server-thread pixel or block processing budget
maxChunks - maximum chunks reserved by one operation
maxHistory - maximum retained undo journals
maxStoredBlocks - maximum total journal changes
alphaThreshold - alpha cutoff for preserving terrain
background - packed sRGB background for opaque compositing
progress - whether new jobs display a bossbar
included - material allowlist; empty means all available entries
excluded - material denylist
downloadHosts - exact trusted HTTPS host names

public record Settings(int maxHeight, int maxBlocks, int maxSourcePixels, int maxFileBytes, int blocksPerTick, int maxChunks, int maxHistory, int maxStoredBlocks, int alphaThreshold, int background, boolean progress, Set<String> included, Set<String> excluded, Set<String> downloadHosts) extends Record
Captures validated operational limits and presentation settings for one load.

The loader bounds numeric inputs, checks value types and normalizes material and host names. Collections returned by the loader are immutable. Loading a legacy material allowlist creates a one-time sibling backup file.

This value contains no live Bukkit state. Preparations and world jobs retain their captured settings when a reload publishes another instance.

  • Constructor Details

    • Settings

      public Settings(int maxHeight, int maxBlocks, int maxSourcePixels, int maxFileBytes, int blocksPerTick, int maxChunks, int maxHistory, int maxStoredBlocks, int alphaThreshold, int background, boolean progress, Set<String> included, Set<String> excluded, Set<String> downloadHosts)
      Creates an instance of a Settings record class.
      Parameters:
      maxHeight - the value for the maxHeight record component
      maxBlocks - the value for the maxBlocks record component
      maxSourcePixels - the value for the maxSourcePixels record component
      maxFileBytes - the value for the maxFileBytes record component
      blocksPerTick - the value for the blocksPerTick record component
      maxChunks - the value for the maxChunks record component
      maxHistory - the value for the maxHistory record component
      maxStoredBlocks - the value for the maxStoredBlocks record component
      alphaThreshold - the value for the alphaThreshold record component
      background - the value for the background record component
      progress - the value for the progress record component
      included - the value for the included record component
      excluded - the value for the excluded record component
      downloadHosts - the value for the downloadHosts record component
  • Method Details

    • load

      public static Settings load(Path path) throws Exception
      Loads bounded settings and translates the legacy material allowlist if present.
      Parameters:
      path - configuration file
      Returns:
      validated settings with copied collections
      Throws:
      Exception - if YAML, value types, ranges or legacy backup creation fail
    • 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
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • maxHeight

      public int maxHeight()
      Returns the value of the maxHeight record component.
      Returns:
      the value of the maxHeight record component
    • maxBlocks

      public int maxBlocks()
      Returns the value of the maxBlocks record component.
      Returns:
      the value of the maxBlocks record component
    • maxSourcePixels

      public int maxSourcePixels()
      Returns the value of the maxSourcePixels record component.
      Returns:
      the value of the maxSourcePixels record component
    • maxFileBytes

      public int maxFileBytes()
      Returns the value of the maxFileBytes record component.
      Returns:
      the value of the maxFileBytes record component
    • blocksPerTick

      public int blocksPerTick()
      Returns the value of the blocksPerTick record component.
      Returns:
      the value of the blocksPerTick record component
    • maxChunks

      public int maxChunks()
      Returns the value of the maxChunks record component.
      Returns:
      the value of the maxChunks record component
    • maxHistory

      public int maxHistory()
      Returns the value of the maxHistory record component.
      Returns:
      the value of the maxHistory record component
    • maxStoredBlocks

      public int maxStoredBlocks()
      Returns the value of the maxStoredBlocks record component.
      Returns:
      the value of the maxStoredBlocks record component
    • alphaThreshold

      public int alphaThreshold()
      Returns the value of the alphaThreshold record component.
      Returns:
      the value of the alphaThreshold record component
    • background

      public int background()
      Returns the value of the background record component.
      Returns:
      the value of the background record component
    • progress

      public boolean progress()
      Returns the value of the progress record component.
      Returns:
      the value of the progress record component
    • included

      public Set<String> included()
      Returns the value of the included record component.
      Returns:
      the value of the included record component
    • excluded

      public Set<String> excluded()
      Returns the value of the excluded record component.
      Returns:
      the value of the excluded record component
    • downloadHosts

      public Set<String> downloadHosts()
      Returns the value of the downloadHosts record component.
      Returns:
      the value of the downloadHosts record component