程序包 org.bukkit
接口 ServerTickManager
public interface ServerTickManager
Manages ticking within a server.
To learn more about the features surrounding this interface.
- 另请参阅:
-
方法概要
修饰符和类型方法说明int
Gets the amount of frozen ticks left to run.float
Gets the current tick rate of the server.boolean
isFrozen()
Checks if the server is currently frozen.boolean
Checks if a given entity is frozen.boolean
Checks if the server is running normally.boolean
Checks if the server is currently sprinting.boolean
Checks if the server is currently stepping.boolean
requestGameToSprint
(int ticks) Attempts to initiate a sprint, which executes all server ticks at a faster rate then normal.void
setFrozen
(boolean frozen) Sets the server to a frozen state that does not tick most things.void
setTickRate
(float tick) Sets the tick rate of the server.boolean
stepGameIfFrozen
(int ticks) Steps the game a certain amount of ticks if the server is currently frozen.boolean
Stops the current sprint if one is currently happening.boolean
Stops the current stepping if stepping is occurring.
-
方法详细资料
-
isRunningNormally
boolean isRunningNormally()Checks if the server is running normally.When the server is running normally it indicates that the server is not currently frozen.
- 返回:
- true if the server is running normally, otherwise false
-
isStepping
boolean isStepping()Checks if the server is currently stepping.- 返回:
- true if stepping, otherwise false
-
isSprinting
boolean isSprinting()Checks if the server is currently sprinting.- 返回:
- true if sprinting, otherwise false
-
isFrozen
boolean isFrozen()Checks if the server is currently frozen.- 返回:
- true if the server is frozen, otherwise false
-
getTickRate
float getTickRate()Gets the current tick rate of the server.- 返回:
- the current tick rate of the server
-
setTickRate
void setTickRate(float tick) 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.
- 参数:
tick
- the tick rate to set the server to- 抛出:
IllegalArgumentException
- if tick rate is too low or too high for the server to handle
-
setFrozen
void setFrozen(boolean frozen) 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) 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
- the amount of ticks to step the game for- 返回:
- true if the game is now stepping. False if the game is not frozen so the request could not be fulfilled.
-
stopStepping
boolean stopStepping()Stops the current stepping if stepping is occurring.- 返回:
- true if the game is no-longer stepping. False if the server was not stepping or was already done stepping.
-
requestGameToSprint
boolean requestGameToSprint(int ticks) Attempts to initiate a sprint, which executes all server ticks at a faster rate then normal.- 参数:
ticks
- the amount of ticks to sprint for- 返回:
- true if a sprint was already initiated and was stopped, otherwise false
-
stopSprinting
boolean stopSprinting()Stops the current sprint if one is currently happening.- 返回:
- true if the game is no-longer sprinting, false if the server was not sprinting or was already done sprinting
-
isFrozen
Checks if a given entity is frozen.- 参数:
entity
- the entity to check if frozen.- 返回:
- true if the entity is currently frozen otherwise false.
-
getFrozenTicksToRun
int getFrozenTicksToRun()Gets the amount of frozen ticks left to run.- 返回:
- the amount of frozen ticks left to run
-