新增hasPlayerNbt接口
This commit is contained in:
+14
-3
@@ -30,7 +30,7 @@ const GMLIB_API = {
|
||||
getPlayerNbt: ll.import("GMLIB_API", "getPlayerNbt"),
|
||||
/** 设置玩家NBT @type {function(string,NbtCompound,boolean):boolean} */
|
||||
setPlayerNbt: ll.import("GMLIB_API", "setPlayerNbt"),
|
||||
/** 覆盖玩家的特定nbtTags @type {function(string,NbtCompound,string):boolean} */
|
||||
/** 覆盖玩家的特定nbtTags @type {function(string,NbtCompound,Array.<string>):boolean} */
|
||||
setPlayerNbtTags: ll.import("GMLIB_API", "setPlayerNbtTags"),
|
||||
/** 删除玩家所有的NBT @type {function(string):boolean} */
|
||||
deletePlayerNbt: ll.import("GMLIB_API", "deletePlayerNbt"),
|
||||
@@ -335,7 +335,9 @@ const GMLIB_API = {
|
||||
/** 更新玩家容器物品 @type {function(Player,number,number,Item):void} */
|
||||
sendInventorySlotPacket: ll.import("GMLIB_API", "sendInventorySlotPacket"),
|
||||
/** 获取容器类型 @type {function(Container):string} */
|
||||
getContainerType: ll.import("GMLIB_API", "getContainerType")
|
||||
getContainerType: ll.import("GMLIB_API", "getContainerType"),
|
||||
/** 玩家是否拥有NBT @type {function(string):boolean} */
|
||||
hasPlayerNbt: ll.import("GMLIB_API", "hasPlayerNbt")
|
||||
}
|
||||
|
||||
/** 静态悬浮字类列表 @type {Map<number,StaticFloatingText>} */
|
||||
@@ -656,7 +658,7 @@ class Minecraft {
|
||||
* 覆盖玩家NBT的特定Tags
|
||||
* @param {string} uuid 玩家的uuid
|
||||
* @param {NbtCompound} nbt 要写入的NBT
|
||||
* @param {string} tags 要覆盖的NBT标签
|
||||
* @param {Array.<string>} tags 要覆盖的NBT标签
|
||||
* @returns {boolean} 是否成功写入NBT
|
||||
*/
|
||||
static setPlayerNbtTags(uuid, nbt, tags) {
|
||||
@@ -1016,6 +1018,15 @@ class Minecraft {
|
||||
static getMaxPlayers() {
|
||||
return GMLIB_API.getMaxPlayers();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家是否拥有NBT
|
||||
* @param {string} uuid 玩家的uuid
|
||||
* @returns 玩家是否拥有NBT
|
||||
*/
|
||||
static hasPlayerNbt(uuid) {
|
||||
return GMLIB_API.hasPlayerNbt(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
/** 合成表类 */
|
||||
|
||||
Reference in New Issue
Block a user