Commit Graph

3 Commits

Author SHA1 Message Date
Matt 665c1a8442 0.8.0: JSON plot config + FTB Teams/Chunks integration
Build / build (push) Has been cancelled
Plot system migrated from static Java + KubeJS to a runtime
configurable, FTB-Chunks-integrated system.

* Plot definitions now live in JSON at
  <world>/serverconfig/bnstoolkit/plots.json. Default file written on
  first server start with the three v0.33 plots. Editable in-place
  + reloadable via /bns admin plot reload.

* New static Plot.REGISTRY replaces Plot.ALL. Loaded on ServerStartedEvent.
  Plot.all() returns the current snapshot.

* New FtbBridge.java — compileOnly deps on ftb-teams + ftb-chunks
  (always in the pack). Wraps team lookup, chunk claim/unclaim, and
  the BEFORE_UNCLAIM event.

* /bns admin spawn-init creates the Spawn (cyan) + Plots (gold) server
  teams using configured UUIDs/colors and claims every defined plot
  for the Plots team. Idempotent.

* /bns admin plot define <id> <name> <price> — adds the chunk you're
  standing in to the plot. Re-run with the same id (different chunks)
  to make multi-chunk plots. Auto-claims for the Plots team and
  persists to JSON.

* /bns admin plot list / remove / reload commands.

* /bns plot buy <id> — pays via NumismaticsBridge.spend (cash+bank
  combined), unclaims chunks from Plots team, claims for the buyer's
  personal FTB Teams team. Records ownership in server NBT and the
  player's bnsOwnedPlots list.

* /bns plot release <id> — reverse flow, refunds 50% to bank.

* Plot chunk guard: ClaimedChunkEvent.BEFORE_UNCLAIM subscriber rejects
  any unclaim of a registered plot chunk unless a thread-local
  SYSTEM_UNCLAIMING flag is set (only set during the release/transfer
  flows). Players who try to unclaim via the FTB Chunks UI get a chat
  message redirecting them to /bns plot release.

* KubeJS plots.js retired (.retired suffix kept). All logic now in
  Java; KubeJS no longer participates in plot ownership state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 17:52:31 +00:00
Matt afe7d38827 0.2.0: feature-complete UI — 5 FTB-Library screens + HUD overlay
Build / build (push) Has been cancelled
All five screens implemented with FTB Library widgets (Panel/Widget/
SimpleTextButton). Layout matches FTB Quests/Chunks for visual
consistency with the rest of the pack.

Screens:
- TierUpgradeScreen   — 13-row ladder, current tier highlighted,
                        Upgrade button to next tier with cost/affordability check
- ShopBrowserScreen   — 9-cell item grid + detail pane, quick-sell
                        buttons (1/16/64) with live DR-aware price preview
- BountyBoardScreen   — daily pool + active set, accept/cancel/turn-in
                        per state, slot-cap indicator
- PlotPurchaseScreen  — plot list + detail pane, buy/release with
                        ownership colour-coding and tier-gated buy
- QuestLogScreen      — at-a-glance tier+balance summary, active
                        bounties with progress bars, owned plots

HUD overlay: top-left tier name + spurs balance, registered as a
NeoForge GUI layer above the experience bar. 1Hz server push keeps
the balance current without polling client-side inventory.

Network: replaces single smoke-test packet with 7-packet contract:
- C2S: RequestEconomySnapshot, RunBnsCommand (whitelisted)
- S2C: TierStateUpdate, SellSnapshot, BountySnapshot, PlotSnapshot, Toast

Server-side bridge (ServerEconomyBridge) reads player NBT and
Numismatics-by-item-id-string for balance, routes write verbs
through the existing KubeJS /bns chat commands so KubeJS remains the
source of truth for economy logic.

Key bindings (rebindable in vanilla controls menu):
- K  Civic tier ladder
- J  Bounty board
- N  Plot office
- H  Bazaar shop
- M  Quest log

FTB Library + Architectury maven repos wired in build.gradle as
compileOnly; the jar stays small since FTB Library is already in pack.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-07 02:33:53 +00:00
Matt e99b5b1e0e M0: scaffold bnstoolkit mod (NeoForge 1.21.1)
Build / build (push) Has been cancelled
Empty mod that loads cleanly on client + dedicated server. Sets up the
package layout and milestone TODOs for the BNS in-game UI work.

- uk.sijbers.bnstoolkit.{BnsToolkit, BnsToolkitClient} mod entries
- 5 placeholder screens extending a shared BaseBnsScreen
  (TierUpgrade, BountyBoard, QuestLog, PlotPurchase, ShopBrowser)
- 3 key bindings (T/B/P) registered, handlers TODO M1+
- SpurHud overlay placeholder for M4
- Network: payload registrar + one smoke-test C2S/S2C pair
  (RequestTierState / TierStateUpdate)
- en_us.json for screen + keybind labels
- neoforge.mods.toml pinned to neo_version 21.1.228 (live server match)

Build verified: ./gradlew build -> bnstoolkit-0.1.0.jar (15.6 KB).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-07 00:10:54 +00:00