Added — Shop Sell System
- Item Sell System: Players can sell items at NPC shops
- BUY/SELL tabs in shop (when sellEnabled=true)
- buyEnabled=false for sell-only shops (no BUY tab)
- Configurable sell prices: sellPrice per item or sellPricePercent as fallback
- Whitelist/Blacklist for sellable items
- Daily sell limit: maxSells per item (analog to maxPurchases)
- Sell tab shows ALL sellable items (including items not in inventory, displayed as "Not in inventory")
- Confirmation dialog with quantity selector ([-] Amount [+]) and total price
- Separate sell currency possible (sellCurrencyId)
- Command Purchase: Shop items can execute commands instead of granting items
- command field on ShopItemConfig (e.g. "/give {player} Diamond")
- commandRunAsServer toggle (server/console or player)
- Placeholders: {player}, {PlayerName}, {uuid}
- Command items are automatically excluded from selling
- Dedicated Buyer NPCs: sellShopId on CitizenData opens shop directly in sell mode
- New Command: /ksshop sell <shopId> opens shop in sell mode (admin testing)
Changed — Shop Admin Panel
- Complete redesign: Shop editor popup removed, everything inline in detail view
- "Add Shop" creates empty shop and opens detail view directly
- Detail view: ID, Title, Currency as editable TextFields
- Buy/Sell toggles side by side
- Sell config inline: Price%, Sell Currency, Whitelist, Blacklist
- Item table: new SELL column (sell price, green)
- Item editor: Sell Price, Max Sells, Command, Run-as fields
### New Features
### Bug Fixes
- Web Config Editor —
/kseditoropens a browser-based editor for all mod configurations (Quests, Achievements, Citizens, Shops, Lootbags, InfoHub, SeasonPass, ChatPlus, WeaponMastery). Live-Apply via WebSocket — changes are applied to the server with a single click, no restart needed. Works from console too (no player required).- Trust-Flow —
/kstrusteditor <nonce>confirms editor connections, console sessions are auto-trusted. Fallback:/ksapplyconfig <code>for manual apply without WebSocket.- Custom Game Data in Editor — Server sends custom Item/Block/Entity IDs to the editor — no more "Unknown item" errors for mod content.
- Web Editor Admin Panel — Citizens entity type autocomplete, shop ID dropdown, NPC role dropdown, deep-links. Bidirectional NPC-Quest links, lootbag autocomplete for rewards, quest pack conflict detection (duplicate quest IDs), validation page with error badges, backup/restore, shop deep-links via
?id=URL parameter, unsaved changes counter.- Citizen Admin Improvements — Citizen IDs can be renamed directly in the admin panel. Localization popup with 9-language editor overlay. NPC Profile Editor cross-link ("Q" button).
- Lootbag Admin Improvements — Browse panel rebuilt in Quest Admin style with 9-language localization popup.
- Citizen RespawnAll Command —
/kscitizen respawnalldespawns and respawns all registered citizens (fromcitizens.jsonand custom files). Works from console and in-game.- NPC Page Opener Dispatch —
CoreAPI.registerNpcPageOpener()registrations are now actually dispatched inCitizenService.dispatchInteract(). Previously the registry was dead code — openers were registered but never called.- Showcase Breakable Blocks —
CoreAPI.registerShowcaseBreakableBlock()API allows mods to whitelist blocks that can be broken in Showcase mode.- Lootbox UI Assets — LootboxReveal.ui and LootboxShowcase.ui added to Core's asset pack to avoid crashes when Lootbox mod uses its own asset pack.
- NPC Duplication Fix — Orphan cleanup now recognizes KSNPC/KSPath roles. Fixed race condition on parallel spawn with atomic spawn gate.
- UUID Resolution — Removed UUID.randomUUID() fallback (prevents ghost entities). Added 3s retry instead of immediate respawn on slow entity materialization.
- Chunk-Loaded Guard — Guard before spawnEntity() fixes main cause of "NPCPlugin returned null".
- PersistentModel Scale — Scale < 0.01 is corrected, prevents crash on chunk restore.
- Clone PATH Role — Cloned citizens now get a correct new role.
- Custom Citizens Persistence — Custom citizens no longer written to citizens.json (only custom_citizens.json). Deleted custom citizens are persistently saved including empty lists.
- Shop Daily Reset — Purchase limits now correctly reset daily. Item resolution fallback for non-existent daily items.
- Web Editor Config Merge — All 6 mods now preserve server-only config keys on apply (previously caused data loss). Custom achievements merged by ID instead of overwrite.
- Clone-to-Custom Fix — Fixed crash (each_key_duplicate) for NPCs, chapters, quests, story quests, citizens.
- Quest Lootbag Validation — Quest mod lootbags now loaded correctly (no more "unknown lootbag" false positives).
- NPC Profile File Recognition — remoteLoader correctly parses NPC profiles instead of treating them as quest definitions.
- Disabled Quests in Pools — Pool selection skips disabled quests, invalid cleanup on reset. disabled_base_ids correctly exported and preserved during merge.
- Core ConfigProvider — Citizens/shops/lootbags were previously ignored on apply.
- WebSocket Fixes — Fixed hello deadlock + F5 reconnect. Bytesocks channel creation via HTTP GET. Reload order: all files written first, then reload. Auto-reload after apply: NPC changes applied live.
- Editor URL Clickable —
/kseditorURL is now clickable in chat.- Player Lookup Security — Replaced
getDisplayName()withgetUsername()in admin commands (prevents nickname spoofing).
