Unofficial site, not affiliated with modrinth.com.What is this?
Плагины/XGamemode
XGamemode

XGamemode

You're not switching modes, you're switching dimensions.

2.0K
4
Все версииOptimizations lol

Optimizations lol

Beta2 нед. назад

Список изменений

Added

  • Added database connection retry mechanism with MAX_RETRY_ATTEMPTS (3) and RETRY_DELAY_MS (1000ms) for MySQL/SQLite.
  • Added ensureConnection() and reconnect() methods for automatic database connection recovery.
  • Added executeWithRetry(), executeUuidQueryWithRetry(), and executeVoidWithRetry() helper methods to wrap SQL operations with retry logic.
  • Added cross-server compatibility for offline player targeting: When a player name is not found in the local memory cache (nameToUUIDs), the plugin now queries the database directly via queryUuidByName().
  • Added -offline, -online, and -all flags to batch target processing.
  • Added PlayerQuitEvent handler to clean up playerLocks when a player disconnects, preventing potential memory leaks.
  • Added proper index creation handling (createIndexSafe) with fallback checks for MySQL vs SQLite metadata differences.
  • Added GamemodeChangeEvent custom event that is called when a player's gamemode is changed by the plugin.

Fixed

  • Fixed database index creation to check for existing indexes before attempting CREATE INDEX to prevent SQL errors on MySQL.
  • Fixed onPlayerJoin event to use Optional for loadPlayerMode and properly handle null stored gamemodes without triggering unnecessary errors.
  • Fixed savePlayerMode to ensure player name is correctly updated in the database when saving gamemode.
  • Fixed setPlayerMode API method to handle exceptions and return false on failure rather than always returning true.
  • Fixed YAML caching to properly wrap saves in synchronized blocks to prevent concurrent modification issues.
  • Fixed loadData to properly populate nameToUUIDs and uuidToName mappings from both YAML and SQL storage.
  • Fixed handleSinglePlayer to check for player name in database when local cache misses, improving cross-server or bungeecord network support.
  • Fixed processOfflinePlayersData to use database batch operations for SQL storage instead of locking each player individually, greatly improving performance.

Changed

  • Refactored database initialization to use a dedicated dbUrl, dbUser, and dbPass fields instead of constructing the connection string inline.
  • Updated loadPlayerMode to use executeWithRetry for robust SQL error handling and Optional<GameMode> return type.
  • Improved setPlayerGamemodeLocked logic to check player.isOnline() before scheduling tasks.
  • Enhanced handleGamemodeTarget to use async() for both batch and single player operations to avoid blocking the main thread.
  • Replaced explicit try-catch blocks with executeWithRetry wrappers in database operations for cleaner code.
  • Changed handleBatchPlayers and handleSinglePlayer to use sync() for sending messages to ensure thread safety.
  • Improved migrateFromYamlIfNeeded to handle ON DUPLICATE KEY UPDATE properly on MySQL.
  • Optimized processOfflinePlayersData to use batch SQL execution (executeBatch()) with BATCH_SIZE instead of individual updates.

Removed

  • Removed tryReadLock(), unlockRead(), and withReadLock() methods as they were unused in the new version.
  • Removed saveAllSync() method as it was unused.
  • Removed direct Statement usage in initDatabase() in favor of try-with-resources and prepared statements.
  • Removed redundant player mode saving in onPlayerJoin (no longer forces save if gamemode didn't change).
  • Removed manual thread sleeping in processOfflinePlayersData for SQL storage, as batch processing handles this efficiently.

Файлы

XGamemode-4.5-beta.jar(20.31 KiB)
Основной
Скачать

Метаданные

Канал релиза

Beta

Номер версии

4.5-beta

Загрузчики

Bukkit
Folia
Paper
Purpur
Spigot

Версии игры

1.7.10–26.1.2

Загрузок

6

Дата публикации

2 нед. назад

Загрузил

ID версии

Главная