Skip to content

Commit

Permalink
bump gradle, fix mods checker plugin using fmlloadingplugin instead o…
Browse files Browse the repository at this point in the history
…f launchwrapper, make mod detection use last modified instead of arbitrary alphabetical order
  • Loading branch information
Wyvest committed Jun 28, 2024
1 parent 4bce4ec commit 4000295
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 116 deletions.
23 changes: 8 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
id("org.polyfrost.defaults.java")
id("org.polyfrost.defaults.loom")
id("com.github.johnrengelman.shadow")
id("net.kyori.blossom") version "1.3.1"
id("net.kyori.blossom") version "1.3.2"
id("signing")
java
}
Expand All @@ -23,11 +23,6 @@ val mod_version: String by project
val mod_id: String by project
val mod_archives_name: String by project

// Sets up the variables for when we preprocess to other Minecraft versions.
preprocess {
vars.put("MODERN", if (project.platform.mcMinor >= 16) 1 else 0)
}

// Replaces the variables in `ExampleMod.java` to the ones specified in `gradle.properties`.
blossom {
replaceToken("@VER@", mod_version)
Expand Down Expand Up @@ -57,8 +52,8 @@ loom {
if (project.platform.isLegacyForge) {
runConfigs {
"client" {
programArgs("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker")
property("fml.coreMods.load", "org.polyfrost.crashpatch.hooks.ModsCheckerPlugin")
programArgs("--tweakClass", "org.polyfrost.crashpatch.hooks.ModsCheckerPlugin")
//property("fml.coreMods.load", "")
property("mixin.debug.export", "true")
}
}
Expand Down Expand Up @@ -93,14 +88,14 @@ repositories {
// Configures the libraries/dependencies for your mod.
dependencies {
// Adds the OneConfig library, so we can develop with it.
modCompileOnly("cc.polyfrost:oneconfig-$platform:0.2.1-alpha+")
modCompileOnly("cc.polyfrost:oneconfig-$platform:0.2.2-alpha+")

modRuntimeOnly("me.djtheredstoner:DevAuth-${if (platform.isFabric) "fabric" else if (platform.isLegacyForge) "forge-legacy" else "forge-latest"}:1.1.2")
shade("com.github.aternosorg:mclogs-java:3.0.1")
modRuntimeOnly("me.djtheredstoner:DevAuth-${if (platform.isFabric) "fabric" else if (platform.isLegacyForge) "forge-legacy" else "forge-latest"}:1.2.0")
shade("gs.mclo:api:3.0.1")
// If we are building for legacy forge, includes the launch wrapper with `shade` as we configured earlier.
if (platform.isLegacyForge) {
compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT")
shade("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+")
shade("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta17")
}
}

Expand Down Expand Up @@ -183,11 +178,9 @@ tasks {
manifest.attributes += mapOf(
"ModSide" to "CLIENT", // We aren't developing a server-side mod, so this is fine.
"ForceLoadAsMod" to true, // We want to load this jar as a mod, so we force Forge to do so.
"FMLCorePluginContainsFMLMod" to "Yes, yes it does",
"FMLCorePlugin" to "org.polyfrost.crashpatch.hooks.ModsCheckerPlugin",
"TweakOrder" to "0", // Makes sure that the OneConfig launch wrapper is loaded as soon as possible.
"MixinConfigs" to "mixin.${mod_id}.json", // We want to use our mixin configuration, so we specify it here.
"TweakClass" to "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker" // Loads the OneConfig launch wrapper.
"TweakClass" to "org.polyfrost.crashpatch.hooks.ModsCheckerPlugin" // Loads the OneConfig launch wrapper.
)
}
dependsOn(shadowJar)
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
mod_id=crashpatch
mod_name=CrashPatch
mod_version=2.0.0
mod_version=2.0.1
mod_archives_name=CrashPatch

# Gradle Configuration -- DO NOT TOUCH THESE VALUES.
polyfrost.defaults.loom=1
polyfrost.defaults.loom=3
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureoncommand=true
Expand Down
4 changes: 2 additions & 2 deletions root.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
kotlin("jvm") version "1.8.22" apply false
kotlin("jvm") version "1.9.10" apply false
id("org.polyfrost.multi-version.root")
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
}

preprocess {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pluginManagement {
maven("https://repo.polyfrost.org/releases") // Adds the Polyfrost maven repository to get Polyfrost Gradle Toolkit
}
plugins {
val pgtVersion = "0.2.9" // Sets the default versions for Polyfrost Gradle Toolkit
val pgtVersion = "0.6.2" // Sets the default versions for Polyfrost Gradle Toolkit
id("org.polyfrost.multi-version.root") version pgtVersion
}
}
Expand Down
Loading

0 comments on commit 4000295

Please sign in to comment.