新增2事件,修改2事件,2接口
新增事件: - SpawnWanderingTrader - HandleRequestAction 修改事件: - ProjectileTryCreate - ProjectileCreate 修改接口: - getPlayerFromUniqueId - getEntityFromUniqueId
This commit is contained in:
Vendored
+34
-2
@@ -177,7 +177,9 @@ declare class Event {
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 弹射物实体对象 */
|
||||
entity: Entity
|
||||
entity: Entity,
|
||||
/** 创建弹射的实体的uniqueID */
|
||||
uniqueId: number
|
||||
) => boolean | void
|
||||
): boolean;
|
||||
|
||||
@@ -188,7 +190,37 @@ declare class Event {
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 弹射物实体对象 */
|
||||
entity: Entity
|
||||
entity: Entity,
|
||||
/** 创建弹射的实体的uniqueID */
|
||||
uniqueId: number
|
||||
) => void
|
||||
): boolean;
|
||||
|
||||
/** 生成流浪商人 */
|
||||
static listen(
|
||||
/** 事件名 */
|
||||
event: "SpawnWanderingTrader",
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 生成的坐标 */
|
||||
pos: IntPos
|
||||
) => boolean | void
|
||||
): boolean;
|
||||
|
||||
/** 处理物品请求 */
|
||||
static listen(
|
||||
/** 事件名 */
|
||||
event: "HandleRequestAction",
|
||||
/** 回调函数 */
|
||||
listener: (
|
||||
/** 请求玩家 */
|
||||
player: Player,
|
||||
/** 请求类型 */
|
||||
actionType: string,
|
||||
/** 容器ID */
|
||||
ContainerNetId: string,
|
||||
/** 请求的槽位 */
|
||||
slot: number
|
||||
) => boolean | void
|
||||
): boolean;
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -276,12 +276,12 @@ declare class Minecraft {
|
||||
|
||||
/** 根据UniqueId获取玩家对象 */
|
||||
static getPlayerFromUniqueId(
|
||||
uniqueId: string
|
||||
uniqueId: string | number
|
||||
): Player;
|
||||
|
||||
/** 根据UniqueId获取实体对象 */
|
||||
static getEntityFromUniqueId(
|
||||
uniqueId: string
|
||||
uniqueId: string | number
|
||||
): Entity;
|
||||
|
||||
/** 获取方块runtimeId */
|
||||
|
||||
+4
-4
@@ -805,20 +805,20 @@ class Minecraft {
|
||||
|
||||
/**
|
||||
* 根据UniqueId获取玩家对象
|
||||
* @param {string} uniqueId 玩家的UniqueId
|
||||
* @param {string|number} uniqueId 玩家的UniqueId
|
||||
* @returns {Player} 玩家对象
|
||||
*/
|
||||
static getPlayerFromUniqueId(uniqueId) {
|
||||
return GMLIB_API.getPlayerFromUniqueId(uniqueId);
|
||||
return GMLIB_API.getPlayerFromUniqueId(uniqueId.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据UniqueId获取实体对象
|
||||
* @param {string} uniqueId 实体的UniqueId
|
||||
* @param {string|number} uniqueId 实体的UniqueId
|
||||
* @returns {Entity} 实体对象
|
||||
*/
|
||||
static getEntityFromUniqueId(uniqueId) {
|
||||
return GMLIB_API.getEntityFromUniqueId(uniqueId);
|
||||
return GMLIB_API.getEntityFromUniqueId(uniqueId.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user