mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-04-13 09:41:09 +00:00
SPIGOT-7946: API for server pause when empty seconds
This commit is contained in:
parent
54a3693866
commit
1e2e6a184a
2 changed files with 42 additions and 0 deletions
|
@ -1845,6 +1845,30 @@ public final class Bukkit {
|
||||||
return server.getIdleTimeout();
|
return server.getIdleTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the pause when empty threshold seconds. To save resources, the
|
||||||
|
* server will pause most functions after this time if there are no players
|
||||||
|
* online.
|
||||||
|
*
|
||||||
|
* @return the pause threshold in seconds
|
||||||
|
*/
|
||||||
|
public static int getPauseWhenEmptyTime() {
|
||||||
|
return server.getPauseWhenEmptyTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the pause when empty threshold seconds. To save resources, the
|
||||||
|
* server will pause most functions after this time if there are no players
|
||||||
|
* online.
|
||||||
|
* <p>
|
||||||
|
* A value of less than 0 will disable the setting
|
||||||
|
*
|
||||||
|
* @param seconds the pause threshold in seconds
|
||||||
|
*/
|
||||||
|
public static void setPauseWhenEmptyTime(int seconds) {
|
||||||
|
server.setPauseWhenEmptyTime(seconds);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a ChunkData for use in a generator.
|
* Create a ChunkData for use in a generator.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1565,6 +1565,24 @@ public interface Server extends PluginMessageRecipient {
|
||||||
*/
|
*/
|
||||||
public int getIdleTimeout();
|
public int getIdleTimeout();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the pause when empty threshold seconds. To save resources, the
|
||||||
|
* pause most functions after this time if there are no players online.
|
||||||
|
*
|
||||||
|
* @return the pause threshold in seconds
|
||||||
|
*/
|
||||||
|
public int getPauseWhenEmptyTime();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the pause when empty threshold seconds. To save resources, the
|
||||||
|
* pause most functions after this time if there are no players online.
|
||||||
|
* <p>
|
||||||
|
* A value of less than 0 will disable the setting
|
||||||
|
*
|
||||||
|
* @param seconds the pause threshold in seconds
|
||||||
|
*/
|
||||||
|
public void setPauseWhenEmptyTime(int seconds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a ChunkData for use in a generator.
|
* Create a ChunkData for use in a generator.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue