public interface TravelAgent
被应用于EntityPortalEvent
和PlayerPortalEvent
中以帮助开发者复制和修改原版行为。
原文:
The Travel Agent handles the creation and the research of Nether and End
portals when Entities try to use one.
It is used in EntityPortalEvent
and in
PlayerPortalEvent
to help developers
reproduce and/or modify Vanilla behaviour.
限定符和类型 | 方法和说明 |
---|---|
boolean |
createPortal(Location location)
尝试在指定方位附近生成一个传送门。
|
Location |
findOrCreate(Location location)
尝试寻找指定方位附近的传送门,如果找不到则会尝试生成一个。
|
Location |
findPortal(Location location)
尝试寻找指定方位附近的传送门。
|
boolean |
getCanCreatePortal()
返回TravelAgent是否尝试生成目的传送门。
|
int |
getCreationRadius()
获取以指定方位为圆心生成传送门的最大半径。
|
int |
getSearchRadius()
获取寻找有效传送门的搜索半径数值。
|
void |
setCanCreatePortal(boolean create)
设置TravelAgent是否尝试生成目的传送门。
|
TravelAgent |
setCreationRadius(int radius)
设置以指定方位为圆心生成传送门的最大半径。
|
TravelAgent |
setSearchRadius(int radius)
设置搜索有效传送门的方块半径。
|
TravelAgent setSearchRadius(int radius)
原文: Set the Block radius to search in for available portals.
radius
- 以指定方位为圆心搜索传送门的半径int getSearchRadius()
原文: Gets the search radius value for finding an available portal.
TravelAgent setCreationRadius(int radius)
原文: Sets the maximum radius from the given location to create a portal.
radius
- 以指定方位为圆心生成传送门的半径int getCreationRadius()
原文: Gets the maximum radius from the given location to create a portal.
boolean getCanCreatePortal()
原文: Returns whether the TravelAgent will attempt to create a destination portal or not.
void setCanCreatePortal(boolean create)
原文: Sets whether the TravelAgent should attempt to create a destination portal or not.
create
- TravelAgent是否尝试生成目的传送门Location findOrCreate(Location location)
原文: Attempt to find a portal near the given location, if a portal is not found it will attempt to create one.
location
- 搜索传送门的原点createPortal(Location)
Location findPortal(Location location)
原文: Attempt to find a portal near the given location.
location
- 搜索传送门的原点boolean createPortal(Location location)
如果传送到下界将会尝试生成一个下界传送门。
如果传送到末地将会(重新)生成黑曜石平台并清除上方的方块。
原文: Attempt to create a portal near the given location.
In the case of a Nether portal teleportation, this will attempt to create a Nether portal.
In the case of an Ender portal teleportation, this will (re-)create the obsidian platform and clean blocks above it.
location
- 生成传送门的原点