Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
5b6dfb3463
This work is 100% unfinished. I am pushing it up so that we as a team can work on this update. Do not try to use this branch. You will fail.
54 Zeilen
2.1 KiB
Diff
54 Zeilen
2.1 KiB
Diff
From b2d5adef80eed3964ab16df2c98789763d150fd7 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Wed, 4 May 2016 23:55:48 -0400
|
|
Subject: [PATCH] Add getI18NDisplayName API
|
|
|
|
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/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
|
index 045c26d9..47bbc0f9 100644
|
|
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
|
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
|
@@ -145,5 +145,15 @@ public interface ItemFactory {
|
|
* @return A potentially Data Converted ItemStack
|
|
*/
|
|
ItemStack ensureServerConversions(ItemStack item);
|
|
+
|
|
+ /**
|
|
+ * 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.
|
|
+ *
|
|
+ * @param item Item to return Display name of
|
|
+ * @return Display name of Item
|
|
+ */
|
|
+ String getI18NDisplayName(ItemStack item);
|
|
// Paper end
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
|
index 6df4b97a..864b16b1 100644
|
|
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
|
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
|
@@ -550,5 +550,16 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
|
public ItemStack ensureServerConversions() {
|
|
return Bukkit.getServer().getItemFactory().ensureServerConversions(this);
|
|
}
|
|
+
|
|
+ /**
|
|
+ * 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.
|
|
+ *
|
|
+ * @return Display name of Item
|
|
+ */
|
|
+ public String getI18NDisplayName() {
|
|
+ return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
|
|
+ }
|
|
// Paper end
|
|
}
|
|
--
|
|
2.18.0
|
|
|