Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0b2f13e
update to twoconfig, crash gui slightly ported
Wyvest Jul 26, 2024
89b5112
Convert project from PGT to DGT
Deftu Oct 12, 2024
c17e829
Actually add mclo.gs as a dependency
Deftu Oct 12, 2024
1d3e6e9
Use correct templating syntax
Deftu Oct 13, 2024
c4571bc
Update DGT to 2.11.1
Deftu Oct 13, 2024
bd30384
Migrate to new PolyUI version
Deftu Oct 13, 2024
63b17cc
Porting stuff
Deftu Oct 15, 2024
b3eb776
Use correct tweaker in build file
Deftu Oct 15, 2024
637cb6e
Bump stage1 version
Deftu Oct 16, 2024
365cf97
Continue porting UI and make some needed fixes
Deftu Nov 16, 2024
ae7c959
Port most of the UI to PolyUI
Deftu Nov 18, 2024
3fe06db
Basically finish porting GUI
Deftu Nov 21, 2024
6875e81
remove redundant assets and use translation files instead
nextdayy Nov 24, 2024
1f53734
Major cleanup, crash scans TBD
Deftu Dec 11, 2024
39fec52
Further cleanup, Mixins TBD
Deftu Dec 11, 2024
e79bae9
Finish porting to LF and cleaning up
Deftu Dec 11, 2024
4babfbb
yeah no nevermind "finished" was a lie
Deftu Dec 11, 2024
62e1bc9
Bring up to speed with the OneConfig example mod
Deftu Jan 2, 2025
b851169
bump
Wyvest Feb 2, 2025
f75e22f
oops
Wyvest Feb 2, 2025
067d8ee
update to alpha.72
Wyvest Mar 15, 2025
ec25c9a
fix refmap
Wyvest Mar 16, 2025
f0f5d69
update to new textile
Wyvest Mar 18, 2025
8a67fb8
update DGT
Wyvest Mar 18, 2025
c4bc9da
Bump DGT and OneConfig
Deftu May 5, 2025
a0d816d
Better command syntax
Deftu May 5, 2025
7f12719
Bump OneConfig and OneConfig Loader
Deftu Jun 4, 2025
9c52bb3
Update settings.gradle.kts
Wyvest Jun 25, 2025
fef8f45
Merge branch 'twoconfig' of https://github.com/Polyfrost/CrashPatch i…
Wyvest Jun 25, 2025
726633c
workflows
Wyvest Jun 25, 2025
69e4fef
1.12 port
Wyvest Aug 15, 2025
887a40d
Make compile on 1.16
Wyvest Aug 16, 2025
502d2f9
Replace NEC's GUI with CrashPatch's one
Wyvest Aug 16, 2025
3bea34b
make all versions up to 1.21.5 compile
Wyvest Aug 16, 2025
ed1d16f
it works now
Wyvest Aug 16, 2025
ef80df3
fix preinit for 1.8/1.12
Wyvest Aug 16, 2025
5c3cf4d
Add NEC as a dep in the FMJ
Wyvest Aug 16, 2025
30ae881
OmniCore V1, cut versions, added 1.21.8
Deftu Sep 23, 2025
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
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Build Workflow

name: Build with Gradle

on:
pull_request:
workflow_dispatch:
push:

concurrency:
group: ${{ github.head_ref || format('{0}-{1}', github.ref, github.run_number) }}
cancel-in-progress: true

jobs:
build:
name: Build

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10

- name: Set up JDK 8, 16, 17, 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
8
16
17
21

- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
**/loom-cache
**/prebundled-jars
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Chmod Gradle
run: chmod +x ./gradlew

- name: Build
run: ./gradlew build --no-daemon
48 changes: 0 additions & 48 deletions .github/workflows/gradle.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/mod_project_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Mod-Project Integration

on:
issues:
types: [opened]
pull_request:
types: [opened]

jobs:
add-to-project:
name: Add issue/PR to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/Polyfrost/projects/9
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
243 changes: 87 additions & 156 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,190 +1,121 @@
@file:Suppress("UnstableApiUsage", "PropertyName")

import org.polyfrost.gradle.util.noServerRunConfigs
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import dev.deftu.gradle.utils.GameSide
import dev.deftu.gradle.utils.includeOrShade
import dev.deftu.gradle.utils.version.MinecraftVersion
import dev.deftu.gradle.utils.version.MinecraftVersions

// Adds support for kotlin, and adds the Polyfrost Gradle Toolkit
// which we use to prepare the environment.
plugins {
kotlin("jvm")
id("org.polyfrost.multi-version")
id("org.polyfrost.defaults.repo")
id("org.polyfrost.defaults.java")
id("org.polyfrost.defaults.loom")
id("com.github.johnrengelman.shadow")
id("net.kyori.blossom") version "1.3.2"
id("signing")
java
kotlin("jvm")
id("dev.deftu.gradle.multiversion") // Applies preprocessing for multiple versions of Minecraft and/or multiple mod loaders.
id("dev.deftu.gradle.tools") // Applies several configurations to things such as the Java version, project name/version, etc.
id("dev.deftu.gradle.tools.resources") // Applies resource processing so that we can replace tokens, such as our mod name/version, in our resources.
id("dev.deftu.gradle.tools.bloom") // Applies the Bloom plugin, which allows us to replace tokens in our source files, such as being able to use `@MOD_VERSION` in our source files.
id("dev.deftu.gradle.tools.minecraft.loom") // Applies the Loom plugin, which automagically configures Essential's Architectury Loom plugin for you.
id("dev.deftu.gradle.tools.shadow") // Applies the Shadow plugin, which allows us to shade our dependencies into our mod JAR. This is NOT recommended for Fabric mods, but we have an *additional* configuration for those!
id("dev.deftu.gradle.tools.minecraft.releases") // Applies the Minecraft auto-releasing plugin, which allows you to automatically release your mod to CurseForge and Modrinth.
}

// Gets the mod name, version and id from the `gradle.properties` file.
val mod_name: String by project
val mod_version: String by project
val mod_id: String by project
val mod_archives_name: String by project

// Replaces the variables in `ExampleMod.java` to the ones specified in `gradle.properties`.
blossom {
replaceToken("@VER@", mod_version)
replaceToken("@NAME@", mod_name)
replaceToken("@ID@", mod_id)
if (mcData.isForge) {
loom.forge.mixinConfig("mixins.crashpatch.init.json")
}

// Sets the mod version to the one specified in `gradle.properties`. Make sure to change this following semver!
version = mod_version
// Sets the group, make sure to change this to your own. It can be a website you own backwards or your GitHub username.
// e.g. com.github.<your username> or com.<your domain>
group = "org.polyfrost"
toolkitLoomHelper {
useOneConfig {
version = "1.0.0-alpha.151"
loaderVersion = "1.1.0-alpha.48"

// Sets the name of the output jar (the one you put in your mods folder and send to other people)
// It outputs all versions of the mod into the `build` directory.
base {
archivesName.set("$mod_archives_name-$platform")
}
usePolyMixin = true
polyMixinVersion = "0.8.4+build.6"

// Configures the Polyfrost Loom, our plugin fork to easily set up the programming environment.
loom {
// Removes the server configs from IntelliJ IDEA, leaving only client runs.
// If you're developing a server-side mod, you can remove this line.
noServerRunConfigs()

// Adds the tweak class if we are building legacy version of forge as per the documentation (https://docs.polyfrost.org)
if (project.platform.isLegacyForge) {
runConfigs {
"client" {
programArgs("--tweakClass", "org.polyfrost.crashpatch.hooks.ModsCheckerPlugin")
//property("fml.coreMods.load", "")
property("mixin.debug.export", "true")
}
}
}
// Configures the mixins if we are building for forge, useful for when we are dealing with cross-platform projects.
if (project.platform.isForge) {
forge {
mixinConfig("mixin.${mod_id}.json")
applyLoaderTweaker = true

for (module in arrayOf("commands", "config", "config-impl", "events", "internal", "hud", "ui", "utils")) {
+module
}
}
// Configures the name of the mixin "refmap" using an experimental loom api.
mixin.defaultRefmapName.set("mixin.${mod_id}.refmap.json")
}

// Creates the shade/shadow configuration, so we can include libraries inside our mod, rather than having to add them separately.
val shade: Configuration by configurations.creating {
configurations.implementation.get().extendsFrom(this)
}
useMixinExtras("0.5.0")

// Configures the output directory for when building from the `src/resources` directory.
sourceSets {
main {
output.setResourcesDir(java.classesDirectory)
useProperty("mixin.debug.export", "true", GameSide.BOTH)

// Turns off the server-side run configs, as we're building a client-sided mod.
disableRunConfigs(GameSide.SERVER)

// Defines the name of the Mixin refmap, which is used to map the Mixin classes to the obfuscated Minecraft classes.
if (!mcData.isNeoForge) {
useMixinRefMap(modData.id)
}
}

// Adds the Polyfrost maven repository so that we can get the libraries necessary to develop the mod.
repositories {
maven("https://repo.polyfrost.org/releases")
if (mcData.isForge) {
// Configures the Mixin tweaker if we are building for Forge.
useForgeMixin(modData.id)
}
}

// 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.2-alpha+")

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-beta17")
repositories {
maven("https://api.modrinth.com/maven") {
content { includeGroup("maven.modrinth") }
}
maven("https://maven.bawnorton.com/releases") {
content { includeGroup("com.github.bawnorton.mixinsquared") }
}
}

tasks {
// Processes the `src/resources/mcmod.info or fabric.mod.json` and replaces
// the mod id, name and version with the ones in `gradle.properties`
processResources {
inputs.property("id", mod_id)
inputs.property("name", mod_name)
val java = if (project.platform.mcMinor >= 18) {
17 // If we are playing on version 1.18, set the java version to 17
} else {
// Else if we are playing on version 1.17, use java 16.
if (project.platform.mcMinor == 17)
16
else
8 // For all previous versions, we **need** java 8 (for Forge support).
}
val compatLevel = "JAVA_${java}"
inputs.property("java", java)
inputs.property("java_level", compatLevel)
inputs.property("version", mod_version)
inputs.property("mcVersionStr", project.platform.mcVersionStr)
filesMatching(listOf("mcmod.info", "mixin.${mod_id}.json", "mods.toml")) {
expand(
mapOf(
"id" to mod_id,
"name" to mod_name,
"java" to java,
"java_level" to compatLevel,
"version" to mod_version,
"mcVersionStr" to project.platform.mcVersionStr
)
)
dependencies {
implementation(includeOrShade("gs.mclo:api:3.0.1")!!)
includeOrShade(implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-common:0.3.3")!!)!!)
if (mcData.version >= MinecraftVersions.VERSION_1_16) {
includeOrShade(implementation("com.github.bawnorton.mixinsquared:mixinsquared-${mcData.loader}:0.3.3")!!)
data class CompatDependency(
val forge: String,
val fabric: String,
val neoforge: String
)

fun DependencyHandlerScope.modImplementationCompat(notation: CompatDependency?) {
notation?.let {
when {
mcData.isNeoForge -> modImplementation(it.neoforge)
mcData.isForge -> modImplementation(it.forge)
mcData.isFabric -> modImplementation(it.fabric)
else -> error("Unsupported loader type: ${mcData.loader}")
}
}
}
filesMatching("fabric.mod.json") {
expand(
mapOf(
"id" to mod_id,
"name" to mod_name,
"java" to java,
"java_level" to compatLevel,
"version" to mod_version,
"mcVersionStr" to project.platform.mcVersionStr.substringBeforeLast(".") + ".x"
)

fun nec(mcVersion: String, modVersion: String) =
mcVersion to CompatDependency(
fabric = "maven.modrinth:notenoughcrashes:$modVersion+$mcVersion-fabric",
forge = "maven.modrinth:notenoughcrashes:$modVersion+$mcVersion-forge",
neoforge = "maven.modrinth:notenoughcrashes:$modVersion+$mcVersion-neoforge"
)
}
}

// Configures the resources to include if we are building for forge or fabric.
withType(Jar::class.java) {
if (project.platform.isFabric) {
exclude("mcmod.info", "mods.toml")
} else {
exclude("fabric.mod.json")
if (project.platform.isLegacyForge) {
exclude("mods.toml")
} else {
exclude("mcmod.info")
}
}
val nec = mapOf(
nec("1.16.5", "4.1.4"),
nec("1.20.1", "4.4.9"),
nec("1.20.4", "4.4.7"),
nec("1.21.1", "4.4.9"),
nec("1.21.4", "4.4.8"),
nec("1.21.5", "4.4.9"),
nec("1.21.8", "4.4.9"),
)

modImplementationCompat(nec[mcData.version.toString()])
}
}

// Configures our shadow/shade configuration, so we can
// include some dependencies within our mod jar file.
named<ShadowJar>("shadowJar") {
archiveClassifier.set("dev") // TODO: machete gets confused by the `dev` prefix.
configurations = listOf(shade)
tasks {
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

remapJar {
inputFile.set(shadowJar.get().archiveFile)
archiveClassifier.set("")
}

jar {
// Sets the jar manifest attributes.
if (platform.isLegacyForge) {
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.
"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 "org.polyfrost.crashpatch.hooks.ModsCheckerPlugin" // Loads the OneConfig launch wrapper.
)
manifest {
attributes(mapOf(
"MixinConfigs" to "mixins.crashpatch.init.json,mixins.crashpatch.json",
))
}
dependsOn(shadowJar)
archiveClassifier.set("")
enabled = false
}
}
Loading
Loading