添加getItemMaxCount接口
This commit is contained in:
Vendored
+3
@@ -1283,6 +1283,9 @@ interface Item {
|
||||
|
||||
/** (GMLIB)物品是否为食物 */
|
||||
isFood(): boolean;
|
||||
|
||||
/** (GMLIB)获取物品最大堆叠数量 */
|
||||
getMaxCount(): number;
|
||||
}
|
||||
|
||||
interface Container {
|
||||
|
||||
+13
-1
@@ -337,7 +337,9 @@ const GMLIB_API = {
|
||||
/** 获取容器类型 @type {function(Container):string} */
|
||||
getContainerType: ll.import("GMLIB_API", "getContainerType"),
|
||||
/** 玩家是否拥有NBT @type {function(string):boolean} */
|
||||
hasPlayerNbt: ll.import("GMLIB_API", "hasPlayerNbt")
|
||||
hasPlayerNbt: ll.import("GMLIB_API", "hasPlayerNbt"),
|
||||
/** 获取物品最大堆叠数量 @type {function(Item):number} */
|
||||
getItemMaxCount: ll.import("GMLIB_API", "getItemMaxCount")
|
||||
}
|
||||
|
||||
/** 静态悬浮字类列表 @type {Map<number,StaticFloatingText>} */
|
||||
@@ -2487,11 +2489,21 @@ LLSE_Player.prototype.sendInventorySlotPacket =
|
||||
LLSE_Container.prototype.getContainerType =
|
||||
/**
|
||||
* 获取容器类型
|
||||
* @returns {string}
|
||||
*/
|
||||
function () {
|
||||
return GMLIB_API.getContainerType(this);
|
||||
}
|
||||
|
||||
LLSE_Item.prototype.getMaxCount =
|
||||
/**
|
||||
* 获取物品最大堆叠数量
|
||||
* @returns {number}
|
||||
*/
|
||||
function () {
|
||||
return GMLIB_API.getItemMaxCount(this);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
StaticFloatingText,
|
||||
DynamicFloatingText,
|
||||
|
||||
Reference in New Issue
Block a user