Skip to content

Releases: 040Elias/Spawn

v1.4.0 — Minor Performance and Stability Issues Fixxed

Choose a tag to compare

@040Elias 040Elias released this 04 Apr 19:04

Spawn v1.4.0 — Minor Performance and Stability Issues Fixxed

Performance Improvements

Sound Caching

  • Sound lookups (Registry.SOUNDS + NamespacedKey parsing) are now cached in a
    ConcurrentHashMap<String, Optional<Sound>> via computeIfAbsent()
  • Previously, every countdown tick per player triggered a full Registry lookup
  • Invalid/empty sound names are also cached to avoid repeated parse attempts
  • Cache is automatically cleared on /spawnreload

Display Name Caching

  • Tab-completion display names are now cached in a volatile List<String>
    instead of re-sorting the entire map on every keystroke
  • Cache is invalidated automatically on setSpawn() / deleteSpawn()

Stability Improvements

Async DB Error Handling

  • dbExecutor.execute() tasks for save() and delete() are now wrapped in
    try-catch(Exception) with full stack trace logging via log.log(Level.SEVERE, ..., e)
  • Previously, any RuntimeException thrown in async DB tasks was silently
    swallowed by the ExecutorService

Memory Leak Fixes

UpdateChecker Lifecycle Management

  • HttpClient and ExecutorService converted from static fields to instance
    fields with proper shutdown() method
  • shutdown() is called from SpawnPlugin.onDisable() before SpawnManager shutdown
  • Fixes: ClassLoader/thread leak on plugin reload — static threads and
    HttpClient previously survived class unloading

Sound Cache Cleanup

  • SoundUtil.clearCache() called on both /spawnreload and plugin disable

Code Safety

Abstract Read Methods in AbstractLocationManager

  • exists(), getNames(), getDisplayNames(), getLocation(), getDisplayName()
    are now abstract instead of concrete DB-query implementations
  • Forces subclasses to provide cache-backed implementations
  • Prevents: Accidental synchronous DB access on main/region thread
    (MSPT spikes, Folia threading violations)

Files Changed

File Change
SoundUtil.java Added ConcurrentHashMap sound cache + clearCache()
UpdateChecker.java Static → instance fields, added shutdown()
SpawnPlugin.java Lifecycle management for UpdateChecker + SoundUtil
AbstractLocationManager.java Read methods → abstract
SpawnManager.java Async error handling + displayNames caching
ReloadCommand.java Call SoundUtil.clearCache() on reload

Compatibility

  • Folia-safe: All changes maintain thread safety
  • Config: No config format changes — drop-in upgrade from v1.3.0

v1.3.0 — Performance & Modernization Update

Choose a tag to compare

@040Elias 040Elias released this 04 Apr 16:52

Spawn v1.3.0 — Performance & Modernization Update

Performance

  • Spawn lookups are now instant (O(1)) — all reads served from an in-memory
    ConcurrentHashMap cache instead of hitting the database.
  • Async database writes — setting or deleting spawns no longer blocks the
    main server thread.
  • Bulk-load at startup — all spawns are loaded into cache once during
    plugin initialization.

Reliability

  • Fixed shutdown order — SpawnManager now flushes pending writes before the
    database connection is closed.
  • Null-safety — world references are validated before saving locations,
    preventing potential NPEs.
  • Spawn name validation — names are now validated against
    ^[a-zA-Z0-9_-]{1,32}$ to prevent invalid entries.
  • Proper interrupt handling in UpdateChecker — no more swallowed
    InterruptedExceptions.

Internal Improvements

  • Migrated all message components from raw()component() for proper
    Adventure API color rendering.
  • SpawnCommand cooldown tracking simplified from ConcurrentHashMap<UUID, Boolean>
    to Set<UUID>.
  • UpdateChecker now uses a static reusable HttpClient and a dedicated
    ExecutorService.
  • ConfigUtil delegates to Bukkit's built-in getInt() instead of manual parsing.

v1.2.1 - Initial Release

Choose a tag to compare

@040Elias 040Elias released this 04 Apr 16:15

Spawn v1.2.1 — Initial Release

A lightweight Folia-native spawn plugin with SQLite database storage.

Features

  • Multiple Spawns — Create and manage multiple named spawn points
  • Folia Support — Fully compatible with Folia-based servers
  • SQLite Storage — Persistent spawn storage using SQLite database
  • Teleport Delay — Configurable teleport countdown with cancel-on-move
  • Teleport Sounds — Configurable sounds for teleporting, countdown, and errors
  • Update Checker — Automatic update notifications via GitHub or Modrinth
  • Customizable Messages — Full message configuration with MiniMessage support

Commands

Command Description
/spawn [name] Teleport to a spawn point
/setspawn <name> Set a new spawn point
/delspawn <name> Delete a spawn point
/spawnreload Reload the configuration

Requirements

  • Java 21+
  • Folia 1.21.x