程序包 org.bukkit
接口 ServerTickManager
public interface ServerTickManager
管理服务器内的刻。
要了解更多关于此接口相关功能的信息。
- 另请参阅:
-
方法概要
修饰符和类型方法说明int获取剩余要运行的冻结刻数。float获取服务器当前的刻速率。booleanisFrozen()检查服务器当前是否已冻结。boolean检查给定的实体是否已冻结。boolean检查服务器是否正常运行。boolean检查服务器当前是否正在疾速运行。boolean检查服务器当前是否正在步进。booleanrequestGameToSprint(int ticks) 尝试启动疾速运行,以比正常速度更快的速率执行所有服务器刻。voidsetFrozen(boolean frozen) 将服务器设置为冻结状态,不处理大多数事物。voidsetTickRate(float tick) 设置服务器的刻速率。booleanstepGameIfFrozen(int ticks) 如果服务器当前已冻结,则步进游戏指定数量的刻。boolean如果当前正在疾速运行,则停止当前疾速运行。boolean如果正在步进,则停止当前步进。
-
方法详细资料
-
isRunningNormally
boolean isRunningNormally()检查服务器是否正常运行。当服务器正常运行时,表示服务器当前未冻结。
- 返回:
- 如果服务器正常运行则返回 true,否则返回 false。
原文:
Checks if the server is running normally.
When the server is running normally it indicates that the server is not currently frozen.
-
isStepping
boolean isStepping()检查服务器当前是否正在步进。- 返回:
- 如果正在步进则返回 true,否则返回 false。 原文: Checks if the server is currently stepping.
-
isSprinting
boolean isSprinting()检查服务器当前是否正在疾速运行。- 返回:
- 如果正在疾速运行则返回 true,否则返回 false。 原文: Checks if the server is currently sprinting.
-
isFrozen
boolean isFrozen()检查服务器当前是否已冻结。- 返回:
- 如果服务器已冻结则返回 true,否则返回 false。 原文: Checks if the server is currently frozen.
-
getTickRate
float getTickRate()获取服务器当前的刻速率。- 返回:
- 服务器当前的刻速率。 原文: Gets the current tick rate of the server.
-
setTickRate
void setTickRate(float tick) 设置服务器的刻速率。服务器的正常刻速率为 20。不能对服务器应用低于 1.0F 或高于 10,000 的刻速率。
- 参数:
tick- 要设置的服务器刻速率。tick- the tick rate to set the server to- 抛出:
IllegalArgumentException- 如果刻速率太低或太高,服务器无法处理。 原文: Sets the tick rate of the server.The normal tick rate of the server is 20. No tick rate below 1.0F or above 10,000 can be applied to the server.
IllegalArgumentException- if tick rate is too low or too high for the server to handle
-
setFrozen
void setFrozen(boolean frozen) 将服务器设置为冻结状态,不处理大多数事物。- 参数:
frozen- true 为冻结服务器,否则为 false。 原文: Sets the server to a frozen state that does not tick most things.frozen- true to freeze the server, otherwise false
-
stepGameIfFrozen
boolean stepGameIfFrozen(int ticks) 如果服务器当前已冻结,则步进游戏指定数量的刻。步进在服务器处于冻结状态时发生,可以通过使用游戏内的 /tick freeze 命令或
setFrozen(boolean)方法来启动。 原文: Steps the game a certain amount of ticks if the server is currently frozen.Steps occur when the server is in a frozen state which can be started by either using the in game /tick freeze command or the
setFrozen(boolean)method.- 参数:
ticks- 要步进游戏的刻数。- 返回:
- 如果游戏现在正在步进则返回 true。如果游戏未冻结,则返回 false,请求无法完成。
-
stopStepping
boolean stopStepping()如果正在步进,则停止当前步进。- 返回:
- 如果游戏不再步进则返回 true。如果服务器未步进或已完成步进则返回 false。 原文: Stops the current stepping if stepping is occurring.
-
requestGameToSprint
boolean requestGameToSprint(int ticks) 尝试启动疾速运行,以比正常速度更快的速率执行所有服务器刻。- 参数:
ticks- 要疾速运行的刻数。ticks- the amount of ticks to sprint for- 返回:
- 如果疾速运行已被启动并被停止则返回 true,否则返回 false。 原文: Attempts to initiate a sprint, which executes all server ticks at a faster rate then normal.
-
stopSprinting
boolean stopSprinting()如果当前正在疾速运行,则停止当前疾速运行。- 返回:
- 如果游戏不再疾速运行则返回 true,如果服务器未疾速运行或已完成疾速运行则返回 false。 原文: Stops the current sprint if one is currently happening.
-
isFrozen
检查给定的实体是否已冻结。- 参数:
entity- 要检查是否冻结的实体。entity- the entity to check if frozen.- 返回:
- 如果实体当前已冻结则返回 true,否则返回 false。 原文: Checks if a given entity is frozen.
-
getFrozenTicksToRun
int getFrozenTicksToRun()获取剩余要运行的冻结刻数。- 返回:
- 剩余要运行的冻结刻数。 原文: Gets the amount of frozen ticks left to run.
-