Creators
Details
Licensed MIT
Published last year
Updated 4 months ago
All versions
1.3.0
Release
ShopTools 1.3.08 months ago 22
Compatibility
Minecraft: Java Edition
1.20.x
Platforms
Paper
Purpur
Changes
更新日志
v1.3.0 (2026-03-08)
🚀 新增功能
- 异步库存扫描:整合 FinderTools-Lib 的区块异步加载机制,插件启动后在后台逐区块扫描商店真实库存,全程不阻塞主线程
- 售罄状态恢复:
/st search及/st near命令的商店列表重新支持&c售罄标识,在扫描确认后准确显示 - 可配置扫描速率:新增
performance.stock-scan配置节,支持调节每批次区块数和批次间隔,平衡扫描速度与服务器压力
🔧 技术改进
StockScanQueue核心队列:按(世界, 区块X, 区块Z)对商店分组后入队,BukkitRunnable 定时分批调用getChunkAtAsync(generate=false);对于已加载区块直接读取,未加载区块在主线程异步回调中读取后立即卸载,节省内存locationIndex位置索引:ShopDataManager新增以"world:blockX:blockY:blockZ"为键的位置索引,StockScanQueue通过updateStockByLocation()直接命中当前缓存对象,彻底消除"孤儿引用"问题- 库存快照恢复机制:
updateShopData()在全量同步前对已确认库存做快照,重建缓存后按位置恢复,确保库存数据跨同步周期不丢失 stockKnown扫描哨兵:ShopData新增非持久化字段,扫描完成前isOutOfStock()始终返回false,杜绝启动时因库存未知而产生的误报
🐛 问题修复
- 修复库存永远不更新:修复
StockScanQueue更新孤儿ShopData引用(缓存已被同步替换)导致库存写入无效的问题 - 修复同步覆盖库存:修复
DataSyncManager每次全量同步时以stock=0, stockKnown=false覆盖所有缓存,导致售罄标识永远不显示的问题 - 修复 region 文件预检:扫描前检查
.mca文件是否存在,跳过未生成区块的无效加载请求
⚙️ 配置变更
- 新增
performance.stock-scan配置节enabled(默认true):是否启用启动时库存扫描chunks-per-tick(默认3):每批次处理的最大区块数tick-delay(默认5):两批次之间的间隔 tick 数(5 tick ≈ 每秒约扫描 60 个区块)
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:7SrEX5Ff:Nm79NKhs"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:7SrEX5Ff:Nm79NKhs"
}

