Skip to content

Commit

Permalink
Merge branch '1.19.x/dev' into 1.19.x/stable
Browse files Browse the repository at this point in the history
  • Loading branch information
FlashyReese committed Mar 14, 2023
2 parents 3649424 + 0251016 commit 9040110
Show file tree
Hide file tree
Showing 16 changed files with 1,903 additions and 90 deletions.
46 changes: 34 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
buildscript {
dependencies {
classpath "de.guntram.mcmod:crowdin-translate:${project.crowdin_translate}"
}
repositories {
maven {
name = 'CrowdinTranslate source'
url = "https://minecraft.guntram.de/maven/"
}
}
}

plugins {
id 'signing'
id 'fabric-loom' version '1.1-SNAPSHOT'
id 'maven-publish'
id 'io.github.juuxel.loom-quiltflower' version '1.8.0'
}

apply plugin: 'de.guntram.mcmod.crowdin-translate'
crowdintranslate.crowdinProjectName = 'sodium-extra'
crowdintranslate.minecraftProjectName = 'sodium-extra'
crowdintranslate.verbose = false

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

Expand All @@ -30,6 +47,9 @@ repositories {
maven {
url "https://maven.flashyreese.me/snapshots"
}
maven {
url = "https://minecraft.guntram.de/maven/"
}
}

dependencies {
Expand All @@ -49,7 +69,8 @@ dependencies {

// Currently using altrisi/CaffeineConfig until it is officially available through CaffeineMC's maven repository
// Todo: Use https://github.com/CaffeineMC/mixin-config when available
include(modImplementation("net.caffeinemc:mixin-config:1.0.0+1.17"))
include(modImplementation("net.caffeinemc:CaffeineConfig:1.1.0+1.17"))
include(modImplementation("de.guntram.mcmod:crowdin-translate:${project.crowdin_translate}"))

modRuntimeOnly "maven.modrinth:lazydfu:0.1.3"
}
Expand All @@ -62,19 +83,20 @@ processResources {
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
build {
dependsOn downloadTranslations
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
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()
}

jar {
Expand Down
3 changes: 0 additions & 3 deletions crowdin.yml

This file was deleted.

3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.14.14

# Mod Properties
mod_version=0.4.17
mod_version=0.4.18
maven_group=me.flashyreese.mods
archives_base_name=sodium-extra

# Dependencies
reeses_sodium_options=1.4.7+mc1.19.2-build.59
sodium_version=0.4.9+build.208
fabric_version=0.73.2+1.19.3
crowdin_translate=1.4+1.19.3
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.flashyreese.mods.sodiumextra.client;

import de.guntram.mcmod.crowdintranslate.CrowdinTranslate;
import me.flashyreese.mods.sodiumextra.client.gui.HudRenderImpl;
import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraGameOptions;
import net.fabricmc.api.ClientModInitializer;
Expand Down Expand Up @@ -43,6 +44,13 @@ private static SodiumExtraGameOptions loadConfig() {

@Override
public void onInitializeClient() {
if (SodiumExtraClientMod.options().superSecretSettings.fetchSodiumExtraCrowdinTranslations) {
CrowdinTranslate.downloadTranslations(SodiumExtraClientMod.options().superSecretSettings.sodiumExtraCrowdinProjectIdentifier, "sodium-extra");
}
if (SodiumExtraClientMod.options().superSecretSettings.fetchSodiumCrowdinTranslations) {
CrowdinTranslate.downloadTranslations(SodiumExtraClientMod.options().superSecretSettings.sodiumCrowdinProjectIdentifier, "sodium");
}

getClientTickHandler().onClientInitialize();
HudRenderCallback.EVENT.register(new HudRenderImpl());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class SodiumExtraGameOptions {
public final RenderSettings renderSettings = new RenderSettings();
public final ExtraSettings extraSettings = new ExtraSettings();
public final NotificationSettings notificationSettings = new NotificationSettings();
public final SuperSecretSettings superSecretSettings = new SuperSecretSettings();
private File file;
private boolean suggestedRSO;

Expand Down Expand Up @@ -279,4 +280,18 @@ public NotificationSettings() {
this.hideRSORecommendation = false;
}
}

public static class SuperSecretSettings {
public boolean fetchSodiumExtraCrowdinTranslations;
public String sodiumExtraCrowdinProjectIdentifier;
public boolean fetchSodiumCrowdinTranslations;
public String sodiumCrowdinProjectIdentifier;

public SuperSecretSettings() {
this.fetchSodiumExtraCrowdinTranslations = false;
this.sodiumExtraCrowdinProjectIdentifier = "sodium-extra";
this.fetchSodiumCrowdinTranslations = false;
this.sodiumCrowdinProjectIdentifier = "sodium-fabric";
}
}
}
Loading

0 comments on commit 9040110

Please sign in to comment.