Skip to content

Commit

Permalink
It works ™️
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Feb 3, 2024
1 parent 96a0277 commit bace2a0
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 65 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Fabric Example Mod
# Preprocessor Example Mod

Example mod for ReplayMod's [preprocessor](https://github.com/ReplayMod/preprocessor).

## Setup

Expand Down
43 changes: 23 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
}
import com.replaymod.gradle.preprocess.PreprocessTask

version = project.mod_version
group = project.maven_group
apply plugin: "java-library"
apply plugin: "maven-publish"
apply plugin: "fabric-loom"
apply plugin: "com.replaymod.preprocess"

base {
version = project.mod_version
group = project.maven_group
archivesName = project.archives_base_name
}

Expand All @@ -18,18 +19,6 @@ repositories {
// for more information about repositories.
}

loom {
splitEnvironmentSourceSets()

mods {
"modid" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}

}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
Expand All @@ -38,13 +27,27 @@ dependencies {

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Uncomment the following line to enable the deprecated Fabric API modules.

// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.

// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
}

preprocess {
vars.put("MC", project.mcVersion)
vars.put("FABRIC", 1)

keywords.set([
".java": PreprocessTask.DEFAULT_KEYWORDS,
".json": PreprocessTask.DEFAULT_KEYWORDS,
".vert": PreprocessTask.DEFAULT_KEYWORDS,
".frag": PreprocessTask.DEFAULT_KEYWORDS,
])

patternAnnotation.set("com.replaymod.gradle.remap.Pattern")
}

processResources {
inputs.property "version", project.version

Expand Down
9 changes: 1 addition & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.1
loader_version=0.15.0

# Mod Properties
mod_version=1.0.0
maven_group=com.example
archives_base_name=modid

# Dependencies
fabric_version=0.91.1+1.20.4
loader_version=0.15.0
11 changes: 11 additions & 0 deletions root.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins {
id ("fabric-loom") version "1.5-SNAPSHOT" apply false
id ("com.replaymod.preprocess") version "fad42fb94c"
}

preprocess {
val mc12004 = createNode("1.20.4", 12004, "yarn")
val mc12002 = createNode("1.20.2", 12002, "yarn")

mc12004.link(mc12002)
}
24 changes: 24 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,31 @@ pluginManagement {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'Jitpack'
url = 'https://jitpack.io'
}
mavenCentral()
gradlePluginPortal()
}
resolutionStrategy {
eachPlugin {
if (requested.id.id.equals("com.replaymod.preprocess")) {
useModule("com.github.FlorianMichael:preprocessor:${requested.version}")
}
}
}
}

rootProject.buildFileName = "root.gradle.kts"

var versions = [
"1.20.4",
"1.20.2"
]

versions.forEach { version ->
include(":${version}")
project(":${version}").projectDir = file("versions/${version}")
project(":${version}").buildFileName = "../../build.gradle"
}
10 changes: 0 additions & 10 deletions src/client/java/com/example/ExampleModClient.java

This file was deleted.

15 changes: 0 additions & 15 deletions src/client/java/com/example/mixin/client/ExampleClientMixin.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/client/resources/modid.client.mixins.json

This file was deleted.

3 changes: 3 additions & 0 deletions versions/1.20.2/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
fabric_version=0.91.6+1.20.2
3 changes: 3 additions & 0 deletions versions/1.20.4/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.1
fabric_version=0.91.1+1.20.4
1 change: 1 addition & 0 deletions versions/mainProject
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.20.4

0 comments on commit bace2a0

Please sign in to comment.