generated from FabricMC/fabric-example-mod
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for mc1.21.2 and up * update expanded storage version
- Loading branch information
1 parent
87f7685
commit ed2bfe9
Showing
36 changed files
with
1,548 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
# Fabric Properties: https://fabricmc.net/develop | ||
minecraft_version=1.21 | ||
yarn_mappings=1.21+build.7 | ||
loader_version=0.15.11 | ||
minecraft_version=1.21.1 | ||
yarn_mappings=1.21.1+build.3 | ||
loader_version=0.16.10 | ||
|
||
#Fabric api | ||
fabric_version=0.100.4+1.21 | ||
# Fabric API | ||
fabric_version=0.115.0+1.21.1 | ||
|
||
# Shedaniel API's: https://linkie.shedaniel.me/dependencies | ||
modmenu_version = 11.0.1 | ||
cloth_config_version = 15.0.127 | ||
modmenu_version = 11.0.3 | ||
cloth_config_version = 15.0.140 | ||
|
||
# Local dev mod versions | ||
rei_version = 16.0.729 | ||
rei_version = 16.0.797 | ||
// lazydfu_version = 0.1.3 | ||
lithium_version = mc1.21-0.12.7 | ||
sodium_version = mc1.21-0.5.11 | ||
architectury_api_version = 13.0.3+fabric | ||
auth_me_version = 8.0.0+1.21 | ||
expanded_storage_version = 14.0.0+fabric | ||
lithium_version = mc1.21.1-0.14.7-fabric | ||
sodium_version = mc1.21.1-0.6.7-fabric | ||
architectury_api_version = 13.0.8+fabric | ||
auth_me_version = v9.0.1+1.21.1 | ||
expanded_storage_version = 3a5207ab384845f8aa0ead7776bff68c | ||
|
||
# Unit Testing: https://mvnrepository.com/artifact/org.junit/junit-bom | ||
junit_bom_version = 5.11.0-M2 | ||
junit_bom_version = 5.11.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
plugins { | ||
id 'fabric-loom' | ||
id 'maven-publish' | ||
id 'idea' | ||
} | ||
|
||
String buildNumber = System.getenv("GITHUB_RUN_NUMBER") | ||
Boolean appendBuildNumber = System.getenv("APPEND_BUILD_NUMBER") == "true" && buildNumber != null | ||
String modVersion = System.getenv("MOD_VERSION") ?: "0.0.1" | ||
|
||
version = modVersion + | ||
(appendBuildNumber ? "-build${buildNumber}" : "") + | ||
"+${project.minecraft_version}" | ||
|
||
base { | ||
archivesName = "${project.mod_slug}-fabric" | ||
} | ||
|
||
loom { | ||
splitEnvironmentSourceSets() | ||
|
||
mods { | ||
"textutilities" { | ||
sourceSet sourceSets.main | ||
sourceSet sourceSets.client | ||
} | ||
} | ||
|
||
// https://github.com/SpongePowered/Mixin/wiki/Mixin-Java-System-Properties | ||
def applyCommonRunConfig = { run -> | ||
// run.runDir = "run/${project.minecraft_version}/${run.name}" | ||
// run.vmArg('-XX:+ShowCodeDetailsInExceptionMessages') | ||
run.property("mixin.debug.export", "true") | ||
run.property("mixin.debug.export.decompile", "true") | ||
run.property("mixin.dumpTargetOnFailure", "true") | ||
run.property("mixin.debug.verify", "true") | ||
run.property("mixin.debug.verbose", "true") | ||
run.property("mixin.env.remapRefMap", "true") | ||
run.property("mixin.checks", "true") | ||
run.property("mixin.hotSwap", "true") | ||
} | ||
|
||
runs { | ||
client { | ||
runDir = "run/${project.minecraft_version}/client" | ||
vmArg "-XX:+ShowCodeDetailsInExceptionMessages" | ||
applyCommonRunConfig(client) | ||
} | ||
server { | ||
runDir = "run/${project.minecraft_version}/server" | ||
vmArg "-XX:+ShowCodeDetailsInExceptionMessages" | ||
applyCommonRunConfig(server) | ||
} | ||
} | ||
} | ||
|
||
sourceSets { | ||
test { | ||
compileClasspath += sourceSets.client.compileClasspath | ||
runtimeClasspath += sourceSets.client.runtimeClasspath | ||
} | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" | ||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { | ||
exclude(group: "net.fabricmc.fabric-api") | ||
} | ||
|
||
// ====== Mod Compatibility (optional dependencies) ====== | ||
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}" | ||
|
||
// ======= Unit Tests ====== | ||
testImplementation(platform("org.junit:junit-bom:${project.junit_bom_version}")) | ||
testImplementation("org.junit.jupiter:junit-jupiter") | ||
testImplementation(sourceSets.client.output) | ||
|
||
// ====== Mods that are useful for local development ====== | ||
// modLocalRuntime("maven.modrinth:lazydfu:${project.lazydfu_version}") | ||
modLocalRuntime("maven.modrinth:lithium:${project.lithium_version}") | ||
modLocalRuntime("maven.modrinth:sodium:${project.sodium_version}") | ||
// modLocalRuntime("maven.modrinth:starlight:${project.starlight_version}") | ||
modLocalRuntime("maven.modrinth:architectury-api:${project.architectury_api_version}") | ||
modLocalRuntime("maven.modrinth:auth-me:${project.auth_me_version}") | ||
modLocalRuntime("maven.modrinth:expanded-storage:${project.expanded_storage_version}") | ||
} | ||
|
||
processResources { | ||
Map<String, Object> properties = new HashMap<>() | ||
properties.put("version", project.version) | ||
properties.put("mod_id", project.mod_id) | ||
properties.put("mod_name", project.mod_name) | ||
properties.put("mod_slug", project.mod_slug) | ||
properties.put("mod_author", project.mod_author) | ||
properties.put("loader_version", project.loader_version) | ||
properties.put("fabric_version", project.fabric_version) | ||
properties.put("minecraft_version", project.minecraft_version) | ||
// properties.put("java_version", sourceCompatibility) | ||
|
||
properties.each { k, v -> inputs.property(k, v) } | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand properties | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
// Minecraft 1.21 upwards uses Java 21. | ||
it.options.release = 21 | ||
} | ||
|
||
java { | ||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task | ||
// if it is present. | ||
// If you remove this line, sources will not be generated. | ||
withSourcesJar() | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${project.base.archivesName.get()}"} | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events "passed", "skipped", "failed" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Fabric Properties: https://fabricmc.net/develop | ||
minecraft_version=1.21.4 | ||
yarn_mappings=1.21.4+build.8 | ||
loader_version=0.16.10 | ||
|
||
# Fabric API | ||
fabric_version=0.117.0+1.21.4 | ||
|
||
# Shedaniel API's: https://linkie.shedaniel.me/dependencies | ||
modmenu_version = 13.0.2 | ||
cloth_config_version = 17.0.144 | ||
|
||
# Local dev mod versions | ||
rei_version = 18.0.796+fabric | ||
// lazydfu_version = 0.1.3 | ||
lithium_version = mc1.21.4-0.14.7-fabric | ||
sodium_version = mc1.21.4-0.6.7-fabric | ||
architectury_api_version = 15.0.1+fabric | ||
auth_me_version = v9.0.1+1.21.4 | ||
expanded_storage_version = eed6ef0400f1dabb19acbf56edc9aa99 | ||
|
||
# Unit Testing: https://mvnrepository.com/artifact/org.junit/junit-bom | ||
junit_bom_version = 5.11.4 |
15 changes: 15 additions & 0 deletions
15
modules/fabric-1.21.2/src/client/java/io/chaws/textutilities/client/TextUtilitiesClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.chaws.textutilities.client; | ||
|
||
import io.chaws.textutilities.client.handlers.FormatButtonsHandler; | ||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class TextUtilitiesClient implements ClientModInitializer { | ||
|
||
@Override | ||
public void onInitializeClient() { | ||
FormatButtonsHandler.initialize(); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...abric-1.21.2/src/client/java/io/chaws/textutilities/client/config/ModMenuIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.chaws.textutilities.client.config; | ||
|
||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
import io.chaws.textutilities.config.TextUtilitiesConfig; | ||
import me.shedaniel.autoconfig.AutoConfig; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class ModMenuIntegration implements ModMenuApi { | ||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
return parent -> AutoConfig.getConfigScreen(TextUtilitiesConfig.class, parent).get(); | ||
} | ||
} |
Oops, something went wrong.