Commit graph

12 commits

Author SHA1 Message Date
a0c1ab8ca1
chore: unify checkstyle, fix violations, cleanup bin/ 2026-07-12 00:59:11 +02:00
ceb4c804b7 refactor: Java 21 support, config/API updates, GUI polish 2026-06-10 23:18:10 +02:00
bfdf197de4 fix: restore full WorldGuard flags support, default only block-break=allow 2026-06-01 11:52:19 +02:00
b80fefa6a4 fix: move example config to resources, simplify WG to block-break only, fix teleport for stuck players only, add messages.yml 2026-06-01 11:46:28 +02:00
f2be6d6ece feat: add example mine config, &#RRGGBB color support, up to 100 selection points 2026-06-01 11:38:53 +02:00
0f2735f171 feat: add multiple region support for mines 2026-06-01 11:26:54 +02:00
11f31e5b7a Add Holograms integration and Sub-GUI editors
Holograms:
- HologramManager with auto-detection of HolographicDisplays/DecentHolograms
- HologramProvider interface and implementations
- HologramConfig for per-mine configuration
- /lm hologram <mine> [on|off] command
- Updates every second showing mine name, fill %, progress bar, and timer

Sub-GUI Editors:
- BlocksGui - edit block weights with +/- clicks
- BlockMaterialSelectionGui - paginated material picker
- ResetGui - configure reset interval, percent trigger, message, commands
- RewardsGui - manage reward entries
- All holders moved to gui/mine/holder/
- Editors moved to gui/mine/edit/
- Main GUI (MineEditGui) moved to gui/mine/main/

Package structure reorganized to maintain max 6 files per folder.
2026-06-01 10:38:00 +02:00
1b85bc5329 Refactor: Restructure packages to follow KISS/SOLID principles - gui reorganized into mine/group/confirm/common, core into mine/service/common, command into admin/player/common, data/config/loader into block/entity/region/reward/system. All packages now follow max 6 files per folder rule. Extracted utility classes to reduce file sizes. 2026-06-01 00:04:56 +02:00
bb2e47a917 Add player-spawn config for stuck players and limit teleport height
- Add PlayerSpawnConfig for separate spawn location when players are stuck in blocks
- Add PlayerSpawnConfigLoader for YAML parsing
- Update MineConfig with playerSpawn section and getSpawnForStuckPlayer() helper
- Update ConfigLoader to include playerSpawn configuration
- Update MineFileManager to preserve playerSpawn when saving
- Update MineResetHandler.teleportPlayers() to use player-spawn location
- Update defaults.yml with player-spawn documentation

- Limit findSafeTeleportLocation() to max 3 blocks upward search
  - Priority: same level nearby, then up (max 3), then down, then diagonal
  - Prevents teleporting players too high in the air

If player-spawn is not configured, falls back to teleport.location for backward compatibility.
2026-05-31 23:03:40 +02:00
3ba6f303f8 Add WorldGuard auto-region creation and split ConfigLoader
- Add WorldGuardConfig with template-based naming ({mine_name}_{random_4}, etc.)
- Add WorldGuardRegionService for creating/updating/deleting WG regions
- Add WorldGuardConfigLoader for parsing WG config from YAML
- Add configurable flags, owners, members for WG regions
- Update MineConfig to include worldGuard section
- Update Mines.java to create/delete WG regions on mine create/delete
- Update MineFileManager to load WG defaults from defaults.yml
- Split ConfigLoader into specialized loaders:
  - BlockConfigLoader, RegionConfigLoader, ResetConfigLoader
  - RewardConfigLoader, TeleportConfigLoader, UIConfigLoader
- Reduce ConfigLoader from 427 lines to 151 lines
- Update defaults.yml with WorldGuard configuration section
2026-05-31 22:39:01 +02:00
f1060f34d4 refactor(config): complete rewrite of configuration system
BREAKING CHANGE: New section-based configuration format

New Features:
- Type-safe BlockKey sealed interface (Vanilla, Oraxen, ItemsAdder)
- Section-based config: RegionConfig, BlockConfig, ResetConfig, RewardConfig, UIConfig, TeleportConfig
- Human-readable durations: 5m, 30s, 2h, 1d
- YAML inheritance from defaults.yml
- MiniMessage support for action bar and item names
- Immutable config records with validation

Removed:
- Legacy MineConfig (17-field god object)
- ConfigParser, ConfigValidator, ConfigSerializer split classes
- Legacy FillMode enum (replaced with better version)
- Old ConfigLoader with complex parsing logic

New Files:
- data/config/block/BlockKey.java - sealed interface for block types
- data/config/block/BlockConfig.java - type-safe block weights
- data/config/block/FillMode.java - fill strategies
- data/config/region/RegionConfig.java - region management
- data/config/reset/ResetConfig.java - reset behavior with Duration
- data/config/reward/RewardConfig.java - rewards with ItemReward
- data/config/teleport/TeleportConfig.java - teleport on reset
- data/config/ui/UIConfig.java - action bar and messages
- data/config/MineConfig.java - composed from sections
- data/config/ConfigLoader.java - clean loader with defaults inheritance
- defaults.yml - default configuration template

Tests:
- BlockKeyTest.java - serialization/deserialization
- BlockConfigTest.java - weight normalization, validation
- ResetConfigTest.java - duration parsing, defaults
- UIConfigTest.java - timer formatting, action bar
- MineConfigTest.java - builder, defaults, validation
2026-05-31 21:57:10 +02:00
f4e9458544 refactor: migrate package from com.loki to dev.loki
- Change base package from com.loki to dev.loki across all Java files
- Update plugin.yml main class path
- Fix ConfigParseException imports in test files
- Update build.gradle.kts relocate patterns
- Add missing imports in ConfigLoaderTest.java
- Update TODO.md with current status

BREAKING CHANGE: Package namespace changed from com.loki to dev.loki
2026-05-31 21:34:44 +02:00