SmartPets v2.1.0 - Multi-Language Support System
Release Date: 2026-01-10
Type: Feature Release
Priority: MEDIUM
New Features
Multi-Language Support System
Overview: SmartPets now supports multiple languages with automatic fallback to English.
Key Features:
- Language Files Folder: New langs/ folder structure for language files
- Spanish Translation: Complete Spanish translation (~450+ keys) included out of the box
- Automatic Fallback: If a translation key is missing, automatically uses English
- Backwards Compatible: Legacy lang.yml file still works for existing installations
- Hot Reload: Change language without server restart using /petadmin reload
- Easy Extension: Add new languages by creating langs/<code>.yml files
Configuration:
Code (YAML):
# In config.yml
general:
language
:
"es"
# Options: "en" (English), "es" (Spanish)
File Structure:
Code (YAML):
plugins/SmartPets/
├── config.yml
├── lang.yml
(legacy, for backwards compatibility
)
└── langs/
├── en.yml
(English - default/fallback
)
└── es.yml
(Spanish - complete translation
)
Technical Details:
- Thread-safe message caching with ConcurrentHashMap
- HEX color code support (&#RRGGBB)
- Placeholder system preserved ({pet_name}, {player}, etc.)
- Automatic extraction of bundled language files on first run
Improved Reload Command
Overview: The /petadmin reload command now performs a complete configuration reload.
Bug Fixes
Fixed: Shulker Box Interaction Blocked
Issue: Players could not interact with Shulker Boxes (open, take items) when SmartPets was installed.
Root Cause: GUI event handlers were using overly broad title matching (contains()) that could accidentally match other inventory types. Additionally, handlers weren't checking the inventory type before canceling events.
Solution:
- Added InventoryType.CHEST check to all GUI handlers - Shulker Boxes use SHULKER_BOX type
- Changed title matching from contains() to more specific patterns (startsWith(), endsWith(), equals())
- Applied fix to all affected GUI classes
Fixed: MySQL Connection Timeout Issues
Issue: "No operations allowed after connection closed" errors when using MySQL storage, especially after periods of inactivity.
Root Cause:
- Connection validation only checked isClosed() but didn't test if connection was actually usable
- MySQL server-side timeouts weren't handled properly
- No automatic retry mechanism for connection failures
Solution:
- Enhanced Connection Validation: Added isConnectionValid() method that tests connections with SELECT 1
- Improved MySQL URL: Added robust connection parameters:
- connectTimeout=60000 & socketTimeout=60000 - Longer timeouts
- maxReconnects=3 & initialTimeout=2 - Automatic reconnection
- allowPublicKeyRetrieval=true & serverTimezone=UTC - Compatibility
- Automatic Retry Logic: Both executeAsync() and queryAsync() now retry up to 2 times on connection errors
- Connection Refresh: Forces new connection creation when stale connections detected