Vault3v3.0.0

Vault3

相容 Vault API 的獨立經濟插件。內建 GUI 選單、貸款與 MySQL 儲存,不需要另外安裝 Vault.jar

A drop-in Vault economy provider with GUI menus, loans and MySQL storage. No Vault.jar required.

總覽Overview

Vault3 同時扮演兩個角色:經濟系統本體,以及 Vault API 提供者

其他插件寫 depend: [Vault]import net.milkbowl.vault.economy.Economy 完全照常運作,但不需要再裝一份官方 Vault.jar —— API 已經打包在內。

不要同時安裝 Vault.jar。兩者都宣告插件名 Vault, Bukkit 會判定重複而讓其中一個載入失敗,且無法預期是哪一個。

設計取向

經濟插件在小服都能跑,會出事的是規模上來之後。這個專案圍繞兩件事設計: 不阻塞主執行緒,以及不掉錢

  • 交易只標記帳戶為 dirty 然後立刻返回,寫入是非同步、有去抖動的,而且只寫變動過的餘額
  • 餘額變更是單一原子操作,兩個插件同時操作同一帳戶不會互相覆寫
  • 關服同步寫入全部餘額;資料庫不可用時寫出緊急檔,下次啟動自動補寫

細節見效能設計資料安全

需求

項目需求
伺服器Spigot / Paper / Purpur,1.21 以上
Java21(另有 Java 17 建置供 1.20 以下使用)
資料庫選用。MySQL / MariaDB,或使用平面檔

選用掛勾:PlaceholderAPI、LuckPerms、SkinsRestorer、Essentials(僅匯入)。

內建功能一覽

Vault3 fills two roles at once: a complete economy, and a Vault API provider.

Plugins that declare depend: [Vault] and call net.milkbowl.vault.economy.Economy keep working exactly as before, but you do not need a separate Vault.jar — the API ships inside this plugin.

Do not install Vault.jar alongside it. Both declare the plugin name Vault, so Bukkit treats them as duplicates and one will fail to load — and you cannot predict which one.

Design

Most economy plugins are fine on a small server. Things break once traffic picks up, so this project is built around two failures: blocking the main thread and losing money.

  • A transaction marks the account dirty and returns; writes are asynchronous, debounced, and cover only the balances that changed
  • Balance changes are single atomic operations, so two plugins cannot overwrite each other
  • Shutdown writes every balance; if the database is unreachable, balances are dumped to disk and applied automatically on the next start

See Performance and Data safety.

Requirements

ItemRequirement
ServerSpigot / Paper / Purpur, 1.21 or newer
Java21 (a Java 17 build is available for 1.20 and below)
DatabaseOptional. MySQL / MariaDB, or flat file

Optional hooks: PlaceholderAPI, LuckPerms, SkinsRestorer, Essentials (import only).

Feature overview
Vault3 · 以 AGPL-3.0 散布,內含 LGPL-3.0 的 VaultAPI。
Vault3 · Distributed under AGPL-3.0. Bundles VaultAPI under LGPL-3.0.
Copyright © 2021-2026 CloudXact Studio. All Rights Reserved.