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:
TDSTOS
2026-03-25 03:28:52 +01:00
parent cc265a1dea
commit 19bd708b59
7 changed files with 84 additions and 47 deletions

View File

@@ -134,11 +134,12 @@ class GameManager(
world.time = 0
world.setStorm( false )
val border = world.worldBorder
border.center = Location( world, 0.0, 0.0, 0.0 )
border.size = startBorder
border.damageBuffer = 0.0
border.damageAmount = 1.0
world.worldBorder.apply {
center = Location( world, 0.0, 0.0, 0.0 )
size = startBorder
damageBuffer = 0.0
damageAmount = 1.0
}
val speedEffect = PotionEffect(
PotionEffectType.SPEED,