Record Class Settings
java.lang.Object
java.lang.Record
dev.despical.pixelpainter.config.Settings
- Record Components:
maxHeight- maximum output block rowsmaxBlocks- maximum output pixel areamaxSourcePixels- maximum input image area before decodemaxFileBytes- maximum source or download byte countblocksPerTick- server-thread pixel or block processing budgetmaxChunks- maximum chunks reserved by one operationmaxHistory- maximum retained undo journalsmaxStoredBlocks- maximum total journal changesalphaThreshold- alpha cutoff for preserving terrainbackground- packed sRGB background for opaque compositingprogress- whether new jobs display a bossbarincluded- material allowlist; empty means all available entriesexcluded- material denylistdownloadHosts- 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 Summary
ConstructorsConstructorDescriptionSettings(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 aSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thealphaThresholdrecord component.intReturns the value of thebackgroundrecord component.intReturns the value of theblocksPerTickrecord component.Returns the value of thedownloadHostsrecord component.final booleanIndicates whether some other object is "equal to" this one.excluded()Returns the value of theexcludedrecord component.final inthashCode()Returns a hash code value for this object.included()Returns the value of theincludedrecord component.static SettingsLoads bounded settings and translates the legacy material allowlist if present.intReturns the value of themaxBlocksrecord component.intReturns the value of themaxChunksrecord component.intReturns the value of themaxFileBytesrecord component.intReturns the value of themaxHeightrecord component.intReturns the value of themaxHistoryrecord component.intReturns the value of themaxSourcePixelsrecord component.intReturns the value of themaxStoredBlocksrecord component.booleanprogress()Returns the value of theprogressrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aSettingsrecord class.- Parameters:
maxHeight- the value for themaxHeightrecord componentmaxBlocks- the value for themaxBlocksrecord componentmaxSourcePixels- the value for themaxSourcePixelsrecord componentmaxFileBytes- the value for themaxFileBytesrecord componentblocksPerTick- the value for theblocksPerTickrecord componentmaxChunks- the value for themaxChunksrecord componentmaxHistory- the value for themaxHistoryrecord componentmaxStoredBlocks- the value for themaxStoredBlocksrecord componentalphaThreshold- the value for thealphaThresholdrecord componentbackground- the value for thebackgroundrecord componentprogress- the value for theprogressrecord componentincluded- the value for theincludedrecord componentexcluded- the value for theexcludedrecord componentdownloadHosts- the value for thedownloadHostsrecord component
-
-
Method Details
-
load
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
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
maxHeight
-
maxBlocks
-
maxSourcePixels
public int maxSourcePixels()Returns the value of themaxSourcePixelsrecord component.- Returns:
- the value of the
maxSourcePixelsrecord component
-
maxFileBytes
public int maxFileBytes()Returns the value of themaxFileBytesrecord component.- Returns:
- the value of the
maxFileBytesrecord component
-
blocksPerTick
public int blocksPerTick()Returns the value of theblocksPerTickrecord component.- Returns:
- the value of the
blocksPerTickrecord component
-
maxChunks
-
maxHistory
public int maxHistory()Returns the value of themaxHistoryrecord component.- Returns:
- the value of the
maxHistoryrecord component
-
maxStoredBlocks
public int maxStoredBlocks()Returns the value of themaxStoredBlocksrecord component.- Returns:
- the value of the
maxStoredBlocksrecord component
-
alphaThreshold
public int alphaThreshold()Returns the value of thealphaThresholdrecord component.- Returns:
- the value of the
alphaThresholdrecord component
-
background
public int background()Returns the value of thebackgroundrecord component.- Returns:
- the value of the
backgroundrecord component
-
progress
-
included
-
excluded
-
downloadHosts
Returns the value of thedownloadHostsrecord component.- Returns:
- the value of the
downloadHostsrecord component
-