|
|
@ -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) |
|
|
|