Skip to content

1.0.2#5

Merged
westkevin12 merged 10 commits intomasterfrom
1.0.2
Dec 21, 2025
Merged

1.0.2#5
westkevin12 merged 10 commits intomasterfrom
1.0.2

Conversation

@westkevin12
Copy link
Owner

@westkevin12 westkevin12 commented Dec 21, 2025

📝 Description

This PR introduces a comprehensive architectural overhaul, transitioning the plugin into a high-performance solution for large-scale Minecraft networks. The primary focus is the implementation of Scoped Storage, allowing administrators to maintain separate player inventories across different server groups (e.g., Survival, Creative, and Skyblock) within the same database.

🚀 Key Changes

1. Scoped Storage & Enterprise Database Support

  • Scoped Logic: Introduced the scope variable across all storage providers (MySQL, MongoDB, FlatFile) to differentiate vault data based on server environment.
  • MySQL Migration: Enhanced the initialize method in MySQLStorageProvider.java to automatically migrate existing tables, adding the scope column and updating Primary Keys while checking for potential data duplicates.
  • Bulk & Fallback Operations: Implemented loadVaults for efficient batch loading and added robust error fallbacks to individual saves if bulk transactions fail.

2. UI/UX Modernization

  • Visual Vault Selector: A new paginated GUI (VaultSelector.java) replaces legacy text-based navigation.
  • Vault Searcher: Added an integrated search engine (VaultSearcher.java) that allows players to locate items across all owned vaults instantly.
  • Conversation API Search: Implemented SearchPrompt.java to handle search queries via the Bukkit Conversation API, providing a cleaner user experience.

3. Performance & Reliability

  • Redis Caching & Sync: Added a RedisCacheLayer and RedisMessageListener to provide near-instant cross-server synchronization and prevent duplication exploits on BungeeCord/Velocity networks.
  • Safe Shutdown: Updated PlayerVaults.java with a safelyCloseVault method to ensure all open inventories are committed to storage during server restarts or crashes.
  • S3 Cloud Backups: Introduced an asynchronous S3 backup task to stream vault data to off-site object storage (AWS S3, MinIO) without impacting server performance.

🛠 Testing Accomplished

  • Concurrency Testing: Verified "Sync Lock" behavior under rapid open/close race conditions.
  • Load Testing: Validated database and Redis connection pool stability under 100+ simultaneous vault access requests.
  • Serialization Testing: Confirmed NBT integrity for complex items, including Shulker Boxes and custom enchants.
  • Failover Testing: Verified that the plugin gracefully prevents access during database or Redis downtime to protect player items.

⚠️ Migration Notes

Administrators upgrading from v4.x or earlier must backup their /plugins/PlayerVaults/vaults directory. The plugin will attempt an automatic database migration upon the first launch of v1.0.2. If duplicates are detected in the MySQL table, the migration will abort and require manual cleanup to ensure data integrity.

Architectural Checklist

  • Java 21 Verified: I have verified this code runs on Java 21.
  • No Unsafe Usage: I have not utilized sun.misc.Unsafe or other internal APIs.
  • Adventure API: Text changes use MiniMessage/Adventure, not legacy ChatColor.
  • Storage Strategy: (If applicable) I have respected the StorageProvider interface pattern.

Related Issue

Closes #

…bustness with bulk save fallback and PK migration duplicate checks.
…aultViewInfo` tracking from commands, along with data safety improvements and scope-aware vault icons.
…to economy operations to avoid redundant checks
Added loadVaults to StorageProvider interface.
Implemented efficient batch retrieval in:
MySQLStorageProvider (using IN (?) clause).
MongoStorageProvider (using $in operator).
FileStorageProvider (single file parse).
RedisCacheLayer (pipelining + cache-through logic).
perf: VaultSearcher Optimization:
Updated VaultSearcher to use loadVaults, replacing N database queries with 1 single query per search.
…orage support, and enhance storage conversion logic.
@westkevin12 westkevin12 merged commit 120416d into master Dec 21, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant