mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-31 09:10:00 -04:00
Only load default language on the server.
(cherry picked from commit f9594cb682
)
This commit is contained in:
parent
b83334a063
commit
efbb35d945
5 changed files with 13 additions and 8 deletions
fabric-resource-loader-v0
|
@ -7,5 +7,6 @@ loom {
|
|||
|
||||
testDependencies(project, [
|
||||
':fabric-lifecycle-events-v1',
|
||||
':fabric-api-base'
|
||||
':fabric-api-base',
|
||||
':fabric-resource-loader-v0'
|
||||
])
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.mixin.resource.loader;
|
||||
package net.fabricmc.fabric.mixin.resource.loader.server;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -60,7 +60,7 @@ class LanguageMixin {
|
|||
}
|
||||
|
||||
private static void loadModLanguage(ModContainer container, BiConsumer<String, String> entryConsumer) {
|
||||
Path path = container.findPath("/assets/" + container.getMetadata().getId() + "/lang/" + DEFAULT_LANGUAGE + ".json").orElse(null);
|
||||
Path path = container.findPath("assets/" + container.getMetadata().getId() + "/lang/" + DEFAULT_LANGUAGE + ".json").orElse(null);
|
||||
if (path == null || !Files.isRegularFile(path)) return;
|
||||
|
||||
try (InputStream stream = Files.newInputStream(path)) {
|
|
@ -4,7 +4,6 @@
|
|||
"compatibilityLevel": "JAVA_16",
|
||||
"mixins": [
|
||||
"KeyedResourceReloadListenerMixin",
|
||||
"LanguageMixin",
|
||||
"LifecycledResourceManagerImplMixin",
|
||||
"MinecraftServerMixin",
|
||||
"NamespaceResourceManagerMixin",
|
||||
|
@ -16,6 +15,9 @@
|
|||
"SimpleResourceReloadMixin",
|
||||
"TestServerMixin"
|
||||
],
|
||||
"server": [
|
||||
"server.LanguageMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ package net.fabricmc.fabric.test.resource.loader;
|
|||
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.api.DedicatedServerModInitializer;
|
||||
|
||||
public class LanguageTestMod implements ModInitializer {
|
||||
public class LanguageTestMod implements DedicatedServerModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
public void onInitializeServer() {
|
||||
testTranslationLoaded();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,10 @@
|
|||
"entrypoints": {
|
||||
"main": [
|
||||
"net.fabricmc.fabric.test.resource.loader.BuiltinResourcePackTestMod",
|
||||
"net.fabricmc.fabric.test.resource.loader.LanguageTestMod",
|
||||
"net.fabricmc.fabric.test.resource.loader.ResourceReloadListenerTestMod"
|
||||
],
|
||||
"server": [
|
||||
"net.fabricmc.fabric.test.resource.loader.LanguageTestMod"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue