mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-29 14:15:43 +01:00
c09ee99f7e
Closes #257 Ports 2 patches from Purpur: Infinity-bow-settings & Allow-infinite-and-mending-enchantments-together Added an option for infinity with no arrows too. Option for custom locale has come! You can put a locale.json file in your server folder to change it. We've got the finest patches from Hydrinity ( Mykyta approved & allowed ) too. We have some amazing new options in yatopia.yml, we're gonna have documentation for them soon so stay tuned! Last but not least, chunk generation patches. We've tested them extensively so no weirdness happens. Thanks for using Yatopia as your production server software. Co-authored-by: Ivan Pekov <ivan@mrivanplays.com>
45 lines
2.4 KiB
Diff
45 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Bud Gidiere <sgidiere@gmail.com>
|
|
Date: Sun, 25 Oct 2020 11:45:38 -0500
|
|
Subject: [PATCH] Custom Locale Support
|
|
|
|
All Server Jars Come with a pre-baked, usually English, locale file. This patch allows you to change the locale file by creating a locale.json file in the root directory of your server. Note that while custom locale files are supported by the server no support will be given for non-official Mojang locale files.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java
|
|
index 29d55483510d3644a1edd3a01d7314232c358ac6..9909dd07d47ec86b71b74f66ab0e252de3441e23 100644
|
|
--- a/src/main/java/net/minecraft/server/LocaleLanguage.java
|
|
+++ b/src/main/java/net/minecraft/server/LocaleLanguage.java
|
|
@@ -30,9 +30,19 @@ public abstract class LocaleLanguage {
|
|
private static LocaleLanguage c() {
|
|
Builder<String, String> builder = ImmutableMap.builder();
|
|
BiConsumer<String, String> biconsumer = builder::put; // Paper - decompile fix
|
|
+ boolean usingCustomLocale = false; // Yatopia
|
|
|
|
try {
|
|
- InputStream inputstream = LocaleLanguage.class.getResourceAsStream("/assets/minecraft/lang/en_us.json");
|
|
+ // Yatopia Start - Custom Locale
|
|
+ InputStream inputstream;
|
|
+ java.io.File file = new java.io.File("./locale.json");
|
|
+ if (file.isFile() && file.canRead()) {
|
|
+ usingCustomLocale = true;
|
|
+ inputstream = new java.io.FileInputStream(file);
|
|
+ } else {
|
|
+ inputstream = LocaleLanguage.class.getResourceAsStream("/assets/minecraft/lang/en_us.json");
|
|
+ }
|
|
+ // Yatopia End
|
|
Throwable throwable = null;
|
|
|
|
try {
|
|
@@ -55,7 +65,11 @@ public abstract class LocaleLanguage {
|
|
|
|
}
|
|
} catch (JsonParseException | IOException ioexception) {
|
|
+ if (!usingCustomLocale) { // Yatopia
|
|
LocaleLanguage.LOGGER.error("Couldn't read strings from /assets/minecraft/lang/en_us.json", ioexception);
|
|
+ } else { // Yatopia start
|
|
+ LocaleLanguage.LOGGER.error("Couldn't read strings from custom locale file. Please check that your custom Locale File is formatted correctly", ioexception);
|
|
+ } // Yatopia end
|
|
}
|
|
|
|
final Map<String, String> map = builder.build();
|