Fix start errors

This commit is contained in:
TDSTOS
2025-12-12 05:12:09 +01:00
parent 1acb5681fc
commit bb47145a73
16 changed files with 200 additions and 61 deletions

View File

@@ -12,7 +12,7 @@ class WorldManager(
private val plugin: SpeedHG
) {
private lateinit var worldName: String
private var worldName = "world"
private lateinit var world: World
fun highestLocationWithRadius(
@@ -113,21 +113,21 @@ class WorldManager(
// CHUNKY >>
plugin.logger.info("Setting up world... [Stage [3]: CHUNKY]")
val chunky = Bukkit.getServicesManager().load( ChunkyAPI::class.java )
if ( chunky == null || chunky.version() != 0 )
{
plugin.isReady = true
return
}
val radius = world.worldBorder.size / 2
chunky.startTask( worldName, "square", 0.0, 0.0, radius, radius, "concentric" )
chunky.onGenerationComplete { plugin.isReady = true }
plugin.server.dispatchCommand( Bukkit.getConsoleSender(), "chunky silent" )
// plugin.logger.info("Setting up world... [Stage [3]: CHUNKY]")
// val chunky = Bukkit.getServicesManager().load( ChunkyAPI::class.java )
//
// if ( chunky == null || chunky.version() != 0 )
// {
// plugin.isReady = true
// return
// }
//
// val radius = world.worldBorder.size / 2
//
// chunky.startTask( worldName, "square", 0.0, 0.0, radius, radius, "concentric" )
// chunky.onGenerationComplete { plugin.isReady = true }
//
// plugin.server.dispatchCommand( Bukkit.getConsoleSender(), "chunky silent" )
// FINISH >>
@@ -150,7 +150,9 @@ class WorldManager(
fun getWorld(): World?
{
return if ( !::world.isInitialized )
setWorld( plugin.pluginConfig.data.world.name )
try {
setWorld( plugin.pluginConfig.data.world.name )
} catch ( _: Exception ) { null }
else this.world
}