Add WorldManager and map-system support
Introduce WorldManager to select and unpack a random map ZIP into the server root before startup. The plugin now calls WorldManager.prepareRandomWorld() in onLoad (before onEnable) and reloads config there. Added map-system config options (enabled, zip-folder, target-world-name, maps) with example entries. WorldManager deletes existing world folders, extracts the chosen ZIP (with zip-slip protection) and logs progress.
This commit is contained in:
@@ -18,6 +18,7 @@ import club.mcscrims.speedhg.listener.SoupListener
|
||||
import club.mcscrims.speedhg.listener.StatsListener
|
||||
import club.mcscrims.speedhg.scoreboard.ScoreboardManager
|
||||
import club.mcscrims.speedhg.webhook.DiscordWebhookManager
|
||||
import club.mcscrims.speedhg.world.WorldManager
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.NamespacedKey
|
||||
@@ -58,11 +59,19 @@ class SpeedHG : JavaPlugin() {
|
||||
lateinit var discordWebhookManager: DiscordWebhookManager
|
||||
private set
|
||||
|
||||
override fun onEnable()
|
||||
override fun onLoad()
|
||||
{
|
||||
instance = this
|
||||
saveDefaultConfig()
|
||||
|
||||
saveDefaultConfig()
|
||||
reloadConfig()
|
||||
|
||||
val worldManager = WorldManager( this )
|
||||
worldManager.prepareRandomWorld()
|
||||
}
|
||||
|
||||
override fun onEnable()
|
||||
{
|
||||
databaseManager = DatabaseManager( this )
|
||||
try {
|
||||
databaseManager.connect()
|
||||
|
||||
Reference in New Issue
Block a user