CraftersStaff v7.0.0 'Connector' - Complete optimization for free hosts and new integrations
Important Update Notice
This version 7.0.0 represents a major milestone in CraftersStaff development. During the implementation of new features and optimizations, we encountered several unexpected errors and challenges that required extensive debugging and reworking of core systems. After intensive testing and multiple iterations, we've successfully resolved all critical issues to deliver a stable and optimized release.
New Features
Lazy Loading
- Player data is loaded only when they join the server
- Automatically removed from memory when they disconnect
- Significant reduction in RAM consumption
- Optimized for free hosting environments
Task Batching
- Data saved in batches every 2 minutes
- Instead of individual operations
- 80% reduction in I/O operations
- Reduced database load significantly
Packet-Based Vanish with ProtocolLib
- More efficient packet-based vanish
- Up to 40% fewer resources than traditional hidePlayer
- Better performance on older versions
- Automatic ProtocolLib detection with fallback to traditional vanish
PlaceholderAPI - Full Integration
- 9 new placeholders available:
- %craftersstaff_staffmode%
- %craftersstaff_staffmode_status%
- %craftersstaff_vanish%
- %craftersstaff_vanish_status%
- %craftersstaff_frozen%
- %craftersstaff_frozen_status%
- %craftersstaff_full_status%
- %craftersstaff_staff_count%
- %craftersstaff_vanish_count%
- Compatible with TAB, DeluxeChat and other plugins
EssentialsX / CMI Compatibility
- Automatic external vanish detection
- Prevents double invisibility conflicts
- External vanish verification system
Quick Ban from Menu
- Integration with LiteBans and AdvancedBan
- Quick ban button from staff menu
- Executes commands from installed ban plugin
Staff Chat with RGB Colors
- Hex Colors support via IridiumColorAPI
- Hexadecimal colors and gradients
- Compatible with 1.16+ servers
- Customizable RGB format
Command Whitelist
- Blocks non-moderation related commands
- 26 allowed commands by default in staff mode
- Anti-abuse system to prevent staff from playing while on duty
- Bypass permission: craftersstaff.commandwhitelist.bypass
Discord Webhooks
- Automatic notifications to Discord
- Events: clearchat, freeze, unfreeze, staffmode, ban
- Basic system with configurable URL in config.yml
- Asynchronous tasks (doesn't block the server)
Auto Spectator Mode
- Option to automatically switch to /gamemode spectator
- When activating staff mode
- Returns to previous mode when exiting
- Configurable in config.yml
Real-Time Action Bar
- Shows information in the action bar
- Vanish status, staff mode and TPS
- Real-time updates
- Cleaner than chat messages
Data Cache Manager
- Intelligent cache management
- Auto-save every 5 minutes
- ConcurrentHashMap for thread-safety
- Cache system with last access timestamp
External Vanish Detector
- Detects vanish from other plugins
- Prevents invisibility conflicts
- Compatible with multiple vanish plugins
Critical Bug Fixes
Action Bar Flickering Issue - RESOLVED
During development, we encountered a critical visual bug where the Action Bar would flicker or appear desynchronized when updating in real-time. This issue was particularly noticeable on servers with higher player counts or lower TPS.
The Problem:
- Action Bar messages were being sent too frequently
- Multiple concurrent updates caused visual "lag"
- Text would flicker between different states
- Created a distracting and unprofessional experience for staff members
The Solution:
- Implemented a throttling system for Action Bar updates
- Added intelligent update scheduling to prevent overlapping sends
- Optimized the update frequency to balance responsiveness with stability
- Completely eliminated the visual desynchronization
Result: The Action Bar now updates smoothly without any flickering, providing a clean and professional real-time status display.
Action Bar Message Spam on Staff Mode Disable - FIXED
Another issue we discovered was excessive messaging when staff members disabled their staff mode.
The Problem:
- When disabling staff mode, players would see "Staff Mode: OFF" in both chat AND Action Bar
- This created redundant messages and cluttered the player's screen
- The Action Bar message was unnecessary since the status bar would disappear anyway
- Players reported it felt "spammy" and intrusive
The Solution:
- Removed the "Staff Mode: OFF" message from the Action Bar
- Kept only the chat message for confirmation
- Action Bar now cleanly disappears when staff mode is disabled
- More intuitive user experience
Result: Staff mode disable is now cleaner with a single confirmation message in chat, eliminating visual clutter.
Staff Mode Persistence Issues - RESOLVED
During testing, we encountered unexpected behavior with staff mode state persistence across server restarts and player reconnections.
The Problem:
- Staff mode state wasn't being saved properly to database
- Players reconnecting would lose their staff mode status
- This forced staff members to manually re-enable staff mode after each disconnect
- Caused frustration during server maintenance or network issues
The Solution:
- Implemented new restore-on-rejoin configuration option
- Added robust state saving to database before player disconnect
- Created automatic state restoration system on player join
- Added proper error handling for edge cases
Configuration Added:
staff-mode:
restore-on-rejoin: true # Auto-restore staff mode on reconnect
Result: Staff members can now disconnect and reconnect without losing their staff mode status, maintaining continuity during moderation duties.
⚡ Database Optimizations
Optimized SQLite
- PRAGMA journal_mode=WAL
- PRAGMA synchronous=NORMAL
- PRAGMA cache_size=10000
- WAL mode for better concurrency
- PreparedStatement with batch for multiple insertions
Database Connection Issues - RESOLVED
Multiple unexpected database-related errors occurred during development that required significant refactoring.
Challenges Encountered:
- Connection pool exhaustion under load
- Database locks during concurrent operations
- Transaction rollback failures
- Memory leaks from unclosed connections
Solutions Implemented:
- Complete rewrite of database connection management
- Implementation of proper connection pooling
- Added automatic connection cleanup
- Implemented transaction retry logic
- Added comprehensive error logging for debugging
New Commands and Permissions
Commands
- /staffchat - Dedicated chat for staff (alias: /sc)
Permissions
- craftersstaff.staffchat - Use staff chat
- craftersstaff.commandwhitelist.bypass - Bypass command whitelist
- craftersstaff.quickban - Use quick ban system
⚙️ Updated Configuration
config.yml v7.0.0 - New Sections
- staff-chat: RGB chat configuration
- command-whitelist: Allowed commands list
- discord: Webhook configuration
- integrations: PlaceholderAPI, EssentialsX/CMI, LiteBans/AdvancedBan
- action-bar: Action bar configuration
- performance: Optimizations (lazy loading, batch interval, packet-vanish)
- auto-spectator: Auto spectator mode
- restore-on-rejoin: Staff mode persistence (NEW)
Automatic Configuration Migration
The plugin will automatically update your existing config.yml to version 7.0.0 when you first start the server with this update. Your existing settings will be preserved, and new options will be added with default values.
messages.yml v7.0.0
- Messages for staff-chat
- Command whitelist messages
- Quick ban messages
- Integration messages
plugin.yml v7.0.0
- Extended optional dependencies: PlaceholderAPI, ProtocolLib, Essentials, CMI, LiteBans, AdvancedBan
Performance Improvements
- Reduced RAM consumption with lazy loading
- 80% reduction in I/O operations with batch saving
- Packet-based vanish lighter on servers with many players
- SQLite database optimization in WAL mode
- ConcurrentLinkedQueue for pending save operations
- Eliminated Action Bar flickering and unnecessary updates
- Optimized database connection handling
General Improvements
- Greater compatibility with 6 popular plugins
- Improved security with command whitelist
- Better staff experience with RGB chat and smooth action bar
- Traceability with Discord webhooks
- More modular code with separated managers
- Better error handling with comprehensive try-catch blocks
- All optimizations designed for free hosting environments
- Cleaner visual experience with reduced message spam
- Persistent staff mode state across reconnections
Technical Details
- IridiumColorAPI with fallback to traditional colors
- Reflection for compatibility without hard dependencies
- ProtocolLib PacketContainer for destroy/spawn packets
- Auto-detection of external plugins with softdepend
- Batch saving with transactions and rollback on error
- Throttled Action Bar updates for smooth performance
- Robust state persistence system with error recovery
Development Challenges Overcome
This version required solving several complex technical challenges:
- Action Bar Update Race Conditions: Resolved through implementation of update throttling and scheduling
- Database Transaction Conflicts: Fixed with proper transaction management and retry logic
- Memory Leaks: Eliminated through comprehensive resource cleanup
- Plugin Compatibility: Achieved through extensive testing with popular plugins
- State Persistence: Implemented reliable save/restore mechanism across server lifecycles
Installation Notes
File: CraftersStaff-v7.0.0-.jar
When you install this version, the plugin will:
- Automatically migrate your config.yml to version 7.0.0
- Add new configuration options with sensible defaults
- Preserve all your existing settings
- Create backup of old configuration (optional)
No manual configuration changes are required, though you may want to review the new options to customize them to your needs.
⚠️ Important Notes
- This is a major update with significant internal changes
- Backup your server before updating
- Configuration will auto-update on first startup
- All new features are enabled by default but can be disabled
- Optional dependencies (PlaceholderAPI, ProtocolLib, etc.) enhance functionality but are not required
Version: 7.0.0 'Connector'
Compatibility: Minecraft 1.21+ (Paper/Spigot)
Release Status: Stable
Development Time: Extensive testing and debugging to ensure reliability
Optional Dependencies: Vault, LuckPerms, PlaceholderAPI, ProtocolLib, EssentialsX, CMI, LiteBans, AdvancedBan