Security gate, snapshots, collab UI, move picker, addon API + UX polish #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/security-snapshots-collab-move"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ce que cette branche apporte
Securite et acces
Snapshots
/plot annulerpour revenir au dernier snapshotUI collaborateurs
Move picker
API publique pour les addons
EkaiiPlotsApiexposee aux plugins tiersPlotView,PlotMarker,MarkerRegistry: les addons peuvent enregistrer des marqueurs sur les parcellesADDONS.md: documentation de l'API pour les developpeurs d'addonsCorrections et polish
Tests
ApiSurfaceTest,PlotMarkerSurfaceTest,SnapshotManagerTest,PlotClipboardKeyTest,PlotIdTest,OwnershipGateTestSecurity - PlotMenuUI: strict-owner canEdit() (no OP bypass) + canView() for collaborators. Gate enforced at open + every destructive action. - PlotsMenuUI handoff routes through canView so a non-owner clicking the per-plot menu just gets a localized "you don't own this plot" message instead of a ghost menu. Snapshot system - Auto undo stack (in-memory, 16 deep per player) carries action label + timestamp; /plot snapshots lists it with clickable pick-any restore. - Persistent named save points: /plot snapshot save|load|list|delete <name>, stored under plugins/EkaiiPlots/snapshots/<plotId>/<name>.snap.gz via PlotClipboardCodec (gzipped JSON). Sanitised filenames ([a-zA-Z0-9_-]{1,48}) — path-traversal proof. - snapshotPlot now captures the floor layer (yStart = floorY) and pastePlot aligns yOrigin so custom floor blocks round-trip. - pastePlot propagates surface/state/depth to all merged sub-tiles before clearGroup so the floor restores correctly on merged plots (fixed the dirt → grass regression after /plot vider + restore). - Progressive AOE-style paste: pre-bucket blocks by chunk, spread writes via runDelayed (1 chunk / tick, Manhattan-sorted from SW corner). No more O(chunks × blocks) and no watchdog stalls on 800×800. Menu plot - Restored the Terrain tile (slot 49): dashboard of owner / id / surface / biome / time / weather / tags + icon edit by left-click with item in hand (no picker submenu), right-click resets icon. - Collaborators tile (slot 46): live count + opens the management UI. - CollaboratorsUI: 54-slot chest with skull heads, right-click on a head removes (owner only), navbar Add / Info / Back. Inventory-ref session record fixes the InventoryCloseEvent race that killed the navbar after adding a collab. - CollabPlayerPickerUI: searchable player picker (same UX as the /m player filter), pool = plot owners + online players, auto- excludes self / owner / already-builders. - Collaborators get the menu (read-only on destructive tiles) — Unclaim, Clear, Paste, Move are hidden AND blocked in onClick. Copier reste accessible. Move + tp - MoveMapPickerUI: interactive 5x9 map (mirrors PlotMapUI colours) to pick the destination. Empty cell = move, viewer's cell = swap, foreign cell = refused with message. Source cell highlighted. - /plot deplacer with no args now opens the picker. /plot deplacer auto kept for legacy. /plot deplacer <x> <z> still works. - /plot tp <x> <z>: new coord-form to land on the center of any cell via PlotManager.getCellCenter() (works on unclaimed cells too). Ambient sound - PlotEntryListener: per-player cache of the currently playing ambient key, so the PlotTickTask reapply doesn't stop+play every few ticks and produce the loop hiccup. Cleared on quit. UI tweaks - BlockPickerUI: also filter !isItem in blocksOnly mode so ACACIA_WALL_HANGING_SIGN and friends don't crash new ItemStack(). - PlotsMenuUI current-plot indicator: show effective values (defaults instead of dashes), weather + heure on one line. Diagnose panel - Reformatted into five colour-coded sections (JVM cyan, Plots green, UIs pink, Snapshots orange, Misc gray). Combined the /m + per-plot menu counters into a single 'menu' figure. New rows: persistent snapshots on disk, collaborators sessions. Tests (JUnit 5) - OwnershipGateTest pins the security regression. - ClipboardManagerTest covers stack bounding, LIFO, redo invalidation on push, labelled-entry roundtrip, removeUndoAt pick-from-middle. - SnapshotManagerTest covers sanitiser path-traversal / length / charset rules. - PlotIdTest covers parse/toString + legacy QUAD❌z format. - PlotClipboardKeyTest covers (x,y,z)<->long packing roundtrip. - FilterRegistryTest covers per-player isolation + anyActive. - JUnit + maven-surefire added to pom. 32/32 tests pass. .gitignore: ignore *.gemini.txt scratch notes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>GameruleListener - Sticky pistons were retracting despite pistons=OFF: Paper/Folia routes their power-loss update through BlockPhysicsEvent before BlockPistonRetractEvent fires. Added a dedicated handler for extended STICKY_PISTON blocks on BlockPhysicsEvent. - onFireSpread: replace string.contains("FIRE") with Material enum comparison - filterExplosionBlockList: avoid one Location allocation per block by adding an isRuleDisabled(World, x, y, z, rule) overload that calls PlotId.fromBlock() directly UI - pickers and plot menu - Back button on sound and surface pickers now reads "Revenir au menu du plot" - Picker page title now updates on navigation (inventory is re-opened with new title) - Page format changed from "(page X/Y)" to "(X/Y)" - Surface picker title changed to "Choisir une surface" - Plot menu > Surface tile: removed left-click-with-block shortcut and middle-click; left-click always opens the picker, right-click resets - Plot menu > Sound tile: removed the "(sous-menu a venir)" placeholder note