Add kit system, KitManager and Goblin kit
Introduce a full kit framework and supporting utilities. - Add core kit API: Kit, Playstyle, ActiveAbility, PassiveAbility, AbilityResult, charge state and PlayerChargeData. - Implement KitManager for registration, lobby selections, apply/remove/clear lifecycle and charge tracking. - Add KitEventDispatcher listener to centralize kit event handling (interact, hits, move) and integrate passive/active hooks. - Provide example kit implementations: GoblinKit (functional abilities) and TemplateKit (reference). - Add utilities: ItemBuilder and WorldEditUtils (WorldEdit-based sphere creation). - Integrate into plugin: SpeedHG now initialises KitManager, registers kits and KitEventDispatcher, applies kits at game start and clears on end. - LanguageManager: add default message/list/component helpers. - Build changes: bump Kotlin plugin to 2.2.0 and add WorldEdit compileOnly deps; also expose legacySerializer in Extensions. These changes implement the kit feature set (items, abilities, charge/recharge flow) and wire it into the game lifecycle.
This commit is contained in:
@@ -65,6 +65,13 @@ class LanguageManager(
|
||||
return langMap?.get( key ) ?: "<red>Missing Key: $key</red>"
|
||||
}
|
||||
|
||||
fun getDefaultRawMessage(
|
||||
key: String
|
||||
): String
|
||||
{
|
||||
return languages[ defaultLanguage ]?.get( key ) ?: "<red>Missing Key: $key</red>"
|
||||
}
|
||||
|
||||
fun getRawMessageList(
|
||||
player: Player,
|
||||
key: String
|
||||
@@ -79,7 +86,16 @@ class LanguageManager(
|
||||
|
||||
val file = File( plugin.dataFolder, "languages/$locale.yml" )
|
||||
val config = YamlConfiguration.loadConfiguration( file )
|
||||
return if (config.contains( key )) config.getStringList( key ) else listOf("<red>Missing List: $key</red>")
|
||||
return if (config.contains( key )) config.getStringList( key ) else listOf( "<red>Missing List: $key</red>" )
|
||||
}
|
||||
|
||||
fun getDefaultRawMessageList(
|
||||
key: String
|
||||
): List<String>
|
||||
{
|
||||
val file = File( plugin.dataFolder, "languages/$defaultLanguage.yml" )
|
||||
val config = YamlConfiguration.loadConfiguration( file )
|
||||
return if (config.contains( key )) config.getStringList( key ) else listOf( "<red>Missing List: $key</red>" )
|
||||
}
|
||||
|
||||
fun getComponent(
|
||||
@@ -93,4 +109,14 @@ class LanguageManager(
|
||||
return miniMessage.deserialize( raw, *tags.toTypedArray() )
|
||||
}
|
||||
|
||||
fun getDefaultComponent(
|
||||
key: String,
|
||||
placeholders: Map<String, String>
|
||||
): Component
|
||||
{
|
||||
val raw = languages[ defaultLanguage ]?.get( key ) ?: "<red>Missing Key: $key</red>"
|
||||
val tags = placeholders.map { (k, v) -> Placeholder.parsed( k, v ) }
|
||||
return miniMessage.deserialize( raw, *tags.toTypedArray() )
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user