添加/修改
- 添加entityHasFamily,getPlayerDestroyBlockProgress接口 - 修改6事件名
This commit is contained in:
Vendored
+6
-6
@@ -160,7 +160,7 @@ declare class Event {
|
||||
/** 末影龙重生事件 */
|
||||
static listen(
|
||||
/** 事件名 */
|
||||
event: "DragonRespawn",
|
||||
event: "onDragonRespawn",
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 末影龙重生后的UniqueID */
|
||||
@@ -171,7 +171,7 @@ declare class Event {
|
||||
/** 弹射物实体尝试创建 */
|
||||
static listen(
|
||||
/** 事件名 */
|
||||
event: "ProjectileTryCreate",
|
||||
event: "onProjectileTryCreate",
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 弹射物实体对象 */
|
||||
@@ -184,7 +184,7 @@ declare class Event {
|
||||
/** 弹射物实体成功后(不可拦截) */
|
||||
static listen(
|
||||
/** 事件名 */
|
||||
event: "ProjectileCreate",
|
||||
event: "onProjectileCreate",
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 弹射物实体对象 */
|
||||
@@ -197,7 +197,7 @@ declare class Event {
|
||||
/** 生成流浪商人 */
|
||||
static listen(
|
||||
/** 事件名 */
|
||||
event: "SpawnWanderingTrader",
|
||||
event: "onSpawnWanderingTrader",
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 生成的坐标 */
|
||||
@@ -208,7 +208,7 @@ declare class Event {
|
||||
/** 处理物品请求 */
|
||||
static listen(
|
||||
/** 事件名 */
|
||||
event: "HandleRequestAction",
|
||||
event: "onHandleRequestAction",
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 请求玩家 */
|
||||
@@ -231,7 +231,7 @@ declare class Event {
|
||||
/** 发送容器关闭数据包后(不可拦截) */
|
||||
static listen(
|
||||
/** 事件名 */
|
||||
event: "SendContainerClosePacket",
|
||||
event: "onSendContainerClosePacket",
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 要被关闭的玩家 */
|
||||
|
||||
Vendored
+13
-1
@@ -1073,6 +1073,12 @@ interface Player {
|
||||
/** 物品 */
|
||||
item: Item
|
||||
): void;
|
||||
|
||||
/** (GMLIB)获取玩家破坏方块所需时间 */
|
||||
getDestroyProgress(
|
||||
/** 方块对象 */
|
||||
block: Block
|
||||
): number;
|
||||
}
|
||||
|
||||
interface Entity {
|
||||
@@ -1123,8 +1129,14 @@ interface Entity {
|
||||
/** (GMLIB)获取实体的命名 */
|
||||
getNameTag(): string;
|
||||
|
||||
/** 获取实体的主人 */
|
||||
/** (GMLIB)获取实体的主人 */
|
||||
getEntityOwner(): Entity | null;
|
||||
|
||||
/** (GMLIB)实体是否包含在某类里 */
|
||||
hasFamily(
|
||||
/** 实体族 */
|
||||
family: string
|
||||
): boolean;
|
||||
}
|
||||
|
||||
interface Block {
|
||||
|
||||
+25
-1
@@ -339,7 +339,11 @@ const GMLIB_API = {
|
||||
/** 玩家是否拥有NBT @type {function(string):boolean} */
|
||||
hasPlayerNbt: ll.import("GMLIB_API", "hasPlayerNbt"),
|
||||
/** 获取物品最大堆叠数量 @type {function(Item):number} */
|
||||
getItemMaxCount: ll.import("GMLIB_API", "getItemMaxCount")
|
||||
getItemMaxCount: ll.import("GMLIB_API", "getItemMaxCount"),
|
||||
/** 实体包含在某族里 @type {function(Entity,string):boolean} */
|
||||
entityHasFamily: ll.import("GMLIB_API", "entityHasFamily"),
|
||||
/** 获取玩家破坏方块所需时间 @type {function(Player,Block):number} */
|
||||
getPlayerDestroyBlockProgress: ll.import("GMLIB_API", "getPlayerDestroyBlockProgress")
|
||||
}
|
||||
|
||||
/** 静态悬浮字类列表 @type {Map<number,StaticFloatingText>} */
|
||||
@@ -2504,6 +2508,26 @@ LLSE_Item.prototype.getMaxCount =
|
||||
return GMLIB_API.getItemMaxCount(this);
|
||||
}
|
||||
|
||||
LLSE_Entity.prototype.hasFamily =
|
||||
/**
|
||||
* 实体是否拥包含在某族里
|
||||
* @param {string} family 实体族
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function (family) {
|
||||
return GMLIB_API.entityHasFamily(this, family);
|
||||
}
|
||||
|
||||
LLSE_Player.prototype.getDestroyProgress =
|
||||
/**
|
||||
* 获取玩家破坏方块所需时间
|
||||
* @param {Block} block
|
||||
* @returns {number}
|
||||
*/
|
||||
function (block) {
|
||||
return GMLIB_API.getPlayerDestroyBlockProgress(this, block);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
StaticFloatingText,
|
||||
DynamicFloatingText,
|
||||
|
||||
Reference in New Issue
Block a user