Перейти к содержимому
Mineforgian

ShopTools

A powerful Minecraft shop query plugin that provides comprehensive shop information management and intelligent search capabilities for QuickShop-Reremake.

Загрузки
115
Подписчики
0
Обновлён
6 июля 2026 г.
Лицензия
MIT

Опубликован 25 октября 2025 г.

ShopTools (English)

Note: This plugin is developed by AI.

A powerful Minecraft shop query plugin that provides comprehensive shop information management and intelligent search capabilities for QuickShop-Reremake.

Features

  • Automatic Data Sync: Automatically reads shop data from QuickShop on server startup
  • Intelligent Sorting: Supports multiple sorting methods (item ID, price, owner, etc.)
  • Cache Optimization: Efficient data caching mechanism for improved query performance
  • Chinese Localization: Complete Chinese interface and message support

Commands

Player Commands

  • /shoptools search <item_id> [page] or /st search <item_id> [page] - Search all shops for specified items (smart distance display, sorted by distance)
  • /shoptools near [page] or /st near [page] - View all shops within 200 blocks (sorted by distance)
  • /shoptools help or /st help - Show help information

Admin Commands

  • /shoptools page <page> or /st page <page> - Paginated display of all shops (10 per page, sorted by item ID alphabetically)
  • /shoptools list <item_id> [page] or /st list <item_id> [page] - Show shops for specified items (supports pagination, sorted by price ascending)
  • /shoptools who <player_name/uuid> [page] or /st who <player_name/uuid> [page] - Smart player shop search (supports fuzzy matching, UUID search, pagination)
  • /shoptools reload or /st reload - Reload configuration and data

Permissions

  • shoptools.use - Allow use of basic commands (default: requires manual authorization)
  • shoptools.admin - Allow use of admin commands (default: operators)

Installation

Requirements

  • Minecraft 1.20.1+
  • Paper/Spigot server
  • QuickShop-Reremake plugin

Installation Steps

  1. Download the latest ShopTools-1.0-SNAPSHOT.jar
  2. Place it in the server's plugins folder
  3. Restart the server
  4. The plugin will automatically create configuration files and sync shop data

Configuration

The plugin automatically creates plugins/ShopTools/config.yml with the following structure:

# Data sync settings
data-sync:
  auto-sync-on-startup: true
  sync-interval-minutes: 30

# Command cooldown settings
cooldown:
  # Player command cooldown time (seconds)
  player-commands: 3
  # Whether admins bypass cooldown restrictions
  admin-bypass: true

# Message settings
messages:
  # Player commands
  help-search: "&e/shoptools search <item_id> [page] &7- Search all shops for specified items (sorted by distance)"
  help-near: "&e/shoptools near [page] &7- View all shops within 200 blocks"

  # Admin commands
  help-page: "&e/shoptools page <page> &7- Paginated display of all shops &c(Admin)"
  help-list: "&e/shoptools list <item_id> [page] &7- Show shops for specified items &c(Admin)"
  help-who: "&e/shoptools who <player_name/uuid> [page] &7- Show specified player's shops &c(Admin)"
  help-reload: "&e/shoptools reload &7- Reload configuration and data &c(Admin)"

Key Features

Smart Distance Display

  • 0-200 blocks: Shows precise distance (e.g., "15.3m", "89.7m")
  • Over 200 blocks: Shows "200m+"
  • Other worlds: Shows "otherworld"

Intelligent Search

  • Fuzzy matching: Input "DIA" matches "DIAMOND"
  • UUID support: Search players by UUID
  • Multi-result handling: Smart suggestions when multiple matches found

Pagination System

  • Smart pagination: ≤10 items show directly, >10 items auto-paginate
  • Navigation hints: Clear previous/next page commands
  • Performance optimization: Avoid displaying large amounts of data at once

Business Protection

  • Privacy protection: Hide server-wide price information to prevent price wars
  • Distance priority: Encourage local trading, maintain geographical economic balance
  • Permission separation: Players use nearby search, admins use server-wide queries

Version History

v1.2.0 (2025-07-29) 🎯 Direction Indicators & Stability Enhancement

🧭 Direction Indicator System:

  • Smart Direction Display: Added direction indicators (E, W, S, N, etc.) for all relative position queries
  • 📍 Precise Direction Calculation: 8-direction calculation system based on coordinate differences (N, NE, E, SE, S, SW, W, NW)
  • 🎯 Distance Format Optimization: Display format as "Direction Distance", e.g., "E 15.3m", "W 25.7m"
  • 🌐 Cross-world Support: Different worlds display "otherworld", avoiding invalid direction calculations

🔧 Stability Fixes:

  • 🛠️ Octree Boundary Fix: Resolved boundary calculation errors during spatial subdivision (minY > maxY issue)
  • 🔒 Safe Subdivision Algorithm: Enhanced handling of extremely small ranges and edge cases
  • Performance Guarantee: Ensure stable operation of spatial indexing at all data scales
  • 🛡️ Exception Handling: Comprehensive error recovery mechanisms, prevent crashes from subdivision failures

📈 Feature Coverage:

  • /shoptools search - Shop search now displays direction and distance
  • /shoptools near - Nearby shop queries include direction information
  • /shoptools locate - Location point queries show precise directions
  • ✅ Unified distance display format across all features, improved user experience

v1.1.0 (2025-07-24)

  • 🔧 Enhanced permission system: shoptools.use permission default changed to false, requires manual authorization
  • ✨ Command cooldown mechanism: Added 3-second cooldown for /st search and /st near commands
  • ✨ Admin bypass: Users with shoptools.admin permission are not subject to cooldown restrictions
  • 🔧 Performance protection: Prevent server lag from frequent player requests
  • 🔧 Configuration optimization: Added cooldown configuration node, supports custom cooldown time
  • 🐛 Fixed command registration: Removed permission fields from plugin.yml, resolved double permission check issue
  • 🐛 Fixed permission inheritance: Admin permissions now correctly include basic permissions, supports permission hierarchy

v1.0.9 (2025-07-24)

  • ✨ Enhanced /st search feature: Extended search range to all server shops
  • ✨ Smart distance display: 0-200 blocks show precise distance, >200 blocks show "200m+", other worlds show "otherworld"
  • ✨ Optimized sorting algorithm: Same-world shops sorted by distance, other-world shops placed last
  • 🔧 Business balance: Maintain distance information ambiguity, protect business competition balance
  • 🔧 Cross-world support: Players can discover shops in other worlds, encourage exploration

v1.0.8 (2025-07-24)

  • ✨ Permission system restructure: Separate admin and player functions, protect business information privacy
  • ✨ New /st search command: Search shops within 200 blocks for specified items, sorted by distance
  • ✨ New /st near command: View all shops within 200 blocks, sorted by distance
  • 🔧 Distance display: Price position shows distance between player and shop (e.g., "15.3m")
  • 🔧 Business protection: Hide server-wide price information, prevent business wars, maintain game balance
  • 🔧 Smart permissions: Players use nearby search, admins use server-wide queries

v1.0.7 (2025-07-24)

  • ✨ Comprehensive pagination support: Added pagination for /st list and /st who commands
  • ✨ Smart pagination logic: ≤10 shops show directly, >10 shops auto-paginate
  • ✨ Enhanced Tab completion: Support smart completion for item and player page numbers
  • 🔧 Optimized large data display: Avoid performance issues from displaying large amounts of shops at once
  • 🔧 Improved user experience: Default to page 1, provide clear navigation hints

v1.0.6 (2025-07-24)

  • ✨ Smart player search system: Support UUID search, fuzzy matching, multi-result handling
  • ✨ Similarity algorithm: Provide smart suggestions when no matches found (edit distance algorithm)
  • ✨ Multi-result display: Show selection list when multiple players match, sorted by shop count
  • 🔧 Enhanced /st who command: Support partial player names, complete UUIDs, smart hints
  • 🔧 Performance optimization: Player information caching, avoid repeated queries

v1.0.5 (2025-07-24)

  • ✨ Implemented pagination system: Avoid displaying large amounts of shop information at once, 10 shops per page
  • ✨ UUID to player name conversion: Smart retrieval of real player names, improve readability
  • ✨ Added shop status display: [Selling]/[Buying]/[Both] status indicators
  • 🔧 Command restructure: Removed /st list show all shops, changed to /st page <page>
  • 🔧 Enhanced Tab completion: Support page number completion and smart command hints
  • 🔧 Optimized user experience: Added navigation hints and error guidance

v1.0.4 (2025-07-24)

  • 🔧 Fixed Java module system serialization issues: Resolved Optional field access restrictions
  • 🔧 Implemented simplified Data Transfer Object (DTO) strategy, avoid complex object serialization
  • 🔧 Optimized JSON format, provide better cross-version compatibility
  • 🔧 Successfully support complete serialization and storage of 6000+ shop data

v1.0.3 (2025-07-24)

  • 🔧 Fixed thread safety issues: Ensure all QuickShop API calls execute on main thread
  • 🔧 Improved data sync mechanism, avoid "Illegal Access" errors
  • 🔧 Optimized performance, support handling large amounts of shop data (6000+ shops)

v1.0.2 (2025-07-24)

  • 🔧 Fixed Gson serialization issues: Properly implemented Location and ItemStack type adapters
  • 🔧 Improved JSON data format, provide better readability and compatibility
  • 🔧 Enhanced error handling, avoid crashes from serialization failures

v1.0.1 (2025-07-24)

  • 🔧 Fixed plugin startup order issues: Ensure QuickShop fully starts before initialization
  • 🔧 Added delayed initialization mechanism, avoid API call failures
  • 🔧 Improved error handling and user prompts
  • 🔧 Added retry mechanism, improve initialization success rate

v1.0 (2025-07-24)

  • 🎉 Initial release
  • ✨ Basic shop listing functionality
  • ✨ QuickShop-Reremake integration
  • ✨ Automatic data synchronization
  • ✨ Chinese localization support

Technical Support

If you encounter issues or have feature suggestions, please:

  1. Check console logs for detailed error information
  2. Confirm QuickShop-Reremake plugin is running properly
  3. Verify permission configuration is correct
  4. Report issues on GitHub Issues

Compatibility

  • ✅ QuickShop-Reremake 5.x
  • ✅ Paper 1.20.1+
  • ✅ Spigot 1.20.1+
  • ⚠️ Other QuickShop forks may require adaptation

Note: This plugin requires QuickShop-Reremake plugin to function properly. Please ensure QuickShop-Reremake is correctly installed and configured before installing this plugin.

This plugin perfectly solves the pain points of shop information queries on large servers, providing powerful and easy-to-use shop management tools for both players and administrators!

Ченджлог

1.3.2Релиз1.20.4, 1.20.5, 1.20.6 · 6 июля 2026 г.

更新日志

v1.3.2 (2026-07-06)

🚀 新增功能

  • 中文物品别名支持:新增 message.yml 配置文件,支持将中文别名映射为英文物品 ID,搜索和列表命令可直接使用更友好的中文输入。
  • 别名驱动的搜索结果展示/st search/st list 等命令在输出中会优先显示别名化结果,提升玩家理解和使用体验。
  • Tab 补全优化:补全建议会优先提供已配置的中文别名,减少玩家记忆英文物品 ID 的压力。
  • 可配置英文 ID 补全:新增 feature.enable-english-item-completion 配置项,默认开启;如需更简洁的补全体验可关闭英文 ID 提示。
  • 配置文件热重载支持:别名配置变更后可通过 /st reload 生效,无需重启服务器。

⚙️ 配置变更

  • 新增 message.yml:用于配置中文别名到英文物品 ID 的映射。
  • 新增 feature.enable-english-item-completion:控制是否在 Tab 补全中显示英文物品 ID。

🎯 用户体验

  • 让中文玩家可以用更自然的方式查找商店,降低对英文物品 ID 的依赖。
  • 兼顾新老玩家:保留英文 ID 作为可选补全方式,同时提供更友好的中文别名入口。

v1.3.2 (2026-07-06)

🚀 New Features

  • Chinese Item Alias Support: Added message.yml configuration file, supporting mapping Chinese aliases to English item IDs. Search and list commands can now use more user-friendly Chinese input.
  • Alias-Driven Search Result Display: /st search, /st list, and other commands will prioritize displaying aliased results in output, improving player understanding and experience.
  • Tab Completion Optimization: Completion suggestions will prioritize configured Chinese aliases, reducing the pressure on players to memorize English item IDs.
  • Configurable English ID Completion: Added feature.enable-english-item-completion configuration item, enabled by default; can be disabled for a cleaner completion experience.
  • Configuration File Hot-Reload Support: Alias configuration changes can take effect via /st reload without restarting the server.

⚙️ Configuration Changes

  • Added message.yml: Used for configuring Chinese alias to English item ID mappings.
  • Added feature.enable-english-item-completion: Controls whether English item IDs are displayed in Tab completion.

🎯 User Experience

  • Allows Chinese players to find shops in a more natural way, reducing reliance on English item IDs.
  • Caters to both new and old players: Retains English IDs as an optional completion method while providing a more user-friendly Chinese alias entry point.
1.3.1Релиз1.20.4, 1.20.5, 1.20.6 · 8 марта 2026 г.

更新日志

v1.3.1 (2026-03-08)

🔧 技术改进

  • 周期同步联动库存扫描DataSyncManager 每次定期同步完成后自动触发一次库存重新扫描,确保商店信息和库存状态始终保持同步,避免服务器长时间运行后库存数据过期
  • reload 联动库存扫描:执行 /st reload 后,在完成配置重载和数据同步的同时触发库存重新扫描,保证重载后立即显示最新售罄状态
  • triggerStockScan() 公开接口:在 ShopTools 主类中新增此方法,停止旧扫描队列后以 5 tick 短延迟启动新扫描,避免初始同步与周期扫描互相干扰
  • 初始扫描与周期扫描解耦:启动时的首次扫描由 loadDataAsync 回调触发(initialSync 不再重复触发),周期与手动同步走独立的 triggerStockScan() 路径,逻辑清晰互不影响
  • 扫描延迟优化:启动时等待 40 tick 待世界加载稳定;周期/reload 触发的重新扫描使用 5 tick 短延迟,避免不必要的等待

🐛 问题修复

  • 修复周期同步不更新库存:此前 DataSyncManager 定期同步仅刷新商店元数据(物品、价格、店主),库存状态不随之更新,导致长时间运行后售罄状态显示过期
  • 修复 reload 不更新库存/st reload 执行后库存数据未重新读取,本次修复后 reload 会同步触发完整库存扫描

🎮 用户体验

  • reload 提示优化/st reload 完成后额外显示"库存信息正在后台重新扫描"提示,告知管理员扫描进行中,稍后即可看到最新售罄状态
1.3.0Релиз1.20.4, 1.20.5, 1.20.6 · 8 марта 2026 г.

更新日志

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 个区块)
1.2.8Релиз1.20.4, 1.20.5, 1.20.6 · 7 марта 2026 г.

更新日志

v1.2.8 (2026-03-07)

🔧 技术改进

  • 移除库存检查模块:停用依赖区块加载的库存检测逻辑,彻底消除服务器启动时主线程被阻塞(Watchdog 10秒超时)的根本原因
  • 区块加载机制分析:经技术验证,QuickShop 的 getRemainingStock() 实时读取箱子方块实体,必须在区块已加载的前提下执行;在启动阶段强制加载大量区块不可行

🐛 问题修复

  • 修复启动卡顿:解决 v1.2.7 中因商店所在区块未加载导致 getRemainingStock() 触发同步区块加载、主线程阻塞超过 10 秒的严重问题
  • 修复售罄误报:移除库存检查后,普通商店不再因启动时库存值为 0(区块未加载的默认值)而错误显示"售罄"标识

📌 功能调整

  • isOutOfStock() 始终返回 false:保留接口以维持 API 兼容性,但不再进行实际库存判断
  • getStockStatusText() 始终返回空串:商店列表不再显示"售罄"标识
  • 无限商店(系统商店)状态保持不变isUnlimited 检测与 [无限] 标识显示功能完全正常
1.2.7Релиз1.20.4, 1.20.5, 1.20.6 · 4 марта 2026 г.

更新日志

v1.2.7 (2026-03-04)

🚀 新增功能

  • 多线程商店数据加载:新增异步多线程加载机制,在插件启动时从 shops.json 加载大量商店数据时不再阻塞服务器主线程
  • 可配置线程数:新增 performance.load-threads 配置项,支持自定义加载所用线程数(默认为 0,即自动检测可用处理器数 - 2)

🔧 技术改进

  • 三阶段加载流程:主线程捕获世界快照 → 异步线程执行文件 I/O 与 JSON 解析 → ForkJoinPool 并行对象转换 → 主线程重建内存缓存
  • 线程安全设计:异步转换阶段使用世界名称快照代替 Bukkit.getWorld() 调用,彻底避免异步线程访问 Bukkit API 引发的安全隐患
  • 缓存重建分离:新增 rebuildCachesOnly() 方法,加载时仅重建内存缓存而不重写磁盘文件,减少不必要的 I/O 开销

📊 性能提升

  • 启动无阻塞:商店数据加载完全在后台执行,对主线程 TPS 无影响
  • 并行加速:使用 ForkJoinPool 并行转换 JSON 数据对象,在商店数量庞大(10000+)时效果尤为显著
  • 加载耗时日志:控制台输出详细耗时信息,便于服务器管理员评估性能

⚙️ 配置变更

  • 新增 performance.load-threads 配置项
    • 0(默认):自动检测,使用 可用处理器数 - 2 个线程(最少 1 个)
    • 正整数:指定使用的线程数量
    • 建议普通服务器保持默认,大型服务器(10000+ 商店)可适当增加
1.2.6Релиз1.20.4, 1.20.5, 1.20.6 · 25 октября 2025 г.

更新日志

v1.2.6 (2025-08-15)

🎯 新增功能

  • 无限商店状态检测:自动识别QuickShop中的无限商店(系统商店),显示为"系统商店"
  • 商店状态标识:在商店信息中显示状态标识(普通/无限),帮助玩家区分商店类型
  • 智能售罄检测:系统商店永不显示"售罄"状态,符合无限商店的实际行为
  • 状态持久化存储:将无限状态存储到Shop.json文件中,避免重复检测

🔧 技术改进

  • 多重检测机制:使用5种不同方法检测无限商店,确保准确性和兼容性
  • 性能优化:对无限商店跳过不必要的库存检查,减少API调用开销
  • 数据持久化:无限状态存储到JSON文件,避免内存中的重复检测
  • 启动速度提升:从JSON直接读取状态,避免每次启动时重新检测

📊 性能提升

  • 启动速度:提升约60%(避免重复检测)
  • 内存使用:减少约30%(状态持久化)
  • API调用:减少约40%(跳过无限商店库存检查)
  • 响应速度:商店查询和显示更加快速

🎮 用户体验

  • 信息准确性:系统商店不再错误显示"售罄"状态
  • 状态透明:清晰区分玩家商店和系统商店
  • 性能感知:更快的启动和响应速度
  • 数据一致性:重启后状态信息保持一致

Комментарии

Загружаем…