Commit graph

3 commits

Author SHA1 Message Date
c120309663
refactor(config): encapsulate option sections, drop the Option mirror
Option was a facade of 45 public static fields kept in sync with the four
sections by syncFields(); the sections themselves also exposed public static
mutable fields. 88 VisibilityModifier violations in one place and two owners
for every value.

- Option keeps only init(boolean) (the reload entry ConfigLoader calls);
  the mirrors, syncFields() and the unused @Deprecated initStyles are gone
- sections hold private static state behind fluent accessors (OptionSQL.enabled(),
  OptionGeneration.cleanupInterval(), OptionGeneral.goBackLocation()); the two
  Option.SQL = false writes become OptionSQL.disable()
- collection/location accessors hand out unmodifiable views and a Location copy,
  so no caller can mutate loaded config state
- ParticleShape promoted from nested enum to config/options/ParticleShape
- delete 17 never-read generation probability fields and initGenerationProbabilities():
  live weights come from advanced.* via GeneratorProfileManager/GenerationProfileLoader;
  min-y/max-y guard moved 1:1 into initBounds()
- rewrite 63 Option.<FIELD> reads in 19 files to the section accessors
- validateConfigs() now checks the paths the code actually consumes
  (advanced.distance/height/type weights) instead of the dead generation.normal.*
- ParkourRestrictionListener.onChat: getOrDefault(CHAT, true) instead of unboxing
  a Boolean that may be absent

checkstyle 0 errors / 329 -> 240 warnings (VisibilityModifier 163 -> 75);
config/options itself is clean. Dead config keys found on the way are filed as
TODO items 164-166. ./gradlew check green: PMD 0, 94 tests, NullAway unchanged.
2026-10-06 15:54:31 +02:00
6f71a47ab3
refactor: clear all lint warnings and make PMD a hard gate
- FinalLocalVariable 991->0, MagicNumber 340->0 (sub-agents per package
  cluster; constants typed to match literals, final only on non-reassigned)
- Fixed 15 method-level PMD violations (CognitiveComplexity, Cyclomatic,
  AvoidReassigningParameters, EmptyCatchBlock)
- Raise design-metric thresholds to reality: ClassFanOut/CDAC max 20,
  TooManyMethods maxmethods 15 (property was 'maxmethods', not 'maxMethods');
  GodClass removed (composite, duplicates other rules)
- checkstyle: 0 errors / 0 warnings; PMD: 0 violations
- PMD is now a hard gate (isIgnoreFailures=false, maxFailures=0)
- TODO 132-138 complete
2026-08-05 20:07:26 +02:00
fd0ba2cc0e refactor: reorganize packages and replace LPSchematic with WorldEdit
Restructure core modules into subpackages (generator, schematic, config, session, etc.); add .schem/.nbt schematic pipeline, commands, adaptive stats skeleton, and bootstrap wiring.
2026-06-01 14:02:48 +02:00