|
|
|
@ -33,6 +33,13 @@ class MinecraftPortalPlugin() : JavaPlugin(), Listener |
|
|
|
|
|
|
|
|
|
override fun 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.validateWorldOnStartup(logger) |
|
|
|
|
portals.launchEffectsOnStartup(this) |
|
|
|
|