Feature Plan: Placement Inspector Tool
Summary
- Owner: Yuna (review: Freddi)
- Status: Implementation (edit-session teleport alpha)
- Backlog Link:
docs/agendas/uebliche.md→ 📥 Inbox (Schematic Placement Bearbeitungstool) - Target Release: 2025.11.x (after overlay rollout hardening)
Goals
- Give builders a single “Placement Inspector” item that visualises all schematic placements inside editor instances without needing debug commands.
- Provide contextual actions (edit, duplicate, delete, overlay switch) via a right-click dialog on the highlighted placement.
- When “Edit Schematic” is chosen, teleport the builder into a dedicated editing instance containing only that schematic, keeping their relative offset/orientation intact so it feels seamless.
- Ensure every action is audit logged and respects overlay/base-layer separation.
Non-Goals
- Replacing the existing
/overlaycommand set (will coexist). - Building a full schematic editor UI inside the dashboard—this tool is in-world only.
- Handling non-schematic objects (e.g., NPCs, particles); future extensions can hook into the same inspector.
User Stories
- Builder wants visual context: When I equip the inspector item, I immediately see holographic boxes for each placement plus a label showing schematic name, overlay key, and spawn group.
- Builder wants contextual actions: When I right-click while aiming at a placement hologram, I get a small modal with options (Edit schematic, Shift position, Duplicate to overlay, Delete).
- Builder wants deep editing: If I choose Edit schematic, I am moved to an isolated editing world where the schematic is pasted at origin and I am teleported to the same relative offset I had in the editor instance. Exiting the edit session returns me to my previous location via
/schedit return. - Builder wants collisions to stay safe: When multiple builders inspect concurrently, their holograms/actions should be scoped per player so we do not leak selections.
Scope
- New Minestom item (likely a named nether star) granted automatically while inside
ÜEditorInstance. - Placement visualisation pipeline that reuses
PlacementBlockDisplaybut scopes them to the holding player and includes floating text labels. - Raycast-based selection + action dialog (custom inventory or chat prompt) triggered via right-click.
- Schematic edit session manager that spins up (or reuses) lightweight “edit worlds”, pastes the schematic, teleports the player, and tracks return location/orientation.
- Audit logging for all actions (inspector open, edit session start/end, delete, duplicate).
Out of Scope
- World save diffing after edit session (manual export/import remains required).
- Automatic overlay activation; inspector only manipulates metadata/positions.
UX Flow
- Equip inspector: Player enters editor instance →
PlacementInspectorServicechecks inventory each tick and inserts the custom item into a fixed slot (cannot drop). - Visual overlay: Holding the item triggers per-player hologram spawn for placements within 96 blocks. Holograms show:
- Bounding box via
PlacementBlockDisplay - Billboard text (TextDisplay entity) with schematic name + overlay key + spawn group/probability.
- Bounding box via
- Selection: Player aims at a hologram and right-clicks:
- Client ray is mapped to our phantom entity ID → service resolves the
SchematicPlacement. - Open
PlacementInspectorMenu(custom inventory) listing actions with short descriptions.
- Client ray is mapped to our phantom entity ID → service resolves the
- Edit session:
EditSessionManagerprovisions an instance: clone fromschematic-editor-templateor reuse cached empty void world keyed by schematicId+userId.- Paste schematic at origin (respect rotation).
- Compute relative offset from placement to player (position - placement origin) and teleport player so vantage point matches.
- Provide exit command
/schedit doneorReturnbutton that teleports player back and optionally captures modifications (future).
- Other actions:
- Shift: open small GUI for +/- X/Y/Z (snap to block) and immediately update
SchematicPlacement. - Duplicate to overlay: choose overlay key, copy placement, adjust metadata, respawn holograms.
- Delete: soft-delete with confirmation + audit.
- Shift: open small GUI for +/- X/Y/Z (snap to block) and immediately update
Technical Implementation
- Inspector Item & Lifecycle
- Create
PlacementInspectorService(depends onEditorSessionManager,WorldOverlayManager). - Inject custom item when editor mode starts; remove on exit.
- Listen to
PlayerItemUseEventto detect right-click while aiming at hologram. - 2025-10-25 – Service scaffolding grants a reserved Netherstar (slot 8), restores previous hotbar items on exit, and cancels drops to keep the tool persistent.
- Create
- Per-Player Holograms
- Extend
SchematicPlacementto spawn per-playerPlacementBlockDisplay+TextDisplay. - Maintain
InspectorViewobjects keyed by player UUID → track active placements + cooldown for refresh. - Refresh radius & interval configurable.
- 2025-10-25 – Inspector item spawns up to 80 glowing holograms within 96 Blöcken, tied to slot 8 selection and cleared automatically on slot/instance changes.
- Extend
- Action Menu
- Build a lightweight inventory GUI (e.g., size 9) with actions and tooltips.
- When action selected, delegate to dedicated handlers.
- All handlers call
AuditLogService.recordwithaction=editor.placement.*. - 2025-10-25 – Inspector item bereits per Raycast, zeigt Overlay/Spawn Infos und öffnet ein Chest-Menü (
PlacementInspectorMenu) mit Info- und „Edit (coming soon)“-Buttons;PlacementEditSessionManagerwird dabei schon vor-initialisiert. - 2025-11-06 – „Schematic bearbeiten“ öffnet nun eine temporäre Edit-Instanz und weist auf
/schedit returnals Ausstieg hin.
- Edit Session Manager
- Manage pool of Minestom instances; use
SchematicEditorInstanceclass wrappingÜInstance. - On start: store original instance UUID, position, yaw/pitch. Provide scoreboard reminder and
/schedit return. - On end: teleport player back, cleanup (optionally keep instance warm for 2 minutes).
- 2025-10-25 –
PlacementEditSessionManagerplaceholder tracks intent (player, schematic, source instance) so teleport/backfill logic can plug in later. - 2025-11-06 – Teleportflow implementiert: Session lädt Void-Instanz, pastet Schematic per Rotation, behält Spieler-Offset bei und räumt Instanz nach Rückkehr auf.
- Manage pool of Minestom instances; use
- Teleport Offset Calculation
- Compute vector
playerPos - placement.position. - Apply same vector relative to pasted schematic origin inside edit instance.
- Preserve yaw/pitch for intuitive orientation.
- Compute vector
- Data Writes
- Position shifts & metadata changes persist via existing
WorldAccessAPIs; ensure overlay-specific updates respectoverlayKey. - Duplicate/delete operations update Mongo and re-sync runtime placements via
WorldOverlayManager.
- Position shifts & metadata changes persist via existing
API & Command Hooks
- REST: extend
/api/world/overlaysto expose placement metadata needed by dashboard (no change required for in-world inspector). - Commands:
/schedit return– manual escape hatch./schedit reload– in case the edit template becomes corrupted./schedit sync <placementId>– optional future hook to push modifications back.
Dependencies
WorldOverlayManager(for placement listings + refresh).AuditLogService(action tracking).EditorSessionManager(detect players in editor mode).- Optional:
SchematicCachefor faster paste into edit instance.
Validation Plan
- Unit-test
EditSessionManageroffset calculations. - Manual QA:
- Equip inspector, verify holograms appear/disappear with item.
- Right-click variations (base placement vs overlay) produce correct action menu.
- Edit session returns player to exact original coordinates/orientation.
- Regression: ensure inspector item is removed on logout/instance exit.
- Load test: spawn 5 builders, confirm per-player holograms do not leak/duplicate.
Open Questions
- Should edit sessions auto-import/export schematic changes? (current plan: manual workflow, future enhancement).
- Where do we surface the action dialog (inventory UI vs chat prompt) for best responsiveness?
- Do we need permissions granularity (e.g.,
editor.placements.delete) before exposing delete/duplicate?
Next Steps
- Implement die restlichen Inspector-Actions (Shift, Duplicate, Delete) inklusive Audit Logging.
- Ergänze
/schedit-Hilfen (Scoreboard-Hinweis, optional/schedit reload) und definiere Cleanup-Timeout für Edit-Instanzen. - Dokumentiere den vollständigen QA-Flow inkl. Diff-/Export-Schritten und aktualisiere die Dashboard-Doku, sobald die übrigen Aktionen live sind.
References
services/gameserver/src/main/java/net/uebliche/features/world/data/SchematicPlacement.javaservices/gameserver/src/main/java/net/uebliche/features/world/entitis/PlacementBlockDisplay.javadocs/gameserver/features/world-overlays/plan.md