13
0
geforkt von Mirrors/Paper

Fix i18n String API

In 1.13 the method previously used now returns translatable keys.
`block.minecraft.cobblestone` instead of `Cobblestone`

We just need to make sure we're translating those keys.
Dieser Commit ist enthalten in:
Zach Brown 2018-07-30 16:07:36 -05:00
Ursprung 720dabd2aa
Commit 5368b241ab
2 geänderte Dateien mit 36 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -7,8 +7,25 @@ Gets the Display name as seen in the Client.
Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java
index 4361b2cee..f81887c66 100644
--- a/src/main/java/net/minecraft/server/LocaleLanguage.java
+++ b/src/main/java/net/minecraft/server/LocaleLanguage.java
@@ -0,0 +0,0 @@ public class LocaleLanguage {
}
+ public static LocaleLanguage getInstance() { return a(); } // Paper - OBFHELPER
public static LocaleLanguage a() {
return LocaleLanguage.c;
}
+ public synchronized String translateKey(String key) { return a(key); } // Paper - OBFHELPER
public synchronized String a(String s) {
return this.c(s);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index e98e1ed72..1df2b463a 100644
index e98e1ed72..35eb3181d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory {
@ -26,7 +43,7 @@ index e98e1ed72..1df2b463a 100644
+ nms = CraftItemStack.asNMSCopy(item);
+ }
+
+ return nms != null ? nms.getItem().getName() : null;
+ return nms != null ? net.minecraft.server.LocaleLanguage.getInstance().translateKey(nms.getItem().getName()) : null;
+ }
// Paper end
}

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 002da2a191..9f3aa24590 100644
index 002da2a19..9f3aa2459 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
@ -59,7 +59,7 @@ index 002da2a191..9f3aa24590 100644
}
diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java
index a661789c1e..785a1a2184 100644
index a661789c1..785a1a218 100644
--- a/src/main/java/net/minecraft/server/DefinedStructure.java
+++ b/src/main/java/net/minecraft/server/DefinedStructure.java
@@ -0,0 +0,0 @@ public class DefinedStructure {
@ -113,8 +113,21 @@ index a661789c1e..785a1a2184 100644
}
public Iterator<IBlockData> iterator() {
diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java
index 8f06c5848..4361b2cee 100644
--- a/src/main/java/net/minecraft/server/LocaleLanguage.java
+++ b/src/main/java/net/minecraft/server/LocaleLanguage.java
@@ -0,0 +0,0 @@ public class LocaleLanguage {
Entry entry = (Entry) iterator.next();
String s = LocaleLanguage.b.matcher(ChatDeserializer.a((JsonElement) entry.getValue(), (String) entry.getKey())).replaceAll("%$1s");
- this.d.put(entry.getKey(), s);
+ this.d.put((String) entry.getKey(), s); // Paper - Decompile fix
}
this.e = SystemUtils.b();
diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java
index 3b8f6ec167..bde5714dd6 100644
index 3b8f6ec16..bde5714dd 100644
--- a/src/main/java/net/minecraft/server/RegistryID.java
+++ b/src/main/java/net/minecraft/server/RegistryID.java
@@ -0,0 +0,0 @@ import java.util.Arrays;
@ -155,7 +168,7 @@ index 3b8f6ec167..bde5714dd6 100644
this.f = 0;
diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java
index 4b5463cca2..53c9f21887 100644
index 4b5463cca..53c9f2188 100644
--- a/src/main/java/net/minecraft/server/VoxelShape.java
+++ b/src/main/java/net/minecraft/server/VoxelShape.java
@@ -0,0 +0,0 @@ public abstract class VoxelShape {