|
|
|
@ -13,10 +13,12 @@ class ChunkmasterEvents(private val chunkmaster: Chunkmaster, private val server
|
|
|
|
|
/**
|
|
|
|
|
* Autostart generation tasks
|
|
|
|
|
*/
|
|
|
|
|
@EventHandler fun onPlayerQuit(event: PlayerQuitEvent) {
|
|
|
|
|
@EventHandler
|
|
|
|
|
fun onPlayerQuit(event: PlayerQuitEvent) {
|
|
|
|
|
if (pauseOnJoin) {
|
|
|
|
|
if (server.onlinePlayers.size == 1 && server.onlinePlayers.contains(event.player) ||
|
|
|
|
|
server.onlinePlayers.isEmpty()) {
|
|
|
|
|
server.onlinePlayers.isEmpty()
|
|
|
|
|
) {
|
|
|
|
|
if (!chunkmaster.generationManager.paused) {
|
|
|
|
|
chunkmaster.generationManager.startAll()
|
|
|
|
|
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
|
|
|
|
|
*/
|
|
|
|
|
@EventHandler fun onPlayerJoin(event: PlayerJoinEvent) {
|
|
|
|
|
@EventHandler
|
|
|
|
|
fun onPlayerJoin(event: PlayerJoinEvent) {
|
|
|
|
|
if (pauseOnJoin) {
|
|
|
|
|
if (server.onlinePlayers.size == 1 || server.onlinePlayers.isEmpty()) {
|
|
|
|
|
chunkmaster.generationManager.stopAll()
|
|
|
|
|