2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2017-07-27 05:44:09 +02: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
|
2021-05-13 08:16:33 +02:00
|
|
|
index 44a858490f4db37f979fd487ed7a5b2b8b7f1a3f..3fd56a95de7d4cbeaf5d8554fbc7127a627cb977 100644
|
2017-07-27 05:44:09 +02:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
2021-05-13 08:16:33 +02:00
|
|
|
@@ -172,5 +172,16 @@ public interface ItemFactory {
|
2017-07-27 05:44:09 +02:00
|
|
|
*/
|
2019-03-20 01:28:15 +01:00
|
|
|
@NotNull
|
|
|
|
ItemStack ensureServerConversions(@NotNull ItemStack item);
|
2017-07-27 05:44:09 +02:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 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
|
|
|
|
+ */
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @Nullable
|
|
|
|
+ String getI18NDisplayName(@Nullable ItemStack item);
|
2017-07-27 05:44:09 +02:00
|
|
|
// Paper end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
2021-05-13 08:16:33 +02:00
|
|
|
index 47d8611221967d32b654ddac0fbf0e405ef62352..82bd3e6701dbd7df9f0f8c3801c5ae1baba4eec5 100644
|
2017-07-27 05:44:09 +02:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
2021-05-13 08:16:33 +02:00
|
|
|
@@ -624,5 +624,17 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
2017-07-27 05:44:09 +02: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
|
|
|
|
+ */
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @Nullable
|
2017-07-27 05:44:09 +02:00
|
|
|
+ public String getI18NDisplayName() {
|
|
|
|
+ return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
}
|