新增4接口
- getItemCategoryName - getItemCustomName - getItemEffecName - itemIsFood
This commit is contained in:
+45
-1
@@ -319,7 +319,15 @@ const GMLIB_API = {
|
||||
/** 获取玩家盔甲值 @type {function(Player):number} */
|
||||
getPlayerArmorValue: ll.import("GMLIB_API", "getPlayerArmorValue"),
|
||||
/** 获取实体主人的UniqueID @type {function(Entity):Entity} */
|
||||
getEntityOwnerUniqueId: ll.import("GMLIB_API", "getEntityOwnerUniqueId")
|
||||
getEntityOwnerUniqueId: ll.import("GMLIB_API", "getEntityOwnerUniqueId"),
|
||||
/** 获取物品分类名称 @type {function(Item):string} */
|
||||
getItemCategoryName: ll.import("GMLIB_API", "getItemCategoryName"),
|
||||
/** 获取物品的命名 @type {function(Item):string} */
|
||||
getItemCustomName: ll.import("GMLIB_API", "getItemCustomName"),
|
||||
/** 获取物品BUFF效果名称 @type {function(Item):string} */
|
||||
getItemEffecName: ll.import("GMLIB_API", "getItemEffecName"),
|
||||
/** 物品是否为食物 @type {function(Item):boolean} */
|
||||
itemIsFood: ll.import("GMLIB_API", "itemIsFood")
|
||||
}
|
||||
|
||||
/** 静态悬浮字类列表 @type {Map<number,StaticFloatingText>} */
|
||||
@@ -2390,6 +2398,42 @@ LLSE_Player.prototype.getEntityOwner =
|
||||
return uniqueId === -1 ? null : Minecraft.getEntityFromUniqueId(uniqueId);
|
||||
}
|
||||
|
||||
LLSE_Item.prototype.getCategoryName =
|
||||
/**
|
||||
* 获取物品分类名称
|
||||
* @returns {string}
|
||||
*/
|
||||
function () {
|
||||
return GMLIB_API.getItemCategoryName(this);
|
||||
}
|
||||
|
||||
LLSE_Item.prototype.getCustomName =
|
||||
/**
|
||||
* 获取物品的命名
|
||||
* @returns {string}
|
||||
*/
|
||||
function () {
|
||||
return GMLIB_API.getItemCustomName(this);
|
||||
}
|
||||
|
||||
LLSE_Item.prototype.getEffecName =
|
||||
/**
|
||||
* 获取物品的BUFF效果名称
|
||||
* @returns {string}
|
||||
*/
|
||||
function () {
|
||||
return GMLIB_API.getItemEffecName(this);
|
||||
}
|
||||
|
||||
LLSE_Item.prototype.isFood =
|
||||
/**
|
||||
* 物品是否为食物
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function () {
|
||||
return GMLIB_API.itemIsFood(this);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
StaticFloatingText,
|
||||
DynamicFloatingText,
|
||||
|
||||
Reference in New Issue
Block a user