Class Config

java.lang.Object
valorless.valorlessutils.config.Config

public class Config extends Object
YAML-backed configuration wrapper for ValorlessUtils and dependent plugins.

This class wraps YamlFile and exposes convenience getters/setters for common Bukkit and utility types, while also providing a lightweight validation mechanism to ensure that required keys exist in the configuration.

File lifecycle

Supported value types

In addition to primitive and boxed types that Bukkit/YAML supports by default, this wrapper includes helpers for:

  • Vector2 and Vector3 stored as nested keys (e.g. myVector.x, myVector.y, myVector.z).
  • Material stored by its Enum.name() value.
  • ItemStack stored using Bukkit's built-in serialization.
  • Lists (string/int/double and generic lists) using Bukkit's configuration API.

Validation

Validation entries can be registered via addValidationEntry(String, Object) (including vector overloads). When validate() runs, missing keys are added with their default values and the configuration is saved. reload() reloads the file content from disk.

Notes

  • Most setters update the in-memory configuration only; call saveConfig() to persist.
  • hasKey(String) and section accessors log errors and may return null when invoked with a null or empty key.