From 5891bb4be7727a961b7829e889b5b607885dd8c0 Mon Sep 17 00:00:00 2001 From: btwonion Date: Thu, 28 Nov 2024 18:27:17 +0100 Subject: [PATCH] fix build and update version --- build.gradle.kts | 16 +++++++++------- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- .../dev/nyon/telekinesis/mixins/MobMixin.java | 4 ++-- stonecutter.gradle.kts | 3 +-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d507da7..6eba28b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ @file:Suppress("SpellCheckingInspection", "UnstableApiUsage") +import net.fabricmc.loom.configuration.FabricApiExtension import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -40,11 +41,8 @@ loom { } // Enable data generation for >1.20.6 -if (!listOf("1.20.1", "1.20.4", "1.20.6").contains(stonecutter.current.version)) { - fabricApi { - configureDataGeneration() - } -} +val dataGen = stonecutter.eval(mcVersion, ">1.20.6") +if (dataGen) fabricApi(FabricApiExtension::configureDataGeneration) repositories { mavenCentral() @@ -63,11 +61,11 @@ dependencies { }) implementation("org.vineflower:vineflower:1.10.1") - modImplementation("net.fabricmc:fabric-loader:0.16.7") + modImplementation("net.fabricmc:fabric-loader:0.16.9") modImplementation("net.fabricmc.fabric-api:fabric-api:${property("deps.fapi")!!}") modImplementation("net.fabricmc:fabric-language-kotlin:1.12.3+kotlin.2.0.21") - modCompileOnly("dev.isxander:yet-another-config-lib:${property("deps.yacl")!!}") + modImplementation("dev.isxander:yet-another-config-lib:${property("deps.yacl")!!}") modImplementation("com.terraformersmc:modmenu:${property("deps.modMenu")!!}") include(modImplementation("dev.nyon:konfig:2.0.2-1.20.4")!!) @@ -112,6 +110,10 @@ tasks { jvmTarget = JvmTarget.fromTarget(javaVersion.toString()) } } + + build { + if (dataGen) dependsOn("runDatagen") + } } val changelogText = buildString { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1e749b..ba9ccfe 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-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index efe916f..8a08558 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,7 +10,7 @@ pluginManagement { } plugins { - id("dev.kikugie.stonecutter") version "0.5-beta.3" + id("dev.kikugie.stonecutter") version "0.5-beta.5" } buildscript { diff --git a/src/main/java/dev/nyon/telekinesis/mixins/MobMixin.java b/src/main/java/dev/nyon/telekinesis/mixins/MobMixin.java index 173e55b..18ffff6 100644 --- a/src/main/java/dev/nyon/telekinesis/mixins/MobMixin.java +++ b/src/main/java/dev/nyon/telekinesis/mixins/MobMixin.java @@ -30,13 +30,13 @@ public boolean modifyCustomDeathLoot( /*? if >=1.21 {*/ @WrapWithCondition( - method = /*? if needsWorldNow {*//*"dropPreservedEquipment(Lnet/minecraft/server/level/ServerLevel;Ljava/util/function/Predicate;)Ljava/util/Set;"*//*?} else {*/ "dropPreservedEquipment(Ljava/util/function/Predicate;)Ljava/util/Set;" /*?}*/, + method = /*? if needsWorldNow {*//*"Lnet/minecraft/world/entity/Mob;dropPreservedEquipment(Lnet/minecraft/server/level/ServerLevel;Ljava/util/function/Predicate;)Ljava/util/Set;"*//*?} else {*/ "dropPreservedEquipment(Ljava/util/function/Predicate;)Ljava/util/Set;" /*?}*/, at = @At( value = "INVOKE", target = /*? if needsWorldNow {*//*"Lnet/minecraft/world/entity/Mob;spawnAtLocation(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/item/ItemStack;)Lnet/minecraft/world/entity/item/ItemEntity;"*//*?} else {*/ "Lnet/minecraft/world/entity/Mob;spawnAtLocation(Lnet/minecraft/world/item/ItemStack;)Lnet/minecraft/world/entity/item/ItemEntity;" /*?}*/ ) ) - public boolean modifyCustomDeathLoot( + public boolean modifyPreservedEquipment( Mob instance, /*$ serverLevel {*//*$}*/ ItemStack itemStack diff --git a/stonecutter.gradle.kts b/stonecutter.gradle.kts index 312ca53..0069430 100644 --- a/stonecutter.gradle.kts +++ b/stonecutter.gradle.kts @@ -1,4 +1,3 @@ -import dev.kikugie.stonecutter.Identifier import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* @@ -14,7 +13,7 @@ plugins { stonecutter active "1.21" /* [SC] DO NOT EDIT */ stonecutter parameters { - val needsWorldNow = eval(stonecutter.current.version, ">=1.21.2") + val needsWorldNow = eval(node!!.name, ">=1.21.2") const("needsWorldNow", needsWorldNow) swaps["serverLevel"] = if (needsWorldNow) "ServerLevel level," else ""