Skip to content
Open
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
18 changes: 5 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,18 @@ root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
tab_width = 4
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.gradle]
indent_style = tab

[*.java]
indent_style = tab

[*.json]
indent_style = space
indent_size = 2

[fabric.mod.json]
indent_style = tab
tab_width = 2
[*.yml]
indent_size = 2

[*.properties]
indent_style = space
indent_size = 2
indent_size = 2
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto eol=lf
gradlew text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
gradle-wrapper.jar -text -diff -merge -filter
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.gradle/
.idea/
.vscode/
bin/
build/
out/
run/
run-server/
.PVS-Studio
177 changes: 0 additions & 177 deletions build.gradle

This file was deleted.

160 changes: 160 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import com.smushytaco.lwjgl_gradle.Preset
plugins {
alias(libs.plugins.loom)
alias(libs.plugins.lwjgl)
java
}
val modVersion = providers.gradleProperty("mod_version")
val modGroup = providers.gradleProperty("mod_group")
val modName = providers.gradleProperty("mod_name")

val javaVersion = libs.versions.java.map { it.toInt() }

base.archivesName = modName
group = modGroup.get()
version = modVersion.get()
loom {
customMinecraftMetadata.set("https://downloads.betterthanadventure.net/bta-client/${libs.versions.btaChannel.get()}/v${libs.versions.bta.get()}/manifest.json")
}
repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://maven.fabricmc.net/") { name = "Fabric" }
maven("https://maven.thesignalumproject.net/infrastructure") { name = "SignalumMavenInfrastructure" }
maven("https://maven.thesignalumproject.net/releases") { name = "SignalumMavenReleases" }
ivy("https://github.com/Better-than-Adventure") {
patternLayout { artifact("[organisation]/releases/download/v[revision]/[module].jar") }
metadataSources { artifact() }
}
ivy("https://downloads.betterthanadventure.net/bta-client/${libs.versions.btaChannel.get()}/") {
patternLayout { artifact("/v[revision]/client.jar") }
metadataSources { artifact() }
}
ivy("https://downloads.betterthanadventure.net/bta-server/${libs.versions.btaChannel.get()}/") {
patternLayout { artifact("/v[revision]/server.jar") }
metadataSources { artifact() }
}
ivy("https://piston-data.mojang.com") {
patternLayout { artifact("v1/[organisation]/[revision]/[module].jar") }
metadataSources { artifact() }
}
ivy("https://github.com/") {
patternLayout { artifact("v1/[organisation]/[revision]/[module].jar") }
metadataSources { artifact() }
}
ivy("https://github.com/") {
patternLayout { artifact("[organization]/[module]/releases/download/[revision]/[module]-[revision].jar") }
metadataSources { artifact() }
}
repositories {
exclusiveContent {
forRepository {
maven("https://api.modrinth.com/maven") { name = "Modrinth" }
}
filter { includeGroup("maven.modrinth") }
}
}
}
lwjgl {
version = libs.versions.lwjgl
implementation(Preset.MINIMAL_OPENGL)
}
dependencies {
minecraft("::${libs.versions.bta.get()}")

runtimeOnly(libs.clientJar)
implementation(libs.loader)
implementation(libs.halplibe)
implementation(libs.modMenu)
implementation(libs.legacyLwjgl)

compileOnly(libs.dragonfly)

compileOnly(libs.catalyst.core)
compileOnly(libs.catalyst.effects)

compileOnly(libs.uselessNumerical.get().let { "${it.group}:${it.name}:${it.version}-${libs.versions.bta.get()}" })

compileOnly(libs.btwaila)
compileOnly(libs.commandly)

compileOnly(libs.deep)

compileOnly(libs.backpacks)

compileOnly(libs.aether)

implementation(libs.slf4jApi)
implementation(libs.guava)
implementation(libs.log4j.slf4j2.impl)
implementation(libs.log4j.core)
implementation(libs.log4j.api)
implementation(libs.log4j.api12)
implementation(libs.gson)

implementation(libs.commonsLang3)
include(libs.commonsLang3)
}
java {
toolchain {
languageVersion = javaVersion.map { JavaLanguageVersion.of(it) }
vendor = JvmVendorSpec.ADOPTIUM
}
sourceCompatibility = JavaVersion.toVersion(javaVersion.get())
targetCompatibility = JavaVersion.toVersion(javaVersion.get())
withSourcesJar()
}
val licenseFile = run {
val rootLicense = layout.projectDirectory.file("LICENSE")
val parentLicense = layout.projectDirectory.file("../LICENSE")
when {
rootLicense.asFile.exists() -> {
logger.lifecycle("Using LICENSE from project root: {}", rootLicense.asFile)
rootLicense
}
parentLicense.asFile.exists() -> {
logger.lifecycle("Using LICENSE from parent directory: {}", parentLicense.asFile)
parentLicense
}
else -> {
logger.warn("No LICENSE file found in project or parent directory.")
null
}
}
}
tasks {
withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
sourceCompatibility = javaVersion.get().toString()
targetCompatibility = javaVersion.get().toString()
if (javaVersion.get() > 8) options.release = javaVersion
}
named<UpdateDaemonJvm>("updateDaemonJvm") {
languageVersion = libs.versions.gradleJava.map { JavaLanguageVersion.of(it.toInt()) }
vendor = JvmVendorSpec.ADOPTIUM
}
withType<JavaExec>().configureEach { defaultCharacterEncoding = "UTF-8" }
withType<Javadoc>().configureEach { options.encoding = "UTF-8" }
withType<Test>().configureEach { defaultCharacterEncoding = "UTF-8" }
withType<Jar>().configureEach {
licenseFile?.let {
from(it) {
rename { original -> "${original}_${archiveBaseName.get()}" }
}
}
}
processResources {
val resourceMap = mapOf(
"version" to modVersion.get(),
"fabricloader" to libs.versions.loader.get(),
"halplibe" to libs.versions.halplibe.get(),
"java" to libs.versions.java.get(),
"modmenu" to libs.versions.modMenu.get()
)
inputs.properties(resourceMap)
filesMatching("fabric.mod.json") { expand(resourceMap) }
filesMatching("**/*.mixins.json") { expand(resourceMap.filterKeys { it == "java" }) }
}
}
// Removes LWJGL2 dependencies
configurations.configureEach { exclude(group = "org.lwjgl.lwjgl") }
Loading