Releases: 040Elias/Spawn
Releases · 040Elias/Spawn
Release list
v1.4.0 — Minor Performance and Stability Issues Fixxed
Spawn v1.4.0 — Minor Performance and Stability Issues Fixxed
Performance Improvements
Sound Caching
- Sound lookups (
Registry.SOUNDS+NamespacedKeyparsing) are now cached in a
ConcurrentHashMap<String, Optional<Sound>>viacomputeIfAbsent() - 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 forsave()anddelete()are now wrapped in
try-catch(Exception)with full stack trace logging vialog.log(Level.SEVERE, ..., e)- Previously, any
RuntimeExceptionthrown in async DB tasks was silently
swallowed by theExecutorService
Memory Leak Fixes
UpdateChecker Lifecycle Management
HttpClientandExecutorServiceconverted fromstaticfields to instance
fields with propershutdown()methodshutdown()is called fromSpawnPlugin.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/spawnreloadand plugin disable
Code Safety
Abstract Read Methods in AbstractLocationManager
exists(),getNames(),getDisplayNames(),getLocation(),getDisplayName()
are nowabstractinstead 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
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. SpawnCommandcooldown tracking simplified fromConcurrentHashMap<UUID, Boolean>
toSet<UUID>.UpdateCheckernow uses a static reusableHttpClientand a dedicated
ExecutorService.ConfigUtildelegates to Bukkit's built-ingetInt()instead of manual parsing.
v1.2.1 - Initial Release
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