diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0fa075b..5b7515a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,2 @@ -* @OneLiteFeatherNET/solarsystem-maintainers +* @OneLiteFeatherNET/attollo-maintainers /.github/CODEOWNERS @OneLiteFeatherNET/core-team \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 18a2194..0f00887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,10 @@ ## [Unreleased] ### Added +- Folia Support ### Changed +- Improved build config ### Deprecated diff --git a/build.gradle.kts b/build.gradle.kts index ab6c2ee..14042ac 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,11 @@ import io.papermc.hangarpublishplugin.model.Platforms import net.minecrell.pluginyml.bukkit.BukkitPluginDescription.Permission.Default +import xyz.jpenilla.runpaper.task.RunServer plugins { kotlin("jvm") version "1.8.10" id("com.github.johnrengelman.shadow") version "7.1.2" - id("xyz.jpenilla.run-paper") version "2.0.1" + id("xyz.jpenilla.run-paper") version "2.0.2-SNAPSHOT" id("net.minecrell.plugin-yml.bukkit") version "0.5.3" id("io.papermc.hangar-publish-plugin") version "0.0.3" id("com.modrinth.minotaur") version "2.+" @@ -14,7 +15,20 @@ plugins { group = "dev.themeinerlp" val baseVersion = "1.0.1" -val minecraftVersion = "1.16.5" +val minecraftVersion = "1.19.4" +val supportedMinecraftVersions = listOf( + "1.16.5", + "1.17", + "1.17.1", + "1.18", + "1.18.1", + "1.18.2", + "1.19", + "1.19.1", + "1.19.2", + "1.19.3", + "1.19.4" +) repositories { mavenCentral() @@ -22,7 +36,7 @@ repositories { } dependencies { - compileOnly("com.destroystokyo.paper:paper-api:$minecraftVersion-R0.1-SNAPSHOT") + compileOnly("dev.folia:folia-api:$minecraftVersion-R0.1-SNAPSHOT") } kotlin { @@ -51,8 +65,25 @@ tasks { jvmTarget = "17" } } - runServer { + supportedMinecraftVersions.forEach { + register("run-$it") { + minecraftVersion(it) + jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true") + group = "run paper" + runDirectory.set(file("run-$it")) + } + } + register("runFolia") { + downloadsApiService.set(xyz.jpenilla.runtask.service.DownloadsAPIService.folia(project)) minecraftVersion(minecraftVersion) + group = "run paper" + runDirectory.set(file("run-folia")) + jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true") + } + generateBukkitPluginDescription { + doLast { + outputDirectory.file(fileName).get().asFile.appendText("folia-supported: true") + } } } @@ -100,7 +131,7 @@ hangarPublish { platforms { register(Platforms.PAPER) { jar.set(tasks.shadowJar.flatMap { it.archiveFile }) - platformVersions.set(listOf("1.16.5","1.17","1.17.1","1.18","1.18.1","1.18.2","1.19", "1.19.1", "1.19.2", "1.19.3","1.19.4")) + platformVersions.set(supportedMinecraftVersions) } } } @@ -121,23 +152,10 @@ if (System.getenv().containsKey("CI")) { versionNumber.set(finalVersion) versionType.set(System.getenv("MODRINTH_CHANNEL")) uploadFile.set(tasks.shadowJar as Any) - gameVersions.addAll( - listOf( - "1.16.5", - "1.17", - "1.17.1", - "1.18", - "1.18.1", - "1.18.2", - "1.19", - "1.19.1", - "1.19.2", - "1.19.3", - "1.19.4" - ) - ) + gameVersions.addAll(supportedMinecraftVersions) loaders.add("paper") loaders.add("bukkit") + loaders.add("folia") changelog.set(project.changelog.renderItem(project.changelog.get(baseVersion))) dependencies { // A special DSL for creating dependencies } diff --git a/settings.gradle.kts b/settings.gradle.kts index 8ccbe16..e5d450b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,10 @@ - rootProject.name = "Attollo" - +pluginManagement { + repositories { + gradlePluginPortal() + maven { + name = "jmp repository" + url = uri("https://repo.jpenilla.xyz/snapshots") + } + } +} diff --git a/src/main/kotlin/dev/themeinerlp/attollo/listener/AttolloListener.kt b/src/main/kotlin/dev/themeinerlp/attollo/listener/AttolloListener.kt index 3af3377..2666a22 100644 --- a/src/main/kotlin/dev/themeinerlp/attollo/listener/AttolloListener.kt +++ b/src/main/kotlin/dev/themeinerlp/attollo/listener/AttolloListener.kt @@ -42,11 +42,11 @@ class AttolloListener(private val attollo: Attollo) : Listener { ((blockLocation.blockY + 1)..height).map { world.getBlockAt(blockLocation.blockX, it, blockLocation.blockZ) } - .first { it.type == attollo.elevatorBlock }.location + .firstOrNull() { it.type == attollo.elevatorBlock }?.location ?: return } else { ((blockLocation.blockY - 1) downTo depth).map { world.getBlockAt(blockLocation.blockX, it, blockLocation.blockZ) - }.first { it.type == attollo.elevatorBlock }.location + }.firstOrNull() { it.type == attollo.elevatorBlock }?.location ?: return } found.yaw = location.yaw found.pitch = location.pitch