diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb51e2e..5fe9cba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,11 +14,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 16 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: adopt - java-version: 16 + java-version: 17 cache: gradle - name: Grant execute permission for gradlew diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index e5bb6a6..ad198d3 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -14,11 +14,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 16 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: adopt - java-version: 16 + java-version: 17 cache: gradle - name: Grant execute permission for gradlew diff --git a/build.gradle.kts b/build.gradle.kts index 449dd10..4e0d707 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,11 @@ -import Com_mineinabyss_conventions_platform_gradle.Deps - val idofrontVersion: String by project plugins { - id("com.mineinabyss.conventions.kotlin") - id("com.mineinabyss.conventions.papermc") - id("com.mineinabyss.conventions.copyjar") - id("com.mineinabyss.conventions.publication") - id("com.mineinabyss.conventions.testing") + alias(libs.plugins.mia.kotlin) + alias(libs.plugins.mia.papermc) + alias(libs.plugins.mia.copyjar) + alias(libs.plugins.mia.publication) + alias(libs.plugins.mia.testing) kotlin("plugin.serialization") } @@ -16,25 +14,25 @@ repositories { maven("https://oss.sonatype.org/content/groups/public/") maven("https://www.rutgerkok.nl/repo") maven("https://repo.dmulloy2.net/nexus/repository/public/") - maven("https://repo.mineinabyss.com/releases") + maven("https://repo.mineinabyss.com/releases/") maven("https://papermc.io/repo/repository/maven-public/") //Paper maven("https://repo.codemc.org/repository/maven-public/") - maven("https://mvn.intellectualsites.com/content/repositories/releases/") // FAWE + //maven("https://mvn.intellectualsites.com/content/repositories/releases/") // FAWE maven("https://jitpack.io") } dependencies { // MineInAbyss platform - compileOnly(Deps.kotlin.stdlib) - compileOnly(Deps.kotlinx.serialization.json) - compileOnly(Deps.kotlinx.serialization.kaml) - compileOnly(Deps.minecraft.skedule) + compileOnly(libs.kotlin.stdlib) + compileOnly(libs.kotlinx.serialization.json) + compileOnly(libs.kotlinx.serialization.kaml) + compileOnly(libs.minecraft.skedule) // Plugin APIs - compileOnly("com.fastasyncworldedit:FAWE-Bukkit:1.17-47") { isTransitive = false } - compileOnly("com.fastasyncworldedit:FAWE-Core:1.17-47") - compileOnly("nl.rutgerkok:blocklocker:1.9.2") - compileOnly("com.comphenix.protocol:ProtocolLib:4.5.0") + compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.0.1") + compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.0.1") { isTransitive = false } + compileOnly("nl.rutgerkok:blocklocker:1.10.4") + compileOnly("com.comphenix.protocol:ProtocolLib:4.8.0-SNAPSHOT") // Shaded implementation("com.mineinabyss:idofront:$idofrontVersion") diff --git a/gradle.properties b/gradle.properties index 2e1a85b..daa0836 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group=com.mineinabyss version=0.4 -kotlinVersion=1.6.10 -serverVersion=1.17.1-R0.1-SNAPSHOT -idofrontConventions=1.6.10-51 +kotlinVersion=1.6.20-RC +serverVersion=1.18.2-R0.1-SNAPSHOT +idofrontConventions=1.6.20-RC-70 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 05679dc..00e33ed 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 9f3b1f4..3e800d0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,23 +2,22 @@ pluginManagement { repositories { gradlePluginPortal() maven("https://repo.mineinabyss.com/releases") + maven("https://papermc.io/repo/repository/maven-public/") //Paper } plugins { val kotlinVersion: String by settings id("org.jetbrains.kotlin.jvm") version kotlinVersion id("org.jetbrains.kotlin.plugin.serialization") version kotlinVersion - id("com.github.johnrengelman.shadow") version "6.0.0" - id("io.github.0ffz.github-packages") version "1.2.0" } +} +dependencyResolutionManagement { val idofrontConventions: String by settings - resolutionStrategy { - eachPlugin { - if (requested.id.id.startsWith("com.mineinabyss.conventions")) - useVersion(idofrontConventions) - } + repositories { + maven("https://repo.mineinabyss.com/releases") } + versionCatalogs.create("libs").from("com.mineinabyss:catalog:$idofrontConventions") } rootProject.name = "deeperworld" diff --git a/src/main/kotlin/com/mineinabyss/deeperworld/DeeperCommandExecutor.kt b/src/main/kotlin/com/mineinabyss/deeperworld/DeeperCommandExecutor.kt index 8801f8c..637360e 100644 --- a/src/main/kotlin/com/mineinabyss/deeperworld/DeeperCommandExecutor.kt +++ b/src/main/kotlin/com/mineinabyss/deeperworld/DeeperCommandExecutor.kt @@ -1,6 +1,5 @@ package com.mineinabyss.deeperworld -import com.fastasyncworldedit.core.util.EditSessionBuilder import com.fastasyncworldedit.core.util.TaskManager import com.mineinabyss.deeperworld.MinecraftConstants.FULL_DAY_TIME import com.mineinabyss.deeperworld.config.DeeperConfig @@ -20,6 +19,7 @@ import com.mineinabyss.idofront.messaging.error import com.mineinabyss.idofront.messaging.info import com.mineinabyss.idofront.messaging.success import com.sk89q.worldedit.EditSession +import com.sk89q.worldedit.WorldEdit import com.sk89q.worldedit.bukkit.WorldEditPlugin import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard import com.sk89q.worldedit.function.operation.ForwardExtentCopy @@ -108,9 +108,10 @@ class DeeperCommandExecutor : IdofrontCommandExecutor(), TabCompleter { val clipboard = BlockArrayClipboard(region) val wep = WorldEditPlugin.getInstance().bukkitImplAdapter; val weWorld: World = wep.adapt(player.world) - val editSession: EditSession = EditSessionBuilder(weWorld) - .limitUnlimited() - .build() + val editSession: EditSession = WorldEdit.getInstance().newEditSessionBuilder() + .world(weWorld) + .limitUnlimited() + .build() val loc = player.location val linkedSection = diff --git a/src/main/kotlin/com/mineinabyss/deeperworld/DeeperWorldPlugin.kt b/src/main/kotlin/com/mineinabyss/deeperworld/DeeperWorldPlugin.kt index 38b7145..47ed4bb 100644 --- a/src/main/kotlin/com/mineinabyss/deeperworld/DeeperWorldPlugin.kt +++ b/src/main/kotlin/com/mineinabyss/deeperworld/DeeperWorldPlugin.kt @@ -28,9 +28,9 @@ class DeeperWorldPlugin : JavaPlugin() { override fun onLoad() { IdofrontPlatforms.load(this, "mineinabyss") } + override fun onEnable() { saveDefaultConfig() - registerService(WorldManagerImpl(config)) DeeperConfig.load() @@ -49,7 +49,7 @@ class DeeperWorldPlugin : JavaPlugin() { // Initialize falling damage task if (DeeperConfig.data.fall.maxSafeDist >= 0f && DeeperConfig.data.fall.fallDistanceDamageScaler >= 0.0) { - schedule { + deeperWorld.schedule { repeating(DeeperConfig.data.fall.hitDelay.inWholeTicks.coerceAtLeast(1)) while (true) { server.onlinePlayers.forEach { @@ -63,8 +63,8 @@ class DeeperWorldPlugin : JavaPlugin() { // Initialize time synchronization task if (DeeperConfig.data.time.syncedWorlds.isNotEmpty()) { DeeperConfig.data.time.mainWorld?.let { mainWorld -> - schedule { - repeating(DeeperConfig.data.time.updateInterval.inWholeTicks) + deeperWorld.schedule { + repeating(DeeperConfig.data.time.updateInterval.inWholeTicks.coerceAtLeast(1)) while (true) { val mainWorldTime = mainWorld.time DeeperConfig.data.time.syncedWorlds.forEach { (world, offset) -> @@ -78,7 +78,7 @@ class DeeperWorldPlugin : JavaPlugin() { } override fun onDisable() { - MovementListener.temporaryBedrock.forEach{ + MovementListener.temporaryBedrock.forEach { it.type = Material.AIR } }