style: clean up

This commit is contained in:
xtex 2023-06-29 20:42:06 +08:00
parent 2bd368ff4c
commit baf865e80b
Signed by: xtex
GPG Key ID: B918086ED8045B91
6 changed files with 16 additions and 37 deletions

View File

@ -17,15 +17,9 @@ subprojects {
val loom = project.extensions.getByName<LoomGradleExtensionAPI>("loom") val loom = project.extensions.getByName<LoomGradleExtensionAPI>("loom")
dependencies { dependencies {
"minecraft"("com.mojang:minecraft:${project.property("minecraft_version")}") "minecraft"("com.mojang:minecraft:${project.property("minecraft_version")}")
// The following line declares the mojmap mappings, you may use other mappings as well "mappings"(loom.officialMojangMappings())
"mappings"(
loom.officialMojangMappings()
)
// The following line declares the yarn mappings you may select this one as well.
// "mappings"("net.fabricmc:yarn:1.18.2+build.3:v2")
} }
} }
@ -35,18 +29,9 @@ allprojects {
apply(plugin = "architectury-plugin") apply(plugin = "architectury-plugin")
apply(plugin = "maven-publish") apply(plugin = "maven-publish")
base.archivesName.set(rootProject.property("archives_base_name").toString()) base.archivesName.set("quaedam")
//base.archivesBaseName = rootProject.property("archives_base_name").toString() version = "1.0.0"
version = rootProject.property("mod_version").toString() group = "quaedam"
group = rootProject.property("maven_group").toString()
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
}
dependencies { dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-stdlib") compileOnly("org.jetbrains.kotlin:kotlin-stdlib")
@ -56,6 +41,7 @@ allprojects {
options.encoding = "UTF-8" options.encoding = "UTF-8"
options.release.set(17) options.release.set(17)
} }
kotlin.target.compilations.all { kotlin.target.compilations.all {
kotlinOptions.jvmTarget = "17" kotlinOptions.jvmTarget = "17"
} }

View File

@ -3,12 +3,12 @@ package quaedam
import dev.architectury.registry.CreativeTabRegistry import dev.architectury.registry.CreativeTabRegistry
import dev.architectury.registry.registries.DeferredRegister import dev.architectury.registry.registries.DeferredRegister
import dev.architectury.registry.registries.RegistrySupplier import dev.architectury.registry.registries.RegistrySupplier
import quaedam.QuaedamExpectPlatform.getConfigDirectory
import net.minecraft.core.registries.Registries import net.minecraft.core.registries.Registries
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import net.minecraft.world.item.CreativeModeTab import net.minecraft.world.item.CreativeModeTab
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import quaedam.QuaedamExpectPlatform.getConfigDirectory
object Quaedam { object Quaedam {
const val MOD_ID = "quaedam" const val MOD_ID = "quaedam"

View File

@ -50,12 +50,14 @@ tasks.processResources {
inputs.property("version", project.version) inputs.property("version", project.version)
filesMatching("META-INF/mods.toml") { filesMatching("META-INF/mods.toml") {
expand(mapOf( expand(
"version" to project.version, mapOf(
"minecraft_version" to rootProject.property("minecraft_version"), "version" to project.version,
"architectury_version" to rootProject.property("architectury_version"), "minecraft_version" to rootProject.property("minecraft_version"),
"kotlin_for_forge_version" to rootProject.property("kotlin_for_forge_version") "architectury_version" to rootProject.property("architectury_version"),
)) "kotlin_for_forge_version" to rootProject.property("kotlin_for_forge_version")
)
)
} }
} }

View File

@ -1,8 +1,8 @@
package quaedam.forge package quaedam.forge
import dev.architectury.platform.forge.EventBuses import dev.architectury.platform.forge.EventBuses
import quaedam.Quaedam
import net.minecraftforge.fml.common.Mod import net.minecraftforge.fml.common.Mod
import quaedam.Quaedam
import thedarkcolour.kotlinforforge.forge.MOD_BUS import thedarkcolour.kotlinforforge.forge.MOD_BUS
@Mod(Quaedam.MOD_ID) @Mod(Quaedam.MOD_ID)

View File

@ -1,21 +1,12 @@
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.caching=true org.gradle.caching=true
org.gradle.jvmargs=-Xmx2048M org.gradle.jvmargs=-Xmx2048M
minecraft_version=1.20.1 minecraft_version=1.20.1
archives_base_name=quaedam
mod_id=quaedam
mod_version=1.0.0
maven_group=quaedam
# https://www.curseforge.com/minecraft/mc-mods/architectury-api # https://www.curseforge.com/minecraft/mc-mods/architectury-api
architectury_version=9.0.8 architectury_version=9.0.8
# https://files.minecraftforge.net/net/minecraftforge/forge/ # https://files.minecraftforge.net/net/minecraftforge/forge/
forge_version=1.20.1-47.0.35 forge_version=1.20.1-47.0.35
# https://www.curseforge.com/minecraft/mc-mods/kotlin-for-forge/files # https://www.curseforge.com/minecraft/mc-mods/kotlin-for-forge/files
kotlin_for_forge_version=4.3.0 kotlin_for_forge_version=4.3.0
# https://fabricmc.net/develop/ # https://fabricmc.net/develop/
fabric_loader_version=0.14.21 fabric_loader_version=0.14.21

View File

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
maven { url = uri("https://maven.architectury.dev/") } maven { url = uri("https://maven.architectury.dev/") }
maven { url =uri("https://maven.quiltmc.org/repository/release/") } maven { url = uri("https://maven.quiltmc.org/repository/release/") }
maven { url = uri("https://maven.fabricmc.net/") } maven { url = uri("https://maven.fabricmc.net/") }
maven { url = uri("https://maven.minecraftforge.net/") } maven { url = uri("https://maven.minecraftforge.net/") }
gradlePluginPortal() gradlePluginPortal()