|
|
@ -13,10 +13,12 @@ class ChunkmasterEvents(private val chunkmaster: Chunkmaster, private val server
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Autostart generation tasks
|
|
|
|
* Autostart generation tasks
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@EventHandler fun onPlayerQuit(event: PlayerQuitEvent) {
|
|
|
|
@EventHandler
|
|
|
|
|
|
|
|
fun onPlayerQuit(event: PlayerQuitEvent) {
|
|
|
|
if (pauseOnJoin) {
|
|
|
|
if (pauseOnJoin) {
|
|
|
|
if (server.onlinePlayers.size == 1 && server.onlinePlayers.contains(event.player) ||
|
|
|
|
if (server.onlinePlayers.size == 1 && server.onlinePlayers.contains(event.player) ||
|
|
|
|
server.onlinePlayers.isEmpty()) {
|
|
|
|
server.onlinePlayers.isEmpty()
|
|
|
|
|
|
|
|
) {
|
|
|
|
if (!chunkmaster.generationManager.paused) {
|
|
|
|
if (!chunkmaster.generationManager.paused) {
|
|
|
|
chunkmaster.generationManager.startAll()
|
|
|
|
chunkmaster.generationManager.startAll()
|
|
|
|
chunkmaster.logger.info("Server is empty. Starting chunk generation tasks.")
|
|
|
|
chunkmaster.logger.info("Server is empty. Starting chunk generation tasks.")
|
|
|
@ -28,7 +30,8 @@ class ChunkmasterEvents(private val chunkmaster: Chunkmaster, private val server
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Autostop generation tasks
|
|
|
|
* Autostop generation tasks
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@EventHandler fun onPlayerJoin(event: PlayerJoinEvent) {
|
|
|
|
@EventHandler
|
|
|
|
|
|
|
|
fun onPlayerJoin(event: PlayerJoinEvent) {
|
|
|
|
if (pauseOnJoin) {
|
|
|
|
if (pauseOnJoin) {
|
|
|
|
if (server.onlinePlayers.size == 1 || server.onlinePlayers.isEmpty()) {
|
|
|
|
if (server.onlinePlayers.size == 1 || server.onlinePlayers.isEmpty()) {
|
|
|
|
chunkmaster.generationManager.stopAll()
|
|
|
|
chunkmaster.generationManager.stopAll()
|
|
|
|