public interface WorldBorder
限定符和类型 | 方法和说明 |
---|---|
Location |
getCenter()
得到当前边界的中心.
|
double |
getDamageAmount()
获取越过结界后所受到的伤害值
原文:Gets the current border damage amount.
|
double |
getDamageBuffer()
得到当前边界的破坏缓冲.
|
double |
getSize()
获得指定世界当前的边界长度.
|
int |
getWarningDistance()
获取玩家离方块多远时会被警告
原文:Gets the current border warning distance.
|
int |
getWarningTime()
获取临近结界的时候屏幕变红警告玩家的时间
原文:Gets the current border warning time in seconds.
|
boolean |
isInside(Location location)
检查指定的位置是否在这个边界里面.
|
void |
reset()
将世界的边界恢复为默认值.
|
void |
setCenter(double x,
double z)
设置新的边界中心.
|
void |
setCenter(Location location)
设置新的边界中心
原文:Sets the new border center.
|
void |
setDamageAmount(double damage)
设置越界后所受到的伤害值
原文:Sets the amount of damage a player takes when outside the border plus the border buffer.
|
void |
setDamageBuffer(double blocks)
设置玩家在越过结界后几个方块后受到伤害(也就是玩家越界后安全的范围),切忌填写负数参数
原文:Sets the amount of blocks a player may safely be outside the border before taking damage.
|
void |
setSize(double newSize)
以方块为单位,将边界设置为一个指定长度的正方形.
|
void |
setSize(double newSize,
long seconds)
以方块为单位,将边界设置为一个指定长度的正方形.
|
void |
setWarningDistance(int distance)
设置玩家离结界几个方块的时候会被警告
原文:Sets the warning distance that causes the screen to be tinted red when the player is within the specified number of blocks from the border.
|
void |
setWarningTime(int seconds)
设置玩家接近结界的时候警告玩家的秒数(警告也就是当玩家接近结界的时候,玩家的屏幕会被渲染成红色边框以此来警告玩家不要越界)
原文:Sets the warning time that causes the screen to be tinted red when a contracting border will reach the player within the specified time.
|
void reset()
原文:Resets the border to default values.
double getSize()
原文:Gets the current side length of the border.
void setSize(double newSize)
原文:Sets the border to a square region with the specified side length in blocks.
newSize
- 边界的新长度.void setSize(double newSize, long seconds)
原文:Sets the border to a square region with the specified side length in blocks.
newSize
- 边界的新长度.seconds
- The time in seconds in which the border grows or shrinks from the previous size to that being set.Location getCenter()
原文:Gets the current border center.
void setCenter(double x, double z)
原文:Sets the new border center.
x
- 新中心的x坐标.z
- 新中心的z坐标.void setCenter(Location location)
原文:Sets the new border center.
location
- 边界新中心的位置. (该位置只包含x z)double getDamageBuffer()
原文:Gets the current border damage buffer.
void setDamageBuffer(double blocks)
原文:Sets the amount of blocks a player may safely be outside the border before taking damage.
blocks
- 越过结界的缓冲方块数量,如果不设置的话默认是5个方块double getDamageAmount()
原文:Gets the current border damage amount.
void setDamageAmount(double damage)
原文:Sets the amount of damage a player takes when outside the border plus the border buffer.
damage
- 要设置的伤害值,默认的是超过一个方块一秒受到0.2伤害int getWarningTime()
原文:Gets the current border warning time in seconds.
void setWarningTime(int seconds)
原文:Sets the warning time that causes the screen to be tinted red when a contracting border will reach the player within the specified time.
seconds
- 警告玩家的秒数,默认是15秒钟int getWarningDistance()
原文:Gets the current border warning distance.
void setWarningDistance(int distance)
原文:Sets the warning distance that causes the screen to be tinted red when the player is within the specified number of blocks from the border.
distance
- 要设置玩家会被警告的距离boolean isInside(Location location)
原文:Check if the specified location is inside this border.
location
- 要检查的位置