From 94d9d014f0dd686f17ab6d5c5388f493efb11510 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 03:03:20 +0000 Subject: [PATCH 1/2] build(deps): bump the versions group with 15 updates Bumps the versions group with 15 updates: | Package | From | To | | --- | --- | --- | | [net.minecraftforge:forge](https://github.com/MinecraftForge/MinecraftForge) | `1.20.6-50.0.34` | `1.20.6-50.1.3` | | [org.jetbrains.kotlinx:kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization) | `1.6.3` | `1.7.0` | | [com.charleskorn.kaml:kaml](https://github.com/charleskorn/kaml) | `0.59.0` | `0.60.0` | | [org.jetbrains.exposed:exposed-java-time](https://github.com/JetBrains/Exposed) | `0.51.0` | `0.51.1` | | [org.jetbrains.exposed:exposed-jdbc](https://github.com/JetBrains/Exposed) | `0.51.0` | `0.51.1` | | [org.jetbrains.exposed:exposed-dao](https://github.com/JetBrains/Exposed) | `0.51.0` | `0.51.1` | | [org.jetbrains.exposed:exposed-core](https://github.com/JetBrains/Exposed) | `0.51.0` | `0.51.1` | | com.velocitypowered:velocity-api | `3.3.0-SNAPSHOT` | `4.0.0-SNAPSHOT` | | [ru.astrainteractive.astralibs:orm](https://github.com/Astra-Interactive/AstraLibs) | `3.6.0` | `3.7.0` | | [ru.astrainteractive.astralibs:core](https://github.com/Astra-Interactive/AstraLibs) | `3.6.0` | `3.7.0` | | [ru.astrainteractive.astralibs:menu-bukkit](https://github.com/Astra-Interactive/AstraLibs) | `3.6.0` | `3.7.0` | | [ru.astrainteractive.astralibs:core-bukkit](https://github.com/Astra-Interactive/AstraLibs) | `3.6.0` | `3.7.0` | | [ru.astrainteractive.astralibs:command](https://github.com/Astra-Interactive/AstraLibs) | `3.6.0` | `3.7.0` | | [ru.astrainteractive.astralibs:command-bukkit](https://github.com/Astra-Interactive/AstraLibs) | `3.6.0` | `3.7.0` | | [net.fabricmc.fabric-api:fabric-api](https://github.com/FabricMC/fabric) | `0.99.4+` | `0.100.0+1.21` | Updates `net.minecraftforge:forge` from 1.20.6-50.0.34 to 1.20.6-50.1.3 - [Commits](https://github.com/MinecraftForge/MinecraftForge/commits) Updates `org.jetbrains.kotlinx:kotlinx-serialization-json` from 1.6.3 to 1.7.0 - [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases) - [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md) - [Commits](https://github.com/Kotlin/kotlinx.serialization/compare/v1.6.3...v1.7.0) Updates `com.charleskorn.kaml:kaml` from 0.59.0 to 0.60.0 - [Release notes](https://github.com/charleskorn/kaml/releases) - [Commits](https://github.com/charleskorn/kaml/compare/0.59.0...0.60.0) Updates `org.jetbrains.exposed:exposed-java-time` from 0.51.0 to 0.51.1 - [Release notes](https://github.com/JetBrains/Exposed/releases) - [Changelog](https://github.com/JetBrains/Exposed/blob/main/CHANGELOG.md) - [Commits](https://github.com/JetBrains/Exposed/compare/0.51.0...0.51.1) Updates `org.jetbrains.exposed:exposed-jdbc` from 0.51.0 to 0.51.1 - [Release notes](https://github.com/JetBrains/Exposed/releases) - [Changelog](https://github.com/JetBrains/Exposed/blob/main/CHANGELOG.md) - [Commits](https://github.com/JetBrains/Exposed/compare/0.51.0...0.51.1) Updates `org.jetbrains.exposed:exposed-dao` from 0.51.0 to 0.51.1 - [Release notes](https://github.com/JetBrains/Exposed/releases) - [Changelog](https://github.com/JetBrains/Exposed/blob/main/CHANGELOG.md) - [Commits](https://github.com/JetBrains/Exposed/compare/0.51.0...0.51.1) Updates `org.jetbrains.exposed:exposed-core` from 0.51.0 to 0.51.1 - [Release notes](https://github.com/JetBrains/Exposed/releases) - [Changelog](https://github.com/JetBrains/Exposed/blob/main/CHANGELOG.md) - [Commits](https://github.com/JetBrains/Exposed/compare/0.51.0...0.51.1) Updates `org.jetbrains.exposed:exposed-jdbc` from 0.51.0 to 0.51.1 - [Release notes](https://github.com/JetBrains/Exposed/releases) - [Changelog](https://github.com/JetBrains/Exposed/blob/main/CHANGELOG.md) - [Commits](https://github.com/JetBrains/Exposed/compare/0.51.0...0.51.1) Updates `org.jetbrains.exposed:exposed-dao` from 0.51.0 to 0.51.1 - [Release notes](https://github.com/JetBrains/Exposed/releases) - [Changelog](https://github.com/JetBrains/Exposed/blob/main/CHANGELOG.md) - [Commits](https://github.com/JetBrains/Exposed/compare/0.51.0...0.51.1) Updates `org.jetbrains.exposed:exposed-core` from 0.51.0 to 0.51.1 - [Release notes](https://github.com/JetBrains/Exposed/releases) - [Changelog](https://github.com/JetBrains/Exposed/blob/main/CHANGELOG.md) - [Commits](https://github.com/JetBrains/Exposed/compare/0.51.0...0.51.1) Updates `com.velocitypowered:velocity-api` from 3.3.0-SNAPSHOT to 4.0.0-SNAPSHOT Updates `ru.astrainteractive.astralibs:orm` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:core` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:menu-bukkit` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:core-bukkit` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:command` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:command-bukkit` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:core` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:menu-bukkit` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:core-bukkit` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:command` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `ru.astrainteractive.astralibs:command-bukkit` from 3.6.0 to 3.7.0 - [Release notes](https://github.com/Astra-Interactive/AstraLibs/releases) - [Commits](https://github.com/Astra-Interactive/AstraLibs/compare/3.6.0...3.7.0) Updates `net.fabricmc.fabric-api:fabric-api` from 0.99.4+ to 0.100.0+1.21 - [Release notes](https://github.com/FabricMC/fabric/releases) - [Commits](https://github.com/FabricMC/fabric/commits) --- updated-dependencies: - dependency-name: net.minecraftforge:forge dependency-type: direct:production update-type: version-update:semver-patch dependency-group: versions - dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: com.charleskorn.kaml:kaml dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: org.jetbrains.exposed:exposed-java-time dependency-type: direct:production update-type: version-update:semver-patch dependency-group: versions - dependency-name: org.jetbrains.exposed:exposed-jdbc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: versions - dependency-name: org.jetbrains.exposed:exposed-dao dependency-type: direct:production update-type: version-update:semver-patch dependency-group: versions - dependency-name: org.jetbrains.exposed:exposed-core dependency-type: direct:production update-type: version-update:semver-patch dependency-group: versions - dependency-name: org.jetbrains.exposed:exposed-jdbc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: versions - dependency-name: org.jetbrains.exposed:exposed-dao dependency-type: direct:production update-type: version-update:semver-patch dependency-group: versions - dependency-name: org.jetbrains.exposed:exposed-core dependency-type: direct:production update-type: version-update:semver-patch dependency-group: versions - dependency-name: com.velocitypowered:velocity-api dependency-type: direct:production update-type: version-update:semver-major dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:orm dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:core dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:menu-bukkit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:core-bukkit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:command dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:command-bukkit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:core dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:menu-bukkit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:core-bukkit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:command dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: ru.astrainteractive.astralibs:command-bukkit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions - dependency-name: net.fabricmc.fabric-api:fabric-api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: versions ... Signed-off-by: dependabot[bot] --- forge/build.gradle.kts | 2 +- gradle/libs.versions.toml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts index 9a3219e..1e09105 100644 --- a/forge/build.gradle.kts +++ b/forge/build.gradle.kts @@ -33,7 +33,7 @@ minecraft { } dependencies { - minecraft("net.minecraftforge:forge:1.20.6-50.0.34") + minecraft("net.minecraftforge:forge:1.20.6-50.1.3") // AstraLibs implementation(libs.minecraft.astralibs.core) implementation(libs.minecraft.astralibs.command) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dcb79fa..c84aeb3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,8 @@ # Kotlin kotlin-version = "1.9.23" # https://github.com/JetBrains/kotlin kotlin-coroutines = "1.8.1" # https://github.com/Kotlin/kotlinx.coroutines -kotlin-json = "1.6.3" # https://github.com/Kotlin/kotlinx.serialization -kotlin-kaml = "0.59.0" # https://github.com/charleskorn/kaml +kotlin-json = "1.7.0" # https://github.com/Kotlin/kotlinx.serialization +kotlin-kaml = "0.60.0" # https://github.com/charleskorn/kaml # Drivers driver-jdbc = "3.46.0.0" # https://github.com/xerial/sqlite-jdbc @@ -11,14 +11,14 @@ driver-mysql = "8.0.33" # https://github.com/mysql/mysql-connector-j # Minecraft minecraft-version = "1.20.2" -minecraft-velocity = "3.3.0-SNAPSHOT" # https://github.com/PaperMC/Velocity +minecraft-velocity = "4.0.0-SNAPSHOT" # https://github.com/PaperMC/Velocity minecraft-spigot = "1.20.6-R0.1-SNAPSHOT" # https://github.com/PaperMC/Paper minecraft-papi = "2.11.6" # https://github.com/PlaceholderAPI/PlaceholderAPI minecraft-protocollib = "5.1.0" minecraft-wg = "7.0.7" minecraft-vault = "1.7.1" # https://github.com/MilkBowl/VaultAPI minecraft-coreprotect = "21.2" -minecraft-astralibs = "3.6.0" +minecraft-astralibs = "3.7.0" minecraft-bstats = "3.0.2" minecraft-mockbukkit = "3.88.1" @@ -33,7 +33,7 @@ tests-junit-bom = "5.10.2" minecraft-fabric-loom = "1.6.12" minecraft-fabric-kotlin = "1.11.0+" minecraft-fabric-loader = "0.15.11" -minecraft-fabric-api = "0.99.4+" +minecraft-fabric-api = "0.100.0+" minecraft-fabric-yarn = "1.20.2+build.4" # Shadow @@ -43,7 +43,7 @@ gradle-shadow = "8.1.1" gradle-buildconfig = "5.3.5" # Exposed -exposed = "0.51.0" +exposed = "0.51.1" [bundles] exposed = ["exposed-java-time", "exposed-jdbc", "exposed-dao", "exposed-core"] From 5c138137073ef67ac5c98531ee1f00b443a18b4c Mon Sep 17 00:00:00 2001 From: makeevrserg Date: Mon, 10 Jun 2024 14:32:54 +0300 Subject: [PATCH 2/2] fix build --- .../astratemplate/ForgeEntryPoint.kt | 14 ++++++++----- .../astratemplate/command/CommandLoader.kt | 5 +++-- gradle.properties | 2 +- gradle/libs.versions.toml | 4 ++-- .../astratemplate/core/di/CoreModule.kt | 9 --------- .../astratemplate/AstraTemplate.kt | 15 ++++++-------- .../astratemplate/AstraTemplate.kt | 20 +++++++------------ 7 files changed, 28 insertions(+), 41 deletions(-) diff --git a/forge/src/main/java/ru/astrainteractive/astratemplate/ForgeEntryPoint.kt b/forge/src/main/java/ru/astrainteractive/astratemplate/ForgeEntryPoint.kt index eee7496..34c70c6 100644 --- a/forge/src/main/java/ru/astrainteractive/astratemplate/ForgeEntryPoint.kt +++ b/forge/src/main/java/ru/astrainteractive/astratemplate/ForgeEntryPoint.kt @@ -7,6 +7,8 @@ import net.minecraftforge.event.server.ServerStartedEvent import net.minecraftforge.event.server.ServerStoppingEvent import net.minecraftforge.eventbus.api.SubscribeEvent import net.minecraftforge.fml.common.Mod +import ru.astrainteractive.astralibs.logging.JUtiltLogger +import ru.astrainteractive.astralibs.logging.Logger import ru.astrainteractive.astratemplate.command.CommandLoader import ru.astrainteractive.astratemplate.di.RootModule import ru.astrainteractive.astratemplate.event.core.ForgeEventBusListener @@ -14,26 +16,28 @@ import javax.annotation.ParametersAreNonnullByDefault @Mod(BuildKonfig.id) @ParametersAreNonnullByDefault -class ForgeEntryPoint : ForgeEventBusListener { +class ForgeEntryPoint : + ForgeEventBusListener, + Logger by JUtiltLogger("ForgeEntryPoint") { private val rootModule: RootModule by lazy { RootModule.Default() } @SubscribeEvent fun onEnable(e: ServerStartedEvent) { - rootModule.coreModule.logger.value.info("ForgeEntryPoint", "onEnable") + info { "#onEnable" } rootModule.lifecycle.onEnable() } @SubscribeEvent fun onDisable(e: ServerStoppingEvent) { - rootModule.coreModule.logger.value.info("ForgeEntryPoint", "onDisable") + info { "#onDisable" } rootModule.lifecycle.onDisable() unregister() } @SubscribeEvent fun onCommandRegister(e: RegisterCommandsEvent) { - rootModule.coreModule.logger.value.info("ForgeEntryPoint", "onCommandRegister") - val commandLoader = CommandLoader(logger = rootModule.coreModule.logger.value) + info { "#onCommandRegister" } + val commandLoader = CommandLoader() commandLoader.registerCommands(e) } diff --git a/forge/src/main/java/ru/astrainteractive/astratemplate/command/CommandLoader.kt b/forge/src/main/java/ru/astrainteractive/astratemplate/command/CommandLoader.kt index 2e3dbff..53da54d 100644 --- a/forge/src/main/java/ru/astrainteractive/astratemplate/command/CommandLoader.kt +++ b/forge/src/main/java/ru/astrainteractive/astratemplate/command/CommandLoader.kt @@ -1,14 +1,15 @@ package ru.astrainteractive.astratemplate.command import net.minecraftforge.event.RegisterCommandsEvent +import ru.astrainteractive.astralibs.logging.JUtiltLogger import ru.astrainteractive.astralibs.logging.Logger import ru.astrainteractive.astratemplate.command.core.DefaultCommandRegistry import ru.astrainteractive.astratemplate.command.helloworld.HelloWorldCommand -class CommandLoader(private val logger: Logger) { +class CommandLoader : Logger by JUtiltLogger("CommandLoader") { fun registerCommands(event: RegisterCommandsEvent) { - logger.info("CommandLoader", "registerCommands") + info { "#registerCommands" } val registry = DefaultCommandRegistry(event.dispatcher) registry.register(HelloWorldCommand()) } diff --git a/gradle.properties b/gradle.properties index 1766c45..5acbffd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ makeevrserg.java.ktarget=21 # Project makeevrserg.project.name=AstraTemplate makeevrserg.project.group=ru.astrainteractive.astratemplate -makeevrserg.project.version.string=7.5.0 +makeevrserg.project.version.string=7.5.1 makeevrserg.project.description=Template plugin for EmpireProjekt makeevrserg.project.developers=makeevrserg|Makeev Roman|makeevrserg@gmail.com makeevrserg.project.url=https://github.com/Astra-Interactive/AstraTemplate diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c84aeb3..c4a1573 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # Kotlin -kotlin-version = "1.9.23" # https://github.com/JetBrains/kotlin +kotlin-version = "2.0.0" # https://github.com/JetBrains/kotlin kotlin-coroutines = "1.8.1" # https://github.com/Kotlin/kotlinx.coroutines kotlin-json = "1.7.0" # https://github.com/Kotlin/kotlinx.serialization kotlin-kaml = "0.60.0" # https://github.com/charleskorn/kaml @@ -11,7 +11,7 @@ driver-mysql = "8.0.33" # https://github.com/mysql/mysql-connector-j # Minecraft minecraft-version = "1.20.2" -minecraft-velocity = "4.0.0-SNAPSHOT" # https://github.com/PaperMC/Velocity +minecraft-velocity = "3.3.0-SNAPSHOT" # https://github.com/PaperMC/Velocity minecraft-spigot = "1.20.6-R0.1-SNAPSHOT" # https://github.com/PaperMC/Paper minecraft-papi = "2.11.6" # https://github.com/PlaceholderAPI/PlaceholderAPI minecraft-protocollib = "5.1.0" diff --git a/modules/core/src/main/kotlin/ru/astrainteractive/astratemplate/core/di/CoreModule.kt b/modules/core/src/main/kotlin/ru/astrainteractive/astratemplate/core/di/CoreModule.kt index 4ecc256..10f870e 100644 --- a/modules/core/src/main/kotlin/ru/astrainteractive/astratemplate/core/di/CoreModule.kt +++ b/modules/core/src/main/kotlin/ru/astrainteractive/astratemplate/core/di/CoreModule.kt @@ -3,8 +3,6 @@ package ru.astrainteractive.astratemplate.core.di import kotlinx.serialization.StringFormat import ru.astrainteractive.astralibs.async.AsyncComponent import ru.astrainteractive.astralibs.lifecycle.Lifecycle -import ru.astrainteractive.astralibs.logging.JUtilFileLogger -import ru.astrainteractive.astralibs.logging.Logger import ru.astrainteractive.astralibs.serialization.YamlStringFormat import ru.astrainteractive.astratemplate.core.PluginConfiguration import ru.astrainteractive.astratemplate.core.PluginTranslation @@ -19,7 +17,6 @@ interface CoreModule { val lifecycle: Lifecycle val stringFormat: Dependency - val logger: Dependency val pluginScope: Dependency val translation: Dependency val configurationModule: Dependency @@ -30,12 +27,6 @@ interface CoreModule { override val stringFormat: Single = Single { YamlStringFormat() } - override val logger: Dependency = Single { - JUtilFileLogger( - tag = "AstraTemplate", - folder = dataFolder - ) - } override val pluginScope = Single { AsyncComponent.Default() diff --git a/plugin/src/main/kotlin/ru/astrainteractive/astratemplate/AstraTemplate.kt b/plugin/src/main/kotlin/ru/astrainteractive/astratemplate/AstraTemplate.kt index ee49a07..8e92fc0 100644 --- a/plugin/src/main/kotlin/ru/astrainteractive/astratemplate/AstraTemplate.kt +++ b/plugin/src/main/kotlin/ru/astrainteractive/astratemplate/AstraTemplate.kt @@ -3,19 +3,16 @@ package ru.astrainteractive.astratemplate import org.bukkit.event.HandlerList import org.bukkit.plugin.java.JavaPlugin import ru.astrainteractive.astralibs.lifecycle.Lifecycle +import ru.astrainteractive.astralibs.logging.JUtiltLogger +import ru.astrainteractive.astralibs.logging.Logger import ru.astrainteractive.astratemplate.di.impl.RootModuleImpl -import ru.astrainteractive.klibs.kdi.Provider -import ru.astrainteractive.klibs.kdi.getValue /** * Initial class for your plugin */ -class AstraTemplate : JavaPlugin() { +class AstraTemplate : JavaPlugin(), Logger by JUtiltLogger("AstraTemplate") { private val rootModule = RootModuleImpl() - private val jLogger by Provider { - rootModule.coreModule.logger.value - } private val lifecycles: List get() = listOf( rootModule.coreModule.lifecycle, @@ -32,9 +29,9 @@ class AstraTemplate : JavaPlugin() { * This method called when server starts or PlugMan load plugin. */ override fun onEnable() { - jLogger.info("Logger enabled", "AstraTemplate") - jLogger.warning("Warn message from logger", "AstraTemplate") - jLogger.error("Error message", "AstraTemplate") + info { "#onEnable Logger enabled" } + warn { "#onEnable Warn message from logger" } + error { "#onEnable Error message" } lifecycles.forEach(Lifecycle::onEnable) } diff --git a/velocity/src/main/kotlin/ru/astrainteractive/astratemplate/AstraTemplate.kt b/velocity/src/main/kotlin/ru/astrainteractive/astratemplate/AstraTemplate.kt index 00621f4..60efc25 100644 --- a/velocity/src/main/kotlin/ru/astrainteractive/astratemplate/AstraTemplate.kt +++ b/velocity/src/main/kotlin/ru/astrainteractive/astratemplate/AstraTemplate.kt @@ -9,15 +9,15 @@ import com.velocitypowered.api.event.proxy.ProxyInitializeEvent import com.velocitypowered.api.plugin.Plugin import com.velocitypowered.api.plugin.annotation.DataDirectory import com.velocitypowered.api.proxy.ProxyServer -import org.slf4j.Logger import ru.astrainteractive.astralibs.lifecycle.Lifecycle +import ru.astrainteractive.astralibs.logging.JUtiltLogger +import ru.astrainteractive.astralibs.logging.Logger import ru.astrainteractive.astratemplate.command.api.VelocityCommandRegistryContext import ru.astrainteractive.astratemplate.command.reload.ReloadCommandRegistry import ru.astrainteractive.astratemplate.di.RootModule import ru.astrainteractive.astratemplate.di.impl.RootModuleImpl -import ru.astrainteractive.klibs.kdi.Provider -import ru.astrainteractive.klibs.kdi.getValue import java.nio.file.Path +import org.slf4j.Logger as Slf4jLogger @Plugin( id = BuildKonfig.id, @@ -31,14 +31,11 @@ import java.nio.file.Path class AstraTemplate @Inject constructor( private val injector: Injector, private val server: ProxyServer, - private val logger: Logger, + private val logger: Slf4jLogger, @DataDirectory private val dataDirectory: Path -) { +) : Logger by JUtiltLogger("AstraTemplate") { private val rootModule: RootModule = RootModuleImpl() - private val jLogger by Provider { - rootModule.coreModule.logger.value - } private val lifecycles: List get() = listOf( rootModule.coreModule.lifecycle, @@ -56,11 +53,8 @@ class AstraTemplate @Inject constructor( this.plugin.initialize(this@AstraTemplate) } - jLogger.info(BuildKonfig.name, "Hello there! I made my first plugin with Velocity.") - jLogger.info( - BuildKonfig.name, - "Here's your configuration: ${rootModule.coreModule.configurationModule.value}." - ) + info { "Hello there! I made my first plugin with Velocity" } + info { "Here's your configuration: ${rootModule.coreModule.configurationModule.value}." } ReloadCommandRegistry( registryContext = VelocityCommandRegistryContext(