2018-07-23 08:39:55 +00:00
|
|
|
From 5576e3c1a73f5a51ee3e041d001a827252a8d724 Mon Sep 17 00:00:00 2001
|
2017-07-27 03:44:09 +00:00
|
|
|
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
|
2018-07-15 01:53:17 +00:00
|
|
|
index 045c26d9..47bbc0f9 100644
|
2017-07-27 03:44:09 +00:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
2018-07-14 01:44:35 +00:00
|
|
|
@@ -145,5 +145,15 @@ public interface ItemFactory {
|
2017-07-27 03:44:09 +00:00
|
|
|
* @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
|
2018-07-19 04:42:43 +00:00
|
|
|
index 14b6b6b3..ca7a958f 100644
|
2017-07-27 03:44:09 +00:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
2018-07-19 04:42:43 +00:00
|
|
|
@@ -563,5 +563,16 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
2017-07-27 03:44:09 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
--
|
2018-07-14 01:44:35 +00:00
|
|
|
2.18.0
|
2017-07-27 03:44:09 +00:00
|
|
|
|