Skip to content

Commit 3eccbde

Browse files
committed
fix: modded clients on servers are missing some translations
I'm not really sure why this happens, but I just made it so that gradle copies the lang files into both the `assets` and the `data` directory, so that they can be read like normal but also be used by Server Translations.
1 parent 9069cc4 commit 3eccbde

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

common.gradle

+11-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ dependencies {
117117
}
118118

119119
String MIXIN_CONFIG_PATH = 'enchantedshulkers.mixins.json'
120-
String LANG_DIR = 'data/enchantedshulkers/lang'
120+
String LANG_DIR = 'assets/enchantedshulkers/lang'
121+
String LANG_DIR_DATA = 'data/enchantedshulkers/lang'
121122
JavaVersion JAVA_COMPATIBILITY
122123
if (mcVersion >= 11800) {
123124
JAVA_COMPATIBILITY = JavaVersion.VERSION_17
@@ -191,6 +192,14 @@ yamlang {
191192
inputDir = LANG_DIR
192193
}
193194

195+
tasks.register("copyLangFiles", Copy) {
196+
mustRunAfter("yamlangConvertMainResources")
197+
def basePath = sourceSets.main.getOutput().getResourcesDir().toPath()
198+
from(basePath.resolve(LANG_DIR))
199+
into(basePath.resolve(LANG_DIR_DATA))
200+
include("*.json")
201+
}
202+
194203
// ensure that the encoding is set to UTF-8, no matter what the system default is
195204
// this fixes some edge cases with special characters not displaying correctly
196205
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
@@ -207,6 +216,7 @@ java {
207216
}
208217

209218
jar {
219+
dependsOn("copyLangFiles")
210220
from(rootProject.file('LICENSE')) {
211221
rename { "${it}_${project.archives_base_name}" }
212222
}

0 commit comments

Comments
 (0)