LoParkour/docs/SCHEMATICS.md
loki5512344 b6712391fd
fix(lint,command,scheduler): lpk alias, ReturnCount/IllegalCatch triage, scheduler facade
- command: replace /lp alias with /lpk (LuckPerms conflict, p.144);
  parkour alias kept; docs/changelog/javadoc updated
- lint p.169: restructure last 69 void early-returns into if-blocks and
  helpers; ReturnCount is now an error gate (0 violations)
- lint p.170: Throwable->RuntimeException on 3 boundaries; narrow 5
  catches to concrete types; document 14 intentional boundary catches
- scheduler p.21: add runTimerAsync to the facade (Bukkit + Folia
  backends); MetricsCacheStore and duels go through the facade, no
  BukkitRunnable/Bukkit.getScheduler outside scheduler/ (archunit
  freeze-store emptied); drop the unverified Folia badge from README
- tracker: mark p.26-29/32-33 done (fixed in fea15e6, verified)
2026-10-10 14:52:10 +02:00

79 lines
3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Parkour schematics (LoParkour)
Jump structures are loaded from `plugins/LoParkour/schematics/` and matched to a **difficulty** in `plugins/LoParkour/schematics/schematics.yml`.
## Supported file types
| Extension | Source | Notes |
|-----------|--------|--------|
| `.nbt` | Vanilla structure block, `/structure save` | Pasted with Bukkit `StructureManager` |
| `.schem`, `.schematic` | WorldEdit (`//copy`, `//schem save`) | Read via embedded WorldEdit clipboard IO |
| `.lpschem` | **Legacy LoParkour format** | Not used in-game; convert with `/lpk schematic convert` |
During parkour generation, when the profile rolls **schematic** type, the plugin picks a random file whose `difficulty` in YAML is **≤** the player's schematic setting (0.0–1.0).
## Difficulty keys (`schematics.yml`)
```yaml
difficulty:
d0e227d2: 0.25 # short id (recommended)
```
For file `parkour-d0e227d2.schem` you can use key `d0e227d2` or the full stem `parkour-d0e227d2`.
Player setting **0.25 (easy)** → only structures with difficulty ≤ 0.25.
**1.0** → any structure.
## Creating schematics in-game (admin)
1. Get the wand: `/lpk schematic wand`
2. **Left-click** = position 1, **right-click** = position 2 (or use `/lpk schematic pos1` / `pos2`)
3. Save and register:
- `/lpk create <difficulty>` — auto name `parkour-<hash>.schem` + YAML entry
- `/lpk schematic create <difficulty>` — same
- `/lpk schematic create <name> <difficulty>` — custom name (letters, numbers, `-`, `_`)
Difficulty examples: `0.25`, `0.5`, `0.75`, `1.0` (must be between 0 and 1).
4. `/lpk schematic reload` — reload files without restart
## Converting old `.lpschem` files
Place `.lpschem` files in `plugins/LoParkour/schematics/` or legacy `schematics-new/`, then:
```
/lpk schematic convert
```
Each file becomes `parkour-<id>.schem` in `schematics/` and gets a `difficulty:` entry (from the old metadata, or `0.5` if missing). Original `.lpschem` files are kept; delete them manually after checking.
## Admin commands
| Command | Description |
|---------|-------------|
| `/lpk schematic wand` | Selection wand |
| `/lpk schematic pos1` / `pos2` | Set corners at your feet |
| `/lpk create <difficulty>` | Save selection → `.schem` + YAML |
| `/lpk schematic create <name> <difficulty>` | Save with custom name |
| `/lpk schematic convert` | Convert all `.lpschem` in schematics folders |
| `/lpk schematic list` | List loaded structures |
| `/lpk schematic paste <name>` | Test-paste at your location |
| `/lpk schematic reload` | Reload disk files |
## Flow (runtime)
```mermaid
flowchart LR
A[BlockPlacer SCHEMATIC roll] --> B[SchematicManager.pick]
B --> C{Format}
C -->|nbt| D[Structure.place]
C -->|schem| E[Clipboard paste]
D --> F[Track blocks / score]
E --> F
```
## Folders
- `plugins/LoParkour/schematics/` — `.nbt`, `.schem`, `.schematic` (active)
- `plugins/LoParkour/schematics/schematics.yml` — difficulty map
- `plugins/LoParkour/schematics-new/` — legacy; scanned only for `.lpschem` convert