Record Class Settings

java.lang.Object
java.lang.Record
dev.despical.mazeengine.config.Settings

public record Settings(int blocksPerTick, double millisPerTick, int maxConcurrent, int maxCells, long maxVolume, int maxChunks, int defaultCells, boolean protection, Set<String> replaceable, Map<String,Preset> presets, Messages messages, boolean preventMobSpawns, VisualSettings visuals, ProgressSettings progress) extends Record
Contains the validated configuration published for the running plugin.

The value groups tick budgets, concurrent-operation limits, grid and volume limits, terrain protection, replaceable materials, presets, messages, and visual and boss-bar settings. Loading validates all participating files before constructing the replacement value.

The plugin publishes the replacement only after loading succeeds, leaving the previous settings available if a reload fails. Loaded maps and sets are copied or exposed read-only. Existing maze records retain their saved presets rather than inheriting subsequent edits to this current configuration.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Settings(int blocksPerTick, double millisPerTick, int maxConcurrent, int maxCells, long maxVolume, int maxChunks, int defaultCells, boolean protection, Set<String> replaceable, Map<String,Preset> presets, Messages messages, boolean preventMobSpawns, VisualSettings visuals, ProgressSettings progress)
    Creates an instance of a Settings record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the blocksPerTick record component.
    int
    Returns the value of the defaultCells record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    static Settings
    load(Path directory)
     
    int
    Returns the value of the maxCells record component.
    int
    Returns the value of the maxChunks record component.
    int
    Returns the value of the maxConcurrent record component.
    long
    Returns the value of the maxVolume record component.
    Returns the value of the messages record component.
    double
    Returns the value of the millisPerTick record component.
    Returns the value of the presets record component.
    boolean
    Returns the value of the preventMobSpawns record component.
    Returns the value of the progress record component.
    boolean
    Returns the value of the protection record component.
    Returns the value of the replaceable record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the visuals record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Settings

      public Settings(int blocksPerTick, double millisPerTick, int maxConcurrent, int maxCells, long maxVolume, int maxChunks, int defaultCells, boolean protection, Set<String> replaceable, Map<String,Preset> presets, Messages messages, boolean preventMobSpawns, VisualSettings visuals, ProgressSettings progress)
      Creates an instance of a Settings record class.
      Parameters:
      blocksPerTick - the value for the blocksPerTick record component
      millisPerTick - the value for the millisPerTick record component
      maxConcurrent - the value for the maxConcurrent record component
      maxCells - the value for the maxCells record component
      maxVolume - the value for the maxVolume record component
      maxChunks - the value for the maxChunks record component
      defaultCells - the value for the defaultCells record component
      protection - the value for the protection record component
      replaceable - the value for the replaceable record component
      presets - the value for the presets record component
      messages - the value for the messages record component
      preventMobSpawns - the value for the preventMobSpawns record component
      visuals - the value for the visuals record component
      progress - the value for the progress record component
  • Method Details

    • load

      public static Settings load(Path directory) throws Exception
      Throws:
      Exception
    • 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.
    • blocksPerTick

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

      public double millisPerTick()
      Returns the value of the millisPerTick record component.
      Returns:
      the value of the millisPerTick record component
    • maxConcurrent

      public int maxConcurrent()
      Returns the value of the maxConcurrent record component.
      Returns:
      the value of the maxConcurrent record component
    • maxCells

      public int maxCells()
      Returns the value of the maxCells record component.
      Returns:
      the value of the maxCells record component
    • maxVolume

      public long maxVolume()
      Returns the value of the maxVolume record component.
      Returns:
      the value of the maxVolume record component
    • maxChunks

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

      public int defaultCells()
      Returns the value of the defaultCells record component.
      Returns:
      the value of the defaultCells record component
    • protection

      public boolean protection()
      Returns the value of the protection record component.
      Returns:
      the value of the protection record component
    • replaceable

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

      public Map<String,Preset> presets()
      Returns the value of the presets record component.
      Returns:
      the value of the presets record component
    • messages

      public Messages messages()
      Returns the value of the messages record component.
      Returns:
      the value of the messages record component
    • preventMobSpawns

      public boolean preventMobSpawns()
      Returns the value of the preventMobSpawns record component.
      Returns:
      the value of the preventMobSpawns record component
    • visuals

      public VisualSettings visuals()
      Returns the value of the visuals record component.
      Returns:
      the value of the visuals record component
    • progress

      public ProgressSettings progress()
      Returns the value of the progress record component.
      Returns:
      the value of the progress record component