mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-12-26 07:18:52 +00:00
feat: 调整名称获取方式
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
12c8890834
commit
45cd628537
@ -35,7 +35,7 @@ public class L10N {
|
||||
* 物品实体
|
||||
* @return 物品名称
|
||||
*/
|
||||
public static final String getItemFullName(final ItemStack i) {
|
||||
public static final String getFullName(final ItemStack i) {
|
||||
return getItemName(getItemType(i)) + (i.hasItemMeta() && i.getItemMeta().hasDisplayName() ? "§r(" + i.getItemMeta().getDisplayName() + "§r)" : "");
|
||||
}
|
||||
|
||||
@ -47,6 +47,17 @@ public class L10N {
|
||||
* @return 物品名称
|
||||
*/
|
||||
public static final String getItemName(final ItemStack i) {
|
||||
return getItemName(getItemType(i));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物品汉化名称(优先显示名称)
|
||||
*
|
||||
* @param i
|
||||
* 物品实体
|
||||
* @return 物品名称
|
||||
*/
|
||||
public static final String getName(final ItemStack i) {
|
||||
return i.hasItemMeta() && i.getItemMeta().hasDisplayName() ? i.getItemMeta().getDisplayName() : getItemName(getItemType(i));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user