Skip to content

Commit

Permalink
fix build and update version
Browse files Browse the repository at this point in the history
  • Loading branch information
btwonion committed Nov 28, 2024
1 parent 6ef7cbf commit 5891bb4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
16 changes: 9 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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()
Expand All @@ -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")!!)
Expand Down Expand Up @@ -112,6 +110,10 @@ tasks {
jvmTarget = JvmTarget.fromTarget(javaVersion.toString())
}
}

build {
if (dataGen) dependsOn("runDatagen")
}
}

val changelogText = buildString {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dev/nyon/telekinesis/mixins/MobMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions stonecutter.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import dev.kikugie.stonecutter.Identifier
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.*
Expand All @@ -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 ""
Expand Down

0 comments on commit 5891bb4

Please sign in to comment.