Refactor language, kits, and event handling
Major refactor and bugfixes across language loading, kit lifecycle, and event handling:
- LanguageManager: Introduce LangData to hold string and list entries, load YAML lists alongside strings, and centralize retrieval (avoid reloading files at access time).
- GameManager: Use apply {} to configure worldBorder more concisely.
- KitManager.clearAll: Handle offline players by cleaning chargeData without calling lifecycle hooks (onActivate/onDeactivate cannot run for offline players).
- GoblinKit: Track per-player steal BukkitTask, cancel tasks on kit removal, only restore kits if player is still alive, and fix inventory removal by removing cached items and cleaning cache.
- KitEventDispatcher: Use null-safe chaining for victim passive hooks and early-return on non-block-position moves to ignore head-rotation events.
- GameStateListener: Add feastStarted flag placeholder and adjust iron ore handling/messages; add TODO for DB update.
- Extensions: Change legacySerializer visibility to internal.
These changes improve stability around scheduled tasks, offline cleanup, and language list support.
This commit is contained in:
@@ -129,7 +129,16 @@ class KitManager(
|
||||
fun clearAll()
|
||||
{
|
||||
selectedKits.keys.toList().forEach { uuid ->
|
||||
plugin.server.getPlayer( uuid )?.let { removeKit( it ) }
|
||||
val player = plugin.server.getPlayer( uuid )
|
||||
if ( player != null )
|
||||
removeKit( player )
|
||||
else
|
||||
{
|
||||
// Daten bereinigen ohne Lifecycle-Hooks (Spieler ist offline)
|
||||
chargeData.remove( uuid )
|
||||
// Hinweis: onDeactivate/onRemove können nicht aufgerufen werden
|
||||
// → Kits müssen in onActivate gestartete Tasks UUID-basiert führen
|
||||
}
|
||||
}
|
||||
selectedKits.clear()
|
||||
selectedPlaystyles.clear()
|
||||
|
||||
Reference in New Issue
Block a user