Skip to content

StormtrooperX v1.6.0 - MySQL Support with HikariCP

Choose a tag to compare

@mdw19873 mdw19873 released this 30 Nov 04:18
· 86 commits to master since this release

What's New

🗄️ MySQL Database Support

StormtrooperX now supports MySQL as an alternative to the default embedded H2 database! This makes it easier to share player opt-out preferences across multiple servers in a network.

Key Features:

  • Dual database support: Choose between embedded H2 (default) or MySQL
  • HikariCP connection pooling: Enterprise-grade connection management for optimal performance
  • Easy configuration: Simple YAML-based setup
  • Automatic migration: Existing H2 databases continue to work seamlessly

Configuration

H2 (Default - No Setup Required)

database:
  type: h2

MySQL

database:
  type: mysql
  mysql:
    host: localhost
    port: 3306
    database: stormtrooperx
    username: root
    password: ""
    pool:
      maximum-pool-size: 10
      minimum-idle: 2
      connection-timeout: 30000
      idle-timeout: 600000
      max-lifetime: 1800000
    properties:
      # Optional: Add any JDBC connection properties here
      # useSSL: "true"
      # serverTimezone: "UTC"

Technical Details

New Dependencies

  • HikariCP 7.0.2: High-performance JDBC connection pool
  • MySQL Connector/J 9.5.0: Latest MySQL JDBC driver (Java 11+ compatible)
  • H2 Database 2.4.240: Updated embedded database engine

Database Schema

Both H2 and MySQL use the same optimized schema:

CREATE TABLE IF NOT EXISTS player_optout (
    player_uuid VARCHAR(36) PRIMARY KEY,
    opted_out BOOLEAN NOT NULL
)

Test Coverage

  • 106 total tests (all passing)
  • New test suites for MySQL configuration
  • Enhanced DatabaseManager tests for both H2 and MySQL
  • Validation for all configuration scenarios

Installation

  1. Download the StormtrooperX-1.6.0.jar file below
  2. Place it in your server's plugins/ folder
  3. Configure database settings in plugins/StormtrooperX/config.yml (optional)
  4. Restart your server

Upgrading from 1.5.x

Upgrading is seamless:

  1. Replace the old JAR with StormtrooperX-1.6.0.jar
  2. Restart your server
  3. Your existing H2 database will continue to work
  4. Optionally configure MySQL if desired

Note: The config will automatically migrate from v2 to v3 format on first load.

Bug Fixes and Improvements

  • Enhanced input validation for database configurations
  • Improved error handling for database connection failures
  • Better logging for async database operations
  • Optimized cache sizing based on server capacity

Full Changelog

Added:

  • MySQL database support with HikariCP connection pooling
  • Configurable pool settings (size, timeouts, lifetime)
  • Custom JDBC properties support
  • Database type configuration (h2/mysql)
  • Comprehensive MySQL configuration tests
  • DatabaseManager constructor validation

Changed:

  • Config version bumped to v3 (automatic migration)
  • Updated H2 to 2.4.240
  • Added HikariCP 7.0.2 dependency
  • Added MySQL Connector/J 9.5.0 dependency
  • Enhanced DatabaseManager with dual-database support

Technical:

  • All dependencies shaded to prevent conflicts
  • Java 11+ compatible
  • Supports Minecraft 1.13+
  • 106 tests with full coverage of new features

Compatibility: Minecraft 1.13+ (Spigot/Paper)
Java Version: 11 or higher

For issues, questions, or feature requests, please visit our GitHub Issues.