Skip to content

Commit

Permalink
updated AstraLibs to 2.0.17; version increased
Browse files Browse the repository at this point in the history
  • Loading branch information
makeevrserg committed Jan 4, 2023
1 parent 016846e commit 72bd7e3
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 36 deletions.
1 change: 0 additions & 1 deletion domain/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id("basic-java")
}

dependencies {
// Kotlin
implementation(libs.kotlinGradlePlugin)
Expand Down
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
# Plugin/Mod core
plugin = "4.0.0"
plugin = "4.1.0"
name = "AstraTemplate"
group = "com.astrainteractive"
description = "Template plugin for EmpireProjekt"
Expand All @@ -14,7 +14,7 @@ json = "1.3.3"
kaml = "0.46.0"
exposed = "0.38.1"
jdbc = "3.36.0.3"
astraLibs = "2.0.13"
astraLibs = "2.0.17"
mysqlDriver = "8.0.20"
xerialSqliteJdbcVersion = "3.34.0"
# Build
Expand Down Expand Up @@ -49,6 +49,7 @@ fabric-api = "0.60.0+1.19.2"
# Forge
netMinecraftForge = "5.1.+"
forge-version = "1.19-41.0.35"
junit-bom = "5.7.0"
[libraries]
# Core
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
Expand All @@ -60,6 +61,7 @@ kotlin-serializationJson = { module = "org.jetbrains.kotlinx:kotlinx-serializati
kotlin-serializationKaml = { module = "com.charleskorn.kaml:kaml", version.ref = "kaml" }
astralibs-ktxCore = { module = "ru.astrainteractive.astralibs:ktx-core", version.ref = "astraLibs" }
astralibs-spigotCore = { module = "ru.astrainteractive.astralibs:spigot-core", version.ref = "astraLibs" }
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit-bom" }
xerial-sqlite-jdbc = { module = "org.xerial:sqlite-jdbc", version.ref = "jdbc" }
exposed-java-time = { module = "org.jetbrains.exposed:exposed-java-time", version.ref = "exposed" }
exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" }
Expand Down
11 changes: 8 additions & 3 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@ dependencies {
implementation(libs.astralibs.ktxCore)
implementation(libs.astralibs.spigotCore)
implementation(libs.bstats.bukkit)
// Test
testImplementation(kotlin("test"))
testImplementation(libs.orgTesting)
// Spigot dependencies
compileOnly(libs.essentialsx)
compileOnly(libs.paperApi)
compileOnly(libs.spigotApi)
compileOnly(libs.spigot)
// Test-Core
testImplementation(platform(libs.junit.bom))
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter")
// Test-libs
testImplementation(libs.coroutines.core)
testImplementation(libs.coroutines.coreJvm)
testImplementation(libs.xerial.sqlite.jdbc)
// Local
implementation(project(":domain"))
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package ru.astrainteractive.astratemplate

import CommandManager
import kotlinx.coroutines.cancel
import ru.astrainteractive.astratemplate.modules.SQLDatabaseModule
import ru.astrainteractive.astratemplate.modules.TranslationModule
import kotlinx.coroutines.runBlocking
import org.bukkit.event.HandlerList
import org.bukkit.plugin.java.JavaPlugin
import ru.astrainteractive.astralibs.AstraLibs
import ru.astrainteractive.astralibs.Logger
import ru.astrainteractive.astralibs.ServerVersion
import ru.astrainteractive.astralibs.async.PluginScope
import ru.astrainteractive.astralibs.events.GlobalEventManager
import ru.astrainteractive.astratemplate.events.EventHandler
import ru.astrainteractive.astratemplate.modules.PluginConfigModule
Expand Down Expand Up @@ -53,6 +54,7 @@ class AstraTemplate : JavaPlugin() {
runBlocking { SQLDatabaseModule.value.closeConnection() }
HandlerList.unregisterAll(this)
GlobalEventManager.onDisable()
PluginScope.cancel()
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import ru.astrainteractive.astralibs.events.DSLEvent
* This is a most convenient way to use bukkit events in kotlin
*/
class MultipleEventsDSL {
val blockBreakEvent = DSLEvent.event(BlockBreakEvent::class.java) {
val blockBreakEvent = DSLEvent.event<BlockBreakEvent> {
println("blockBreakEvent ${it.player.name}")
}

val entityDamageEvent = DSLEvent.event(EntityDamageEvent::class.java) {
val entityDamageEvent = DSLEvent.event<EntityDamageEvent>{
println("entityDamageEvent ${it.entity.name}")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class SampleGUI(player: Player) : PaginatedMenu() {
}

override fun onInventoryClicked(e: InventoryClickEvent) {
super.onInventoryClicked(e)
e.isCancelled = true
handleChangePageClick(e.slot)
if (e.slot == addUserButton.index)
addUserButton.onClick(e)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class SampleGUIViewModel(
}

fun onUiCreated() = viewModelScope.launch(Dispatchers.IO) {
Logger.log("onUiCreated")
Logger.log("SampleGuiViewModel","onUiCreated")
delay(1000)
loadItemsState()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ru.astrainteractive.astralibs.di.module
import ru.astrainteractive.astralibs.di.reloadable
import ru.astrainteractive.astralibs.di.value
import ru.astrainteractive.astralibs.rest.RestRequester
import ru.astrainteractive.astralibs.utils.toClass
import ru.astrainteractive.astratemplate.api.ItemStackSpigotAPI
import ru.astrainteractive.astratemplate.gui.SampleGUIViewModel
import ru.astrainteractive.astratemplate.utils.Files
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package ru.astrainteractive.astratemplate.utils

sealed class AstraPermission(override val value: String):IPermission {
import ru.astrainteractive.astralibs.utils.IPermission

sealed class AstraPermission(override val value: String): IPermission {
object Reload : AstraPermission("astra_template.reload")
object Damage : AstraPermission("astra_template.damage")
}

This file was deleted.

5 changes: 0 additions & 5 deletions plugin/src/main/resources/META-INF/MANIFEST.MF

This file was deleted.

2 changes: 1 addition & 1 deletion plugin/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
main: ru.astrainteractive.astratemplate.AstraTemplate
prefix: AstraTemplate
prefix: '${name}'
description: '${description}'
version: '${version}'
name: '${name}'
Expand Down

0 comments on commit 72bd7e3

Please sign in to comment.