mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-26 04:25:39 +01:00
7f24790a35
Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: cf37529 Updated Upstream (Paper) EMC Changes: 27282006 Updated Paper 456edfa4 One more try to fix more chunks on reload Purpur Changes: 45d5e9a Fix dolphin spit and phantom flames 9e1b8e7 Clean up teleport outside border patch Add sleeping, inventory, and toWorld checks 8428580 [ci-skip] Add 'fast' argument to './purpur jar' to speed up jenkins build time cea486c Updated Upstream (Paper) 6cd244c Fix infinite furnaces triggering without lava source a989361 Fix infinite furnaces leaving empty buckets 6cf1672 Add config option for whether Nether Wart farming Villagers should throw extra Nether Warts at other Villagers 07d4056 Add toggle for Zombified Piglin death always counting as a player kill when angry (Zombified Piglin XP farm nerf option) 9935466 Add config option for Cleric Villagers to farm Nether Wart 47a1707 fix typos 6e42ce8 Updated Upstream (Paper) 740b7d2 [ci-skip] Update readme with downloads API info AirplaneLite Changes: 5526dde Add download link to readme
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();
|