mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-15 10:55:20 +01:00
Auto rename plugin data folder (MinePacks -> Minepacks)
this should be only relevant for case sensitive filesystems
This commit is contained in:
parent
b6bbc7d103
commit
ebce19d2d2
@ -44,6 +44,7 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@ -82,6 +83,17 @@ public void onEnable()
|
||||
return;
|
||||
}
|
||||
//endregion
|
||||
//region check if a plugin folder exists (was renamed from MinePacks to Minepacks with the V2.0 update)
|
||||
if(!getDataFolder().exists())
|
||||
{
|
||||
File oldPluginFolder = new File(getDataFolder().getParentFile(), "MinePacks");
|
||||
if(oldPluginFolder.exists() && !oldPluginFolder.renameTo(getDataFolder()))
|
||||
{
|
||||
getLogger().warning("Failed to rename the plugins data-folder.\n" +
|
||||
"Please rename the \"MinePacks\" folder to \"Minepacks\" and restart the server, to move your data from Minepacks V1.X to Minepacks V2.X!");
|
||||
}
|
||||
}
|
||||
//endregion
|
||||
instance = this;
|
||||
config = new Config(this);
|
||||
lang = new Language(this);
|
||||
|
Loading…
Reference in New Issue
Block a user