Stock Market Mod
版本 2.1.0 为测试版——可能存在漏洞和破坏性变更。在生产世界中使用请自行承担风险。稳定版:v1.3.1。
StockMarket 是一款 Minecraft 模组,将虚拟股票市场引入游戏。玩家通过实时撮合引擎进行交易,支持K线图、订单簿以及市价单/限价单——就像真正的交易所一样。价格会根据玩家的实际买卖行为做出反应,模块化插件系统则补充了其他功能:基础流动性、波动率、目标价格机器人以及完整的新闻事件系统,推送影响市场的头条新闻。管理员拥有内置的游戏内管理控制台,用于管理市场、插件、预设和设置;服务器网络通过主从架构共享单一市场,并基于信任进行访问控制。
更多信息和文档:GitHub
需要 BankSystem 2.1.0 或更高版本 以及 Architectury。ModUtilities 已包含在模组内部——你无需单独下载它(Quilt 用户是例外,仍需单独安装 ModUtilities jar 文件)。服务端和客户端均需安装此模组。

功能特性
- 实时交易:支持K线图、订单簿深度数据,以及每根K线对应的成交量柱状图
- 完整的历史图表——随着滚动,旧K线图页面会逐步加载,一直追溯到市场的第一根K线,且仅加载实际查看的部分
- 市价单(即时成交)和限价单(指定价格),图表上支持拖拽订单标记以将订单调整至新价格
- 跨市场交易——直接与其他物品进行交换(例如用铁换钻石),无需经过“卖出→买入”的往返流程
- 公司股份——通过 BankSystem 发行的公司股票与普通物品一同交易,交易方块上提供商品/公司筛选器,显示真实的公司名称,并在整个 UI 中展示带有 tinted 效果(着色)的股份图标
- 待处理订单面板:支持实时更新和一键取消;每个市场均有完整的订单历史和市场交易日志
- 银行账户选择器:在交易界面上选择使用哪个银行账户为每笔交易提供资金;余额和挂单列表均针对所选账户独立作用域
- 收藏夹——星标常交易的市场以便快速访问;每位玩家恢复上次选择的市场
- 新闻事件系统:包含可合成的报纸、72 个默认双语事件、每个事件的木雕风格插图、多阶段影响序列(激增 → 衰减 → 恢复)、触发条件、事件链以及可通过 JSON 配置自定义事件
- 村民交易集成——对市场中列出的物品,村民/流浪商人的报价会根据实时股市重新定价,并可配置买卖差价;商人货币成本可以使用任意面额组合支付
- 模块化插件系统——包括 VolatilityPlugin(含玩家流动价格均衡)、TargetPriceBot(PID 控制)、DefaultOrderbookVolumeDistribution 和 NewsPlugin。所有插件均可独立启用/禁用,可按市场订阅,并提供开发者 SDK 用于创建自定义插件
- 游戏内模组设置界面——所有
settings.json 的值均可实时编辑,服务端验证并限制范围;需要重启生效的设置会有明确标注
- 管理 GUI——创建市场、浏览 32 个默认预设类别(方块、矿石、食物、工具、盔甲、附魔书、药水、涂色箭……)、内联编辑预设、通过单插件性能分析条管理插件,以及管理新闻系统
- 每个市场的虚拟订单簿控制——可为单个市场关闭模拟订单簿,使其价格完全由真实玩家交易驱动,其余市场保留清除和重置操作
- 多服务器支持——采用主从架构。不受信任的从节点被锁定为只读浏览模式;所有修改请求(下单、插件更改、预设编辑、模组设置、新闻操作)均在主节点被拒绝
- 专用管理员权限标志——专属于 StockMarket ——仅拥有操作员(operator)级别不再授予管理访问权限
- 安全的数据库备份——仅限操作员使用的
/stockmarket backup pause|resume|status 命令可使 SQLite 数据库进入静默状态,以便外部备份脚本捕获干净快照,并设有 120 秒自动恢复的安全机制
- 公共集成 API——其他模组可通过记录在服务端的服务程序,动态创建、暂停、恢复和删除市场
2.1.0 新增内容
需要 BankSystem 2.1.0 或更高版本。 此版本围绕 BankSystem 的新公司功能构建——旧版本的 BankSystem 将无法加载。
- 公司股权可交易 —— 通过 BankSystem 发行的公司股票像其他任何标的一样出现在市场上。交易界面、订单簿表头、收藏夹和工具提示均显示真实的公司名称,而非原始物品 ID;股票行渲染带有公司色调的股票图标
- 商品/公司筛选器 位于交易方块上 —— 在交易模式按钮下方设有分段控件,可同时过滤 货币模式 和 物品对物品配对模式,使操作流程变为 模式 → 分组 → 物品,且每个分组实时显示数量
- 按名称、价格、发行股份数或 24 小时成交量对市场列表排序
- 单市场虚拟订单簿开关 —— 可为单个市场关闭模拟订单簿,使其价格完全由真实玩家交易决定。提供清除(Clear)和重置(Reset)操作,以及对应的预设标志和“不自动订阅插件”的预设选项
- 供其他模组使用的公共集成 API —— 一套文档化的服务端服务,用于动态创建、暂停、恢复和删除市场。暂停市场将停止交易并退还所有未结的玩家订单,同时保留其价格历史记录
- 预设编辑器:直接从你的库存中选择物品 —— “+ From Inventory”选择器采用熟悉的 3×9 + 快捷栏网格布局,可以选择携带数据组件的物品(如印有标记的公司股票),这些物品无法通过扁平注册表列表获取
- 修复 —— 无流动性的市场订单现在会取消并释放其预留的资金;预设编辑器在点击选择器中的物品时不再崩溃;交易界面首次打开时能正确显示“Market Closed”标签
- GitHub 上的 2.0.1 → 2.1.0 完整更新日志
自上一个稳定版本(1.3.1)以来的新功能
- 模块化插件系统 取代了旧有的单一机器人 —— VolatilityPlugin、TargetPriceBot、DefaultOrderbookVolumeDistribution 和 NewsPlugin,均可独立启用/禁用,支持按市场订阅,并提供两类别开发者 SDK 以开发自定义插件(v2.0.1)
- 插件管理 GUI 包含蜡烛图 + 订单簿叠加层、各插件自定义设置屏幕,以及市场订阅/取消订阅控件(v2.0.1)
- 32 个默认预设类别 涵盖原版 1.21.1 物品 —— 方块、矿石、食物、农作物、工具、盔甲、红石、生物掉落物、酿造材料、所有满级附魔书、药水、溅射/滞留药水以及涂抹箭(v2.0.1)
- 端到端交易量追踪 —— SQL 历史中每根蜡烛的累计成交量、向客户端的实时流式传输,以及图表中的绿色/红色成交量柱(v2.0.1)
- 图表上可拖动的订单标记 —— 待处理的限价单渲染为带有拖动手柄的水平价格线,可用于移动订单并通过 [X] 取消(v2.0.1)
- 交易界面上的 待处理订单面板、订单历史 和 市场交易日志 标签页(v2.0.1)
- 每位玩家的 收藏夹和市场记忆,在服务端持久化存储(v2.0.1)
- 跨市场交易 —— 在配对图表上直接用一种物品交易另一种物品(v2.0.1)
- 预设编辑器 GUI 和管理员命令 ——
/stockmarket preset add 可将当前手持物品捕获为预设,/stockmarket <market> remove 可在 GUI 之外删除市场(v2.0.1 / v2.0.3)
- 区域设置加固 —— UI 中的所有数字格式均固定为
Locale.ROOT,修复了在逗号作为小数分隔符的区域设置下 TradeScreen 崩溃的问题(v2.0.2)
- 市场生命周期修复 —— 已删除的市场立即同步至所有客户端;漂移或无法解析的市场仍可选择/移除;由 BankSystem ItemID 合并导致的重复市场会自动整合(v2.0.3)
- 新闻事件系统 —— 可制作的报纸、72 个默认双语事件、每个事件的木刻艺术、多步序列、前置条件、连锁反应以及 JSON 配置的可自定义事件(v2.0.4)
- 村民交易 —— 报价根据实时市场重新定价,支持与面额无关的货币支付(v2.0.4)
- 主服务器管理员的 游戏内模组设置界面(v2.0.4)
- VolatilityPlugin 价格均衡 具备玩家流量自平衡功能和每项物品的丰度缩放比例(v2.0.4)
- 插件管理窗口中的 插件性能分析器栏(v2.0.4)
- 交易界面上的 银行账户选择器 —— 可从你拥有完全权限的任何账户进行交易(v2.0.4)
- 基于信任的访问控制和专用的 StockMarket-admin 权限标志 —— 不受信任的从属服务器仅只读;管理访问不再仅跟随操作员等级(v2.0.4)
- Fabric 构建修复 —— 恢复了 Fabric 构建中对 BankSystem 的依赖(v2.0.5)
- 分页图表历史 —— 图表仅加载你正在查看的窗口范围,并在向后滚动时分页加载更早的蜡烛图,使你能够到达市场的第一个蜡烛图,而不是停在大约五天前的位置。交叉汇率图表也以相同方式分页,重新访问某个范围不会产生网络流量(v2.0.7)
- 更快的世界加入速度 —— 加载时不再为每个市场获取图表数据;在一个拥有 125 个市场的世界中,此前在打开任何一个图表前就会触发 750 次 SQL 往返请求(v2.0.7)
/stockmarket backup pause|resume|status —— 仅限 OP 的数据库静默功能,以便外部备份脚本捕获干净的 stockdata.db,具有 120 秒自动恢复安全网,且在暂停期间无数据丢失(v2.0.7)
- 公司股票交易 —— BankSystem 的公司股票与物品一起交易,具备商品/公司筛选器、真实公司名称、带色调的股票图标,以及按名称/价格/发行股份数/24 小时成交量进行的市场排序(v2.1.0)
- 单市场虚拟订单簿开关,附带清除和重置操作,以及匹配的预设标志(v2.1.0)
- 供其他模组使用的 公共集成 API,用于动态创建、暂停、恢复和删除市场(v2.1.0)
- 预设编辑器库存选择器 —— 选择携带数据组件的物品,例如印有标记的公司股票(v2.1.0)
股票市场终端方块

物理终端方块。右键点击以打开完整的交易界面——包括图表、订单簿、订单控制、收藏夹、挂单和历史记录,所有操作均绑定到你当前选定的银行账户。
实时价格图表

带有成交量直方图的蜡烛图。成交量根据每根蜡烛的方向着色为绿色或红色,并从服务器实时推送。支持平移、缩放和切换时间周期。
新闻事件系统

可制作的报纸是面向玩家的信息流。条目按游戏内日期分组,并以“第 N 天”分隔符区分,每个事件都配有独立的 384×384 灰度木刻风格插图。可以从你的物品栏、贸易界面或管理界面打开报纸,也可以使用命令 /stockmarket news。

点击任意标题即可查看完整的事件详情:类别、受影响的市场及其各市场的影响百分比、实时更新的事件阶段分解(递增 → 维持 → 回落 → 过期),包含各阶段的持续时间和下一步的倒计时。
新闻管理控制

活跃中 — 当前正在运行的事件,包含各市场的影响行、图片缩略图,以及针对每个事件的跳过阶段 / 停止控制。

所有事件 — 完整的事件列表,包含详情弹窗、单个事件的启用/禁用选项,以及手动触发功能。

调度器 — 控制发布频率,并查看即将到来的事件时间线及预计到达时间(ETA)。
管理 GUI

管理员控制台。从 32 个默认预设类别中创建市场,浏览和内联编辑预设,管理插件,编辑模组设置,以及管理新闻系统——无需离开游戏即可全部完成。
带性能分析器的插件管理

启用、禁用和重新排序插件。每个插件都有自己独立的设置界面(内联或全屏)以及可订阅的市场列表。顶部的性能分析器条形图显示了每个插件在每个处理阶段相对于有效服务器刻预算的执行时间,当插件负载过高时会发出溢出警告。
合成配方

交易终端 — 用于打开交易界面的方块。

股票市场显示牌 — 世界中用于渲染选定市场实时图表的显示方块。

报纸 — 面向玩家的新闻阅读器。
Stock Market Mod
Version 2.1.0 is a TEST VERSION — expect bugs and breaking changes. Use in production worlds at your own risk. Stable release: v1.3.1.
StockMarket is a Minecraft mod that brings a virtual stock market to Minecraft. Players trade items on a real-time matching engine with candlestick charts, order books, and market/limit orders — just like a real exchange. Prices react to what players actually buy and sell, and a modular plugin system fills in the rest: baseline liquidity, volatility, target-price bots, and a full news event system that pushes market-moving headlines. Admins get an in-game management console for markets, plugins, presets, and settings; server networks share a single market through a master/slave architecture with trust-based access control.
More info and documentation: GitHub
Requires BankSystem 2.1.0 or newer and Architectury. ModUtilities ships inside the mod — you do not need to download it separately (Quilt users are the exception and still need ModUtilities as its own jar). Both server and client need the mod installed.

Features
- Real-time trading with candlestick charts, order-book depth, and per-candle traded-volume bars
- Full chart history — charts page in older candles as you scroll, all the way back to the market's very first candle, loading only what you actually view
- Market orders (instant) and limit orders (price-targeted), with draggable order markers on the chart to move an order to a new price
- Inter-market trading — trade items directly against other items (e.g. iron for diamonds) without a sell → buy roundtrip
- Company shares — company stock issued through BankSystem trades alongside ordinary items, with a Commodities / Companies filter on the trading block, real company names, and tinted share icons throughout the UI
- Pending-orders panel with live updates and one-click cancel; full order history and market transaction log per market
- Bank-account selector on the trade screen — choose which of your bank accounts funds each trade; balances and open-order list are scoped to it
- Favorites — star markets you trade often for quick access; last-selected market restored per player
- News Event System with a craftable newspaper, 72 default bilingual events, per-event woodcut illustrations, multi-step impact sequences (spike → decay → recovery), trigger requirements, event chains, and JSON-configurable custom events
- Villager trading integration — villager/wandering-trader offers for market-listed items are repriced from the live stock market with configurable buy/sell margins; merchant money costs can be paid with any denomination combination
- Modular plugin system — VolatilityPlugin (with player-flow price equilibrium), TargetPriceBot (PID), DefaultOrderbookVolumeDistribution, and NewsPlugin. All independently enable/disable, subscribable per market, with a developer SDK for custom plugins
- In-game Mod Settings screen — every
settings.json value editable live, validated and clamped server-side; restart-required settings are labelled
- Management GUI — create markets, browse 32 default preset categories (blocks, ores, food, tools, armor, enchanted books, potions, tipped arrows, …), edit presets inline, manage plugins with a per-plugin performance profiler bar, and admin the news system
- Per-market virtual orderbook control — turn the simulated orderbook off for individual markets so their price is driven purely by real player trading, with Clear and Reset actions for the rest
- Multi-server support — master/slave architecture. Untrusted slaves are locked to read-only browsing; every mutating request (orders, plugin changes, preset edits, mod settings, news ops) is rejected at the master
- Admin permission flag dedicated to StockMarket — operator level alone no longer grants management access
- Safe database backups — op-only
/stockmarket backup pause|resume|status quiesces the SQLite database so external backup scripts capture a clean snapshot, with a 120 s auto-resume safety net
- Public integration API — other mods can create, pause, resume and delete markets in-process through a documented server-side service
What's new in 2.1.0
Requires BankSystem 2.1.0 or newer. This release is built around BankSystem's new company feature — older BankSystem versions will not load.
- Company shares are tradable — company stock issued through BankSystem appears on the market like any other subject. The trade screen, order-book headers, favorites and tooltips all show the real company name instead of a raw item id, and share rows render the company's tinted share icon
- Commodities / Companies filter on the trading block — a segmented control sits under the trade-mode buttons and filters both the money mode and the item-for-item pair mode, so the flow is mode → group → item, with a live count per group
- Sort the market list by name, price, shares issued, or 24 h volume
- Per-market virtual orderbook toggle — switch the simulated orderbook off for a single market so its price comes purely from real player trading. Comes with Clear and Reset actions, plus a matching per-preset flag and a "no plugin autosubscribe" preset option
- Public integration API for other mods — a documented, server-side service to create, pause, resume, and delete markets in-process. Pausing a market halts trading and refunds every open player order without destroying its price history
- Preset editor: pick items straight from your inventory — a "+ From Inventory" picker laid out as familiar 3×9 + hotbar grids, which can select items carrying data components (such as stamped company shares) that the flat registry list cannot reach
- Fixes — market orders with no liquidity now cancel and release the money they reserved, the preset editor no longer crashes when you click an item in a picker, and the trade screen shows the Market Closed label correctly on first open
- Full changelog for 2.0.1 → 2.1.0 on GitHub
What's new since the last stable release (1.3.1)
- Modular plugin system replaces the old single bot — VolatilityPlugin, TargetPriceBot, DefaultOrderbookVolumeDistribution, and NewsPlugin, each independently enable/disable, subscribable per market, with a two-class developer SDK for custom plugins (v2.0.1)
- Plugin management GUI with candlestick + orderbook overlays, per-plugin custom settings screens, and market subscribe/unsubscribe controls (v2.0.1)
- 32 default preset categories covering vanilla 1.21.1 items — blocks, ores, food, crops, tools, armor, redstone, mob drops, brewing, all enchanted books at max level, potions, splash / lingering potions, and tipped arrows (v2.0.1)
- Traded volume tracking end-to-end — cumulative volume per candle in the SQL history, live streaming to clients, and green/red volume bars in the chart (v2.0.1)
- Draggable order markers on the chart — pending limit orders render as horizontal price lines with a drag handle to move an order and an [X] to cancel (v2.0.1)
- Pending orders panel, order history, and market transaction log tabs on the trade screen (v2.0.1)
- Favorites and last-market memory per player, persisted server-side (v2.0.1)
- Inter-market trading — trade items directly against other items on a pair chart (v2.0.1)
- Preset editor GUI and admin commands —
/stockmarket preset add to capture a held item as a preset, /stockmarket <market> remove to delete a market outside the GUI (v2.0.1 / v2.0.3)
- Locale hardening — every numeric format across the UI is pinned to
Locale.ROOT, fixing the TradeScreen crash on ,-decimal-separator locales (v2.0.2)
- Market lifecycle fixes — deleted markets propagate to every client immediately, drifted or unresolvable markets stay selectable/removable, and duplicate markets from BankSystem ItemID merges are consolidated automatically (v2.0.3)
- News Event System — craftable newspaper, 72 default bilingual events, per-event woodcut art, multi-step sequences, requirements, chains, and JSON-configurable custom events (v2.0.4)
- Villager trading — offers repriced from the live market, denomination-agnostic money payment (v2.0.4)
- In-game Mod Settings screen for admins on the master server (v2.0.4)
- VolatilityPlugin price equilibrium with player-flow self-balancing and per-item Abundance scaling (v2.0.4)
- Plugin performance profiler bar in the Plugin Management window (v2.0.4)
- Bank-account selector on the trade screen — trade from any account you have full permission on (v2.0.4)
- Trust-based access control and dedicated StockMarket-admin permission flag — untrusted slaves are read-only; management access no longer follows operator level alone (v2.0.4)
- Fabric build fix — restores the BankSystem dependency on the fabric build (v2.0.5)
- Paginated chart history — charts load only the window you are viewing and page in older candles as you scroll back, so you can reach the market's first ever candle instead of stopping at roughly five days. Cross-rate charts paginate the same way, and re-visiting a range costs no network traffic (v2.0.7)
- Faster world join — chart data is no longer fetched for every market on load; a 125-market world previously fired 750 SQL round-trips before you opened a single chart (v2.0.7)
/stockmarket backup pause|resume|status — op-only database quiesce so external backup scripts capture a clean stockdata.db, with a 120 s auto-resume safety net and no data loss while paused (v2.0.7)
- Company share trading — company stock from BankSystem trades alongside items, with a Commodities / Companies filter, real company names, tinted share icons, and market sorting by name / price / shares issued / 24 h volume (v2.1.0)
- Per-market virtual orderbook toggle with Clear and Reset actions, plus matching preset flags (v2.1.0)
- Public integration API for other mods to create, pause, resume and delete markets in-process (v2.1.0)
- Preset editor inventory picker — select items carrying data components, such as stamped company shares (v2.1.0)
Stock Market Terminal Block

The physical terminal block. Right-click to open the full trading interface — chart, order book, order controls, favorites, pending orders, and history — all bound to your currently selected bank account.
Real-time price chart

Candlestick chart with a traded-volume histogram below. Volumes are colored green/red to match each candle's direction and stream live from the server. Pan, zoom, and switch timeframes.
News Event System

The craftable newspaper is the player-facing feed. Entries are grouped by in-game day with "Day N" separators, and each event carries its own 384×384 grayscale woodcut illustration. Open the newspaper from your inventory, from the Trade or Management screens, or via /stockmarket news.

Click any headline to see the full event: category, affected markets with per-market impact percentages, a live-updating sequence breakdown (ramping → holding → reverting → expired) with per-phase durations and a countdown to the next step.
News admin controls

Active — currently running events with per-market impact rows, picture thumbnail, and per-event skip phase / stop controls.

All events — the full event roster with a details popup, per-event enable/disable, and manual trigger.

Scheduler — control publish frequency and see the upcoming-events timeline with ETAs.
Management GUI

The admin console. Create markets from 32 default preset categories, browse and edit presets inline, manage plugins, edit mod settings, and administer the news system — all without leaving the game.
Plugin management with performance profiler

Enable, disable, and reorder plugins. Each plugin has its own settings UI (inline or full-screen) and a subscribable market list. The performance profiler bar across the top shows per-plugin, per-pass execution time against the effective server tick budget, with an overflow warning when the plugin load is too high.
Crafting recipes

Trading Terminal — the block that opens the trading interface.

Stock Market Display — in-world display that renders a live chart for a chosen market.

Newspaper — the player-facing news reader.
评论 0
登录后参与评分
还没有评论,来抢沙发吧