mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 11:27:35 +01:00
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.
This commit is contained in:
parent
9895d6c5c3
commit
221abecc78
@ -220,4 +220,20 @@ public interface ItemFactory {
|
||||
@NotNull
|
||||
net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack);
|
||||
// Paper end - Adventure
|
||||
|
||||
// Paper start - add getI18NDisplayName
|
||||
/**
|
||||
* 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
|
||||
* @deprecated {@link ItemStack} implements {@link net.kyori.adventure.translation.Translatable}; use that and
|
||||
* {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} instead.
|
||||
*/
|
||||
@Nullable
|
||||
@Deprecated(since = "1.18.1", forRemoval = true)
|
||||
String getI18NDisplayName(@Nullable ItemStack item);
|
||||
// Paper end - add getI18NDisplayName
|
||||
}
|
||||
|
@ -642,5 +642,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
public net.kyori.adventure.text.@NotNull Component displayName() {
|
||||
return Bukkit.getServer().getItemFactory().displayName(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
|
||||
* @deprecated {@link ItemStack} implements {@link net.kyori.adventure.translation.Translatable}; use that and
|
||||
* {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} instead.
|
||||
*/
|
||||
@Nullable
|
||||
@Deprecated
|
||||
public String getI18NDisplayName() {
|
||||
return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user