Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full featured folia support #3

Merged
merged 4 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* @OneLiteFeatherNET/solarsystem-maintainers
* @OneLiteFeatherNET/attollo-maintainers
/.github/CODEOWNERS @OneLiteFeatherNET/core-team
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
## [Unreleased]

### Added
- Folia Support

### Changed
- Improved build config

### Deprecated

Expand Down
58 changes: 38 additions & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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.+"
Expand All @@ -14,15 +15,28 @@ 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()
maven("https://papermc.io/repo/repository/maven-public/")
}

dependencies {
compileOnly("com.destroystokyo.paper:paper-api:$minecraftVersion-R0.1-SNAPSHOT")
compileOnly("dev.folia:folia-api:$minecraftVersion-R0.1-SNAPSHOT")
}

kotlin {
Expand Down Expand Up @@ -51,8 +65,25 @@ tasks {
jvmTarget = "17"
}
}
runServer {
supportedMinecraftVersions.forEach {
register<RunServer>("run-$it") {
minecraftVersion(it)
jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true")
group = "run paper"
runDirectory.set(file("run-$it"))
}
}
register<RunServer>("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")
}
}
}

Expand Down Expand Up @@ -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)
}
}
}
Expand All @@ -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
}
Expand Down
11 changes: 9 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

rootProject.name = "Attollo"

pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = "jmp repository"
url = uri("https://repo.jpenilla.xyz/snapshots")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down