1
0
Fork 0

Create data folder when starting out

main
Mari 4 years ago
parent c50408bf11
commit 6a0f96eb49
  1. 7
      src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt

@ -33,6 +33,13 @@ class MinecraftPortalPlugin() : JavaPlugin(), Listener
override fun onEnable() { override fun onEnable() {
super.onEnable() super.onEnable()
if (!dataFolder.isDirectory) {
if (dataFolder.exists()) {
throw IllegalStateException("Data folder already exists but not as a directory")
} else {
dataFolder.mkdirs()
}
}
portals.loadFromAndAutoSaveTo(server, dataFolder.resolve("portal_data.binproto"), dataFolder.resolve("portal_data.binproto.bak")) portals.loadFromAndAutoSaveTo(server, dataFolder.resolve("portal_data.binproto"), dataFolder.resolve("portal_data.binproto.bak"))
portals.validateWorldOnStartup(logger) portals.validateWorldOnStartup(logger)
portals.launchEffectsOnStartup(this) portals.launchEffectsOnStartup(this)

Loading…
Cancel
Save